diff --git a/js/dist/shinychat.js b/js/dist/shinychat.js index 5ffa8c25b..69501ae96 100644 --- a/js/dist/shinychat.js +++ b/js/dist/shinychat.js @@ -4,40 +4,40 @@ * MIT License * https://posit-dev.github.io/shinychat/ */ -var C8=Object.create;var X0=Object.defineProperty;var A8=Object.getOwnPropertyDescriptor;var N8=Object.getOwnPropertyNames;var w8=Object.getPrototypeOf,R8=Object.prototype.hasOwnProperty;var Ht=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wd=(e,t)=>{for(var n in t)X0(e,n,{get:t[n],enumerable:!0})},k8=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of N8(t))!R8.call(e,i)&&i!==n&&X0(e,i,{get:()=>t[i],enumerable:!(r=A8(t,i))||r.enumerable});return e};var G=(e,t,n)=>(n=e!=null?C8(w8(e)):{},k8(t||!e||!e.__esModule?X0(n,"default",{value:e,enumerable:!0}):n,e));var Pv=Ht(_t=>{"use strict";function eb(e,t){var n=e.length;e.push(t);e:for(;0>>1,i=e[r];if(0>>1;rjd(a,n))ljd(u,a)?(e[r]=u,e[l]=n,r=l):(e[r]=a,e[s]=n,r=s);else if(ljd(u,n))e[r]=u,e[l]=n,r=l;else break e}}return t}function jd(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}_t.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Nv=performance,_t.unstable_now=function(){return Nv.now()}):(Q0=Date,wv=Q0.now(),_t.unstable_now=function(){return Q0.now()-wv});var Nv,Q0,wv,zi=[],Bo=[],M8=1,Lr=null,Cn=3,tb=!1,cc=!1,fc=!1,nb=!1,Mv=typeof setTimeout=="function"?setTimeout:null,Ov=typeof clearTimeout=="function"?clearTimeout:null,Rv=typeof setImmediate<"u"?setImmediate:null;function Xd(e){for(var t=fi(Bo);t!==null;){if(t.callback===null)Qd(Bo);else if(t.startTime<=e)Qd(Bo),t.sortIndex=t.expirationTime,eb(zi,t);else break;t=fi(Bo)}}function rb(e){if(fc=!1,Xd(e),!cc)if(fi(zi)!==null)cc=!0,dl||(dl=!0,fl());else{var t=fi(Bo);t!==null&&ib(rb,t.startTime-e)}}var dl=!1,dc=-1,Dv=5,Iv=-1;function Lv(){return nb?!0:!(_t.unstable_now()-Ive&&Lv());){var r=Lr.callback;if(typeof r=="function"){Lr.callback=null,Cn=Lr.priorityLevel;var i=r(Lr.expirationTime<=e);if(e=_t.unstable_now(),typeof i=="function"){Lr.callback=i,Xd(e),t=!0;break t}Lr===fi(zi)&&Qd(zi),Xd(e)}else Qd(zi);Lr=fi(zi)}if(Lr!==null)t=!0;else{var o=fi(Bo);o!==null&&ib(rb,o.startTime-e),t=!1}}break e}finally{Lr=null,Cn=n,tb=!1}t=void 0}}finally{t?fl():dl=!1}}}var fl;typeof Rv=="function"?fl=function(){Rv(Z0)}:typeof MessageChannel<"u"?(J0=new MessageChannel,kv=J0.port2,J0.port1.onmessage=Z0,fl=function(){kv.postMessage(null)}):fl=function(){Mv(Z0,0)};var J0,kv;function ib(e,t){dc=Mv(function(){e(_t.unstable_now())},t)}_t.unstable_IdlePriority=5;_t.unstable_ImmediatePriority=1;_t.unstable_LowPriority=4;_t.unstable_NormalPriority=3;_t.unstable_Profiling=null;_t.unstable_UserBlockingPriority=2;_t.unstable_cancelCallback=function(e){e.callback=null};_t.unstable_forceFrameRate=function(e){0>e||125r?(e.sortIndex=n,eb(Bo,e),fi(zi)===null&&e===fi(Bo)&&(fc?(Ov(dc),dc=-1):fc=!0,ib(rb,n-r))):(e.sortIndex=i,eb(zi,e),cc||tb||(cc=!0,dl||(dl=!0,fl()))),e};_t.unstable_shouldYield=Lv;_t.unstable_wrapCallback=function(e){var t=Cn;return function(){var n=Cn;Cn=t;try{return e.apply(this,arguments)}finally{Cn=n}}}});var Uv=Ht((soe,Bv)=>{"use strict";Bv.exports=Pv()});var jv=Ht(Re=>{"use strict";var ab=Symbol.for("react.transitional.element"),O8=Symbol.for("react.portal"),D8=Symbol.for("react.fragment"),I8=Symbol.for("react.strict_mode"),L8=Symbol.for("react.profiler"),P8=Symbol.for("react.consumer"),B8=Symbol.for("react.context"),U8=Symbol.for("react.forward_ref"),F8=Symbol.for("react.suspense"),H8=Symbol.for("react.memo"),Vv=Symbol.for("react.lazy"),z8=Symbol.for("react.activity"),Fv=Symbol.iterator;function q8(e){return e===null||typeof e!="object"?null:(e=Fv&&e[Fv]||e["@@iterator"],typeof e=="function"?e:null)}var Gv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Kv=Object.assign,Yv={};function hl(e,t,n){this.props=e,this.context=t,this.refs=Yv,this.updater=n||Gv}hl.prototype.isReactComponent={};hl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};hl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $v(){}$v.prototype=hl.prototype;function lb(e,t,n){this.props=e,this.context=t,this.refs=Yv,this.updater=n||Gv}var ub=lb.prototype=new $v;ub.constructor=lb;Kv(ub,hl.prototype);ub.isPureReactComponent=!0;var Hv=Array.isArray;function sb(){}var mt={H:null,A:null,T:null,S:null},Wv=Object.prototype.hasOwnProperty;function cb(e,t,n){var r=n.ref;return{$$typeof:ab,type:e,key:t,ref:r!==void 0?r:null,props:n}}function V8(e,t){return cb(e.type,t,e.props)}function fb(e){return typeof e=="object"&&e!==null&&e.$$typeof===ab}function G8(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var zv=/\/+/g;function ob(e,t){return typeof e=="object"&&e!==null&&e.key!=null?G8(""+e.key):t.toString(36)}function K8(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(sb,sb):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function pl(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case ab:case O8:s=!0;break;case Vv:return s=e._init,pl(s(e._payload),t,n,r,i)}}if(s)return i=i(e),s=r===""?"."+ob(e,0):r,Hv(i)?(n="",s!=null&&(n=s.replace(zv,"$&/")+"/"),pl(i,t,n,"",function(u){return u})):i!=null&&(fb(i)&&(i=V8(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(zv,"$&/")+"/")+s)),t.push(i)),1;s=0;var a=r===""?".":r+":";if(Hv(e))for(var l=0;l{"use strict";Xv.exports=jv()});var Zv=Ht(Bn=>{"use strict";var W8=fe();function Qv(e){var t="https://react.dev/errors/"+e;if(1{"use strict";function Jv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jv)}catch(e){console.error(e)}}Jv(),eC.exports=Zv()});var dR=Ht(vh=>{"use strict";var Xt=Uv(),AA=fe(),Q8=qi();function W(e){var t="https://react.dev/errors/"+e;if(1Sl||(e.current=Xb[Sl],Xb[Sl]=null,Sl--)}function ft(e,t){Sl++,Xb[Sl]=e.current,e.current=t}var mi=gi(null),Fc=gi(null),Xo=gi(null),Dp=gi(null);function Ip(e,t){switch(ft(Xo,t),ft(Fc,e),ft(mi,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?uA(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=uA(t),e=Zw(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}en(mi),ft(mi,e)}function Fl(){en(mi),en(Fc),en(Xo)}function Qb(e){e.memoizedState!==null&&ft(Dp,e);var t=mi.current,n=Zw(t,e.type);t!==n&&(ft(Fc,e),ft(mi,n))}function Lp(e){Fc.current===e&&(en(mi),en(Fc)),Dp.current===e&&(en(Dp),Xc._currentValue=js)}var db,rC;function Ks(e){if(db===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);db=t&&t[1]||"",rC=-1()=>(t||e((t={exports:{}}).exports,t),t.exports),Wd=(e,t)=>{for(var n in t)X0(e,n,{get:t[n],enumerable:!0})},M8=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of w8(t))!k8.call(e,i)&&i!==n&&X0(e,i,{get:()=>t[i],enumerable:!(r=N8(t,i))||r.enumerable});return e};var G=(e,t,n)=>(n=e!=null?A8(R8(e)):{},M8(t||!e||!e.__esModule?X0(n,"default",{value:e,enumerable:!0}):n,e));var Pv=Ht(_t=>{"use strict";function eb(e,t){var n=e.length;e.push(t);e:for(;0>>1,i=e[r];if(0>>1;rjd(a,n))ljd(u,a)?(e[r]=u,e[l]=n,r=l):(e[r]=a,e[s]=n,r=s);else if(ljd(u,n))e[r]=u,e[l]=n,r=l;else break e}}return t}function jd(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}_t.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Nv=performance,_t.unstable_now=function(){return Nv.now()}):(Q0=Date,wv=Q0.now(),_t.unstable_now=function(){return Q0.now()-wv});var Nv,Q0,wv,zi=[],Bo=[],O8=1,Lr=null,Cn=3,tb=!1,cc=!1,fc=!1,nb=!1,Mv=typeof setTimeout=="function"?setTimeout:null,Ov=typeof clearTimeout=="function"?clearTimeout:null,Rv=typeof setImmediate<"u"?setImmediate:null;function Xd(e){for(var t=fi(Bo);t!==null;){if(t.callback===null)Qd(Bo);else if(t.startTime<=e)Qd(Bo),t.sortIndex=t.expirationTime,eb(zi,t);else break;t=fi(Bo)}}function rb(e){if(fc=!1,Xd(e),!cc)if(fi(zi)!==null)cc=!0,dl||(dl=!0,fl());else{var t=fi(Bo);t!==null&&ib(rb,t.startTime-e)}}var dl=!1,dc=-1,Dv=5,Iv=-1;function Lv(){return nb?!0:!(_t.unstable_now()-Ive&&Lv());){var r=Lr.callback;if(typeof r=="function"){Lr.callback=null,Cn=Lr.priorityLevel;var i=r(Lr.expirationTime<=e);if(e=_t.unstable_now(),typeof i=="function"){Lr.callback=i,Xd(e),t=!0;break t}Lr===fi(zi)&&Qd(zi),Xd(e)}else Qd(zi);Lr=fi(zi)}if(Lr!==null)t=!0;else{var o=fi(Bo);o!==null&&ib(rb,o.startTime-e),t=!1}}break e}finally{Lr=null,Cn=n,tb=!1}t=void 0}}finally{t?fl():dl=!1}}}var fl;typeof Rv=="function"?fl=function(){Rv(Z0)}:typeof MessageChannel<"u"?(J0=new MessageChannel,kv=J0.port2,J0.port1.onmessage=Z0,fl=function(){kv.postMessage(null)}):fl=function(){Mv(Z0,0)};var J0,kv;function ib(e,t){dc=Mv(function(){e(_t.unstable_now())},t)}_t.unstable_IdlePriority=5;_t.unstable_ImmediatePriority=1;_t.unstable_LowPriority=4;_t.unstable_NormalPriority=3;_t.unstable_Profiling=null;_t.unstable_UserBlockingPriority=2;_t.unstable_cancelCallback=function(e){e.callback=null};_t.unstable_forceFrameRate=function(e){0>e||125r?(e.sortIndex=n,eb(Bo,e),fi(zi)===null&&e===fi(Bo)&&(fc?(Ov(dc),dc=-1):fc=!0,ib(rb,n-r))):(e.sortIndex=i,eb(zi,e),cc||tb||(cc=!0,dl||(dl=!0,fl()))),e};_t.unstable_shouldYield=Lv;_t.unstable_wrapCallback=function(e){var t=Cn;return function(){var n=Cn;Cn=t;try{return e.apply(this,arguments)}finally{Cn=n}}}});var Uv=Ht((uoe,Bv)=>{"use strict";Bv.exports=Pv()});var jv=Ht(Re=>{"use strict";var ab=Symbol.for("react.transitional.element"),D8=Symbol.for("react.portal"),I8=Symbol.for("react.fragment"),L8=Symbol.for("react.strict_mode"),P8=Symbol.for("react.profiler"),B8=Symbol.for("react.consumer"),U8=Symbol.for("react.context"),F8=Symbol.for("react.forward_ref"),H8=Symbol.for("react.suspense"),z8=Symbol.for("react.memo"),Vv=Symbol.for("react.lazy"),q8=Symbol.for("react.activity"),Fv=Symbol.iterator;function V8(e){return e===null||typeof e!="object"?null:(e=Fv&&e[Fv]||e["@@iterator"],typeof e=="function"?e:null)}var Gv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Kv=Object.assign,Yv={};function hl(e,t,n){this.props=e,this.context=t,this.refs=Yv,this.updater=n||Gv}hl.prototype.isReactComponent={};hl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};hl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $v(){}$v.prototype=hl.prototype;function lb(e,t,n){this.props=e,this.context=t,this.refs=Yv,this.updater=n||Gv}var ub=lb.prototype=new $v;ub.constructor=lb;Kv(ub,hl.prototype);ub.isPureReactComponent=!0;var Hv=Array.isArray;function sb(){}var mt={H:null,A:null,T:null,S:null},Wv=Object.prototype.hasOwnProperty;function cb(e,t,n){var r=n.ref;return{$$typeof:ab,type:e,key:t,ref:r!==void 0?r:null,props:n}}function G8(e,t){return cb(e.type,t,e.props)}function fb(e){return typeof e=="object"&&e!==null&&e.$$typeof===ab}function K8(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var zv=/\/+/g;function ob(e,t){return typeof e=="object"&&e!==null&&e.key!=null?K8(""+e.key):t.toString(36)}function Y8(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(sb,sb):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function pl(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case ab:case D8:s=!0;break;case Vv:return s=e._init,pl(s(e._payload),t,n,r,i)}}if(s)return i=i(e),s=r===""?"."+ob(e,0):r,Hv(i)?(n="",s!=null&&(n=s.replace(zv,"$&/")+"/"),pl(i,t,n,"",function(u){return u})):i!=null&&(fb(i)&&(i=G8(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(zv,"$&/")+"/")+s)),t.push(i)),1;s=0;var a=r===""?".":r+":";if(Hv(e))for(var l=0;l{"use strict";Xv.exports=jv()});var Zv=Ht(Bn=>{"use strict";var j8=fe();function Qv(e){var t="https://react.dev/errors/"+e;if(1{"use strict";function Jv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jv)}catch(e){console.error(e)}}Jv(),eC.exports=Zv()});var dR=Ht(vh=>{"use strict";var Xt=Uv(),AA=fe(),Z8=qi();function W(e){var t="https://react.dev/errors/"+e;if(1Sl||(e.current=Xb[Sl],Xb[Sl]=null,Sl--)}function ft(e,t){Sl++,Xb[Sl]=e.current,e.current=t}var mi=gi(null),Fc=gi(null),Xo=gi(null),Dp=gi(null);function Ip(e,t){switch(ft(Xo,t),ft(Fc,e),ft(mi,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?uA(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=uA(t),e=Zw(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}en(mi),ft(mi,e)}function Fl(){en(mi),en(Fc),en(Xo)}function Qb(e){e.memoizedState!==null&&ft(Dp,e);var t=mi.current,n=Zw(t,e.type);t!==n&&(ft(Fc,e),ft(mi,n))}function Lp(e){Fc.current===e&&(en(mi),en(Fc)),Dp.current===e&&(en(Dp),Xc._currentValue=js)}var db,rC;function Ks(e){if(db===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);db=t&&t[1]||"",rC=-1)":-1i||l[r]!==u[i]){var c=` -`+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=r&&0<=i);break}}}finally{pb=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ks(n):""}function n9(e,t){switch(e.tag){case 26:case 27:case 5:return Ks(e.type);case 16:return Ks("Lazy");case 13:return e.child!==t&&t!==null?Ks("Suspense Fallback"):Ks("Suspense");case 19:return Ks("SuspenseList");case 0:case 15:return hb(e.type,!1);case 11:return hb(e.type.render,!1);case 1:return hb(e.type,!0);case 31:return Ks("Activity");default:return""}}function iC(e){try{var t="",n=null;do t+=n9(e,n),n=e,e=e.return;while(e);return t}catch(r){return` +`+l[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=r&&0<=i);break}}}finally{pb=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ks(n):""}function r9(e,t){switch(e.tag){case 26:case 27:case 5:return Ks(e.type);case 16:return Ks("Lazy");case 13:return e.child!==t&&t!==null?Ks("Suspense Fallback"):Ks("Suspense");case 19:return Ks("SuspenseList");case 0:case 15:return hb(e.type,!1);case 11:return hb(e.type.render,!1);case 1:return hb(e.type,!0);case 31:return Ks("Activity");default:return""}}function iC(e){try{var t="",n=null;do t+=r9(e,n),n=e,e=e.return;while(e);return t}catch(r){return` Error generating stack: `+r.message+` -`+r.stack}}var Zb=Object.prototype.hasOwnProperty,qy=Xt.unstable_scheduleCallback,mb=Xt.unstable_cancelCallback,r9=Xt.unstable_shouldYield,i9=Xt.unstable_requestPaint,xr=Xt.unstable_now,o9=Xt.unstable_getCurrentPriorityLevel,DA=Xt.unstable_ImmediatePriority,IA=Xt.unstable_UserBlockingPriority,Pp=Xt.unstable_NormalPriority,s9=Xt.unstable_LowPriority,LA=Xt.unstable_IdlePriority,a9=Xt.log,l9=Xt.unstable_setDisableYieldValue,ef=null,_r=null;function Ko(e){if(typeof a9=="function"&&l9(e),_r&&typeof _r.setStrictMode=="function")try{_r.setStrictMode(ef,e)}catch{}}var vr=Math.clz32?Math.clz32:f9,u9=Math.log,c9=Math.LN2;function f9(e){return e>>>=0,e===0?32:31-(u9(e)/c9|0)|0}var tp=256,np=262144,rp=4194304;function Ys(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function lh(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,o=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var a=r&134217727;return a!==0?(r=a&~o,r!==0?i=Ys(r):(s&=a,s!==0?i=Ys(s):n||(n=a&~e,n!==0&&(i=Ys(n))))):(a=r&~o,a!==0?i=Ys(a):s!==0?i=Ys(s):n||(n=r&~e,n!==0&&(i=Ys(n)))),i===0?0:t!==0&&t!==i&&(t&o)===0&&(o=i&-i,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:i}function tf(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function d9(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function PA(){var e=rp;return rp<<=1,(rp&62914560)===0&&(rp=4194304),e}function gb(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function nf(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function p9(e,t,n,r,i,o){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var a=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=s&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var E9=/[\n"\\]/g;function Hr(e){return e.replace(E9,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ty(e,t,n,r,i,o,s,a){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Br(t)):e.value!==""+Br(t)&&(e.value=""+Br(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?ny(e,s,Br(t)):n!=null?ny(e,s,Br(n)):r!=null&&e.removeAttribute("value"),i==null&&o!=null&&(e.defaultChecked=!!o),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.name=""+Br(a):e.removeAttribute("name")}function KA(e,t,n,r,i,o,s,a){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){ey(e);return}n=n!=null?""+Br(n):"",t=t!=null?""+Br(t):n,a||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=a?e.checked:!!r,e.defaultChecked=!!r,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),ey(e)}function ny(e,t,n){t==="number"&&Bp(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Dl(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),iy=!1;if(no)try{ml={},Object.defineProperty(ml,"passive",{get:function(){iy=!0}}),window.addEventListener("test",ml,ml),window.removeEventListener("test",ml,ml)}catch{iy=!1}var ml,Yo=null,Wy=null,Tp=null;function XA(){if(Tp)return Tp;var e,t=Wy,n=t.length,r,i="value"in Yo?Yo.value:Yo.textContent,o=i.length;for(e=0;e=Ac),mC=" ",gC=!1;function ZA(e,t){switch(e){case"keyup":return $9.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function JA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vl=!1;function j9(e,t){switch(e){case"compositionend":return JA(t);case"keypress":return t.which!==32?null:(gC=!0,mC);case"textInput":return e=t.data,e===mC&&gC?null:e;default:return null}}function X9(e,t){if(vl)return e==="compositionend"||!Xy&&ZA(e,t)?(e=XA(),Tp=Wy=Yo=null,vl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=TC(n)}}function rN(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?rN(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function iN(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bp(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bp(e.document)}return t}function Qy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var iU=no&&"documentMode"in document&&11>=document.documentMode,Cl=null,oy=null,wc=null,sy=!1;function xC(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;sy||Cl==null||Cl!==Bp(r)||(r=Cl,"selectionStart"in r&&Qy(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),wc&&qc(wc,r)||(wc=r,r=th(oy,"onSelect"),0>=s,i-=s,di=1<<32-vr(t)+i|n<O?(B=R,R=null):B=R.sibling;var C=d(b,R,T[O],S);if(C===null){R===null&&(R=B);break}e&&R&&C.alternate===null&&t(b,R),E=o(C,E,O),x===null?v=C:x.sibling=C,x=C,R=B}if(O===T.length)return n(b,R),ze&&Wi(b,O),v;if(R===null){for(;OO?(B=R,R=null):B=R.sibling;var V=d(b,R,C.value,S);if(V===null){R===null&&(R=B);break}e&&R&&V.alternate===null&&t(b,R),E=o(V,E,O),x===null?v=V:x.sibling=V,x=V,R=B}if(C.done)return n(b,R),ze&&Wi(b,O),v;if(R===null){for(;!C.done;O++,C=T.next())C=f(b,C.value,S),C!==null&&(E=o(C,E,O),x===null?v=C:x.sibling=C,x=C);return ze&&Wi(b,O),v}for(R=r(R);!C.done;O++,C=T.next())C=p(R,b,O,C.value,S),C!==null&&(e&&C.alternate!==null&&R.delete(C.key===null?O:C.key),E=o(C,E,O),x===null?v=C:x.sibling=C,x=C);return e&&R.forEach(function(Y){return t(b,Y)}),ze&&Wi(b,O),v}function y(b,E,T,S){if(typeof T=="object"&&T!==null&&T.type===Tl&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case ep:e:{for(var v=T.key;E!==null;){if(E.key===v){if(v=T.type,v===Tl){if(E.tag===7){n(b,E.sibling),S=i(E,T.props.children),S.return=b,b=S;break e}}else if(E.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===Fo&&$s(v)===E.type){n(b,E.sibling),S=i(E,T.props),gc(S,T),S.return=b,b=S;break e}n(b,E);break}else t(b,E);E=E.sibling}T.type===Tl?(S=Xs(T.props.children,b.mode,S,T.key),S.return=b,b=S):(S=xp(T.type,T.key,T.props,null,b.mode,S),gc(S,T),S.return=b,b=S)}return s(b);case Sc:e:{for(v=T.key;E!==null;){if(E.key===v)if(E.tag===4&&E.stateNode.containerInfo===T.containerInfo&&E.stateNode.implementation===T.implementation){n(b,E.sibling),S=i(E,T.children||[]),S.return=b,b=S;break e}else{n(b,E);break}else t(b,E);E=E.sibling}S=vb(T,b.mode,S),S.return=b,b=S}return s(b);case Fo:return T=$s(T),y(b,E,T,S)}if(xc(T))return h(b,E,T,S);if(hc(T)){if(v=hc(T),typeof v!="function")throw Error(W(150));return T=v.call(T),g(b,E,T,S)}if(typeof T.then=="function")return y(b,E,up(T),S);if(T.$$typeof===Xi)return y(b,E,lp(b,T),S);cp(b,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,E!==null&&E.tag===6?(n(b,E.sibling),S=i(E,T),S.return=b,b=S):(n(b,E),S=_b(T,b.mode,S),S.return=b,b=S),s(b)):n(b,E)}return function(b,E,T,S){try{Kc=0;var v=y(b,E,T,S);return Pl=null,v}catch(R){if(R===Jl||R===hh)throw R;var x=Tr(29,R,null,b.mode);return x.lanes=S,x.return=b,x}finally{}}}var na=EN(!0),TN=EN(!1),Ho=!1;function sE(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function py(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Zo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Jo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(We&2)!==0){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Fp(e),fN(e,null,n),t}return ph(e,r,t,n),Fp(e)}function kc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,UA(e,n)}}function Ab(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var hy=!1;function Mc(){if(hy){var e=Ll;if(e!==null)throw e}}function Oc(e,t,n,r){hy=!1;var i=e.updateQueue;Ho=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,c=u=l=null,a=o;do{var d=a.lane&-536870913,p=d!==a.lane;if(p?(Fe&d)===d:(r&d)===d){d!==0&&d===ql&&(hy=!0),c!==null&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var h=e,g=a;d=t;var y=n;switch(g.tag){case 1:if(h=g.payload,typeof h=="function"){f=h.call(y,f,d);break e}f=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,d=typeof h=="function"?h.call(y,f,d):h,d==null)break e;f=yt({},f,d);break e;case 2:Ho=!0}}d=a.callback,d!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[d]:p.push(d))}else p={lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=p,l=f):c=c.next=p,s|=d;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,o===null&&(i.shared.lanes=0),us|=s,e.lanes=s,e.memoizedState=f}}function SN(e,t){if(typeof e!="function")throw Error(W(191,e));e.call(t)}function xN(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;eo?o:8;var s=_e.T,a={};_e.T=a,EE(e,!1,t,n);try{var l=i(),u=_e.S;if(u!==null&&u(a,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=pU(l,r);Dc(e,t,c,Cr(e))}else Dc(e,t,r,Cr(e))}catch(f){Dc(e,t,{then:function(){},status:"rejected",reason:f},Cr())}finally{je.p=o,s!==null&&a.types!==null&&(s.types=a.types),_e.T=s}}function EU(){}function Ey(e,t,n,r){if(e.tag!==5)throw Error(W(476));var i=$N(e).queue;YN(e,i,t,js,n===null?EU:function(){return WN(e),n(r)})}function $N(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:js,baseState:js,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:io,lastRenderedState:js},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function WN(e){var t=$N(e);t.next===null&&(t=e.alternate.memoizedState),Dc(e,t.next.queue,{},Cr())}function yE(){return hn(Xc)}function jN(){return It().memoizedState}function XN(){return It().memoizedState}function TU(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cr();e=Zo(n);var r=Jo(t,e,n);r!==null&&(tr(r,t,n),kc(r,t,n)),t={cache:rE()},e.payload=t;return}t=t.return}}function SU(e,t,n){var r=Cr();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},yh(e)?ZN(t,n):(n=Jy(e,t,n,r),n!==null&&(tr(n,e,r),JN(n,t,r)))}function QN(e,t,n){var r=Cr();Dc(e,t,n,r)}function Dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(yh(e))ZN(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Ar(a,s))return ph(e,t,i,0),at===null&&dh(),!1}catch{}finally{}if(n=Jy(e,t,i,r),n!==null)return tr(n,e,r),JN(n,t,r),!0}return!1}function EE(e,t,n,r){if(r={lane:2,revertLane:wE(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},yh(e)){if(t)throw Error(W(479))}else t=Jy(e,n,r,2),t!==null&&tr(t,e,2)}function yh(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function ZN(e,t){Bl=Kp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function JN(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,UA(e,n)}}var $c={readContext:hn,use:gh,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};$c.useEffectEvent=Rt;var ew={readContext:hn,use:gh,useCallback:function(e,t){return Un().memoizedState=[e,t===void 0?null:t],e},useContext:hn,useEffect:BC,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Cp(4194308,4,zN.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Cp(4194308,4,e,t)},useInsertionEffect:function(e,t){Cp(4,2,e,t)},useMemo:function(e,t){var n=Un();t=t===void 0?null:t;var r=e();if(ra){Ko(!0);try{e()}finally{Ko(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Un();if(n!==void 0){var i=n(t);if(ra){Ko(!0);try{n(t)}finally{Ko(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=SU.bind(null,Me,e),[r.memoizedState,e]},useRef:function(e){var t=Un();return e={current:e},t.memoizedState=e},useState:function(e){e=by(e);var t=e.queue,n=QN.bind(null,Me,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:gE,useDeferredValue:function(e,t){var n=Un();return bE(n,e,t)},useTransition:function(){var e=by(!1);return e=YN.bind(null,Me,e.queue,!0,!1),Un().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Me,i=Un();if(ze){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),at===null)throw Error(W(349));(Fe&127)!==0||NN(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,BC(RN.bind(null,r,o,e),[e]),r.flags|=2048,Gl(9,{destroy:void 0},wN.bind(null,r,o,n,t),null),n},useId:function(){var e=Un(),t=at.identifierPrefix;if(ze){var n=pi,r=di;n=(r&~(1<<32-vr(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Yp++,0<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof r.is=="string"?s.createElement("select",{is:r.is}):s.createElement("select"),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is=="string"?s.createElement(i,{is:r.is}):s.createElement(i)}}o[dn]=t,o[nr]=r;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;e:switch(mn(o,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Gi(t)}}return gt(t),Ib(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Gi(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(W(166));if(e=Xo.current,gl(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=pn,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[dn]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Qw(e.nodeValue,n)),e||as(t,!0)}else e=nh(e).createTextNode(r),e[dn]=t,t.stateNode=e}return gt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=gl(t),n!==null){if(e===null){if(!r)throw Error(W(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(557));e[dn]=t}else ea(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),e=!1}else n=Cb(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Er(t),t):(Er(t),null);if((t.flags&128)!==0)throw Error(W(558))}return gt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=gl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(W(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(W(317));i[dn]=t}else ea(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),i=!1}else i=Cb(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Er(t),t):(Er(t),null)}return Er(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fp(t,t.updateQueue),gt(t),null);case 4:return Fl(),e===null&&RE(t.stateNode.containerInfo),gt(t),null;case 10:return eo(t.type),gt(t),null;case 19:if(en(Dt),r=t.memoizedState,r===null)return gt(t),null;if(i=(t.flags&128)!==0,o=r.rendering,o===null)if(i)bc(r,!1);else{if(kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Gp(e),o!==null){for(t.flags|=128,bc(r,!1),e=o.updateQueue,t.updateQueue=e,fp(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)dN(n,e),n=n.sibling;return ft(Dt,Dt.current&1|2),ze&&Wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&xr()>Xp&&(t.flags|=128,i=!0,bc(r,!1),t.lanes=4194304)}else{if(!i)if(e=Gp(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,fp(t,e),bc(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!ze)return gt(t),null}else 2*xr()-r.renderingStartTime>Xp&&n!==536870912&&(t.flags|=128,i=!0,bc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e!==null?e.sibling=o:t.child=o,r.last=o)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=xr(),e.sibling=null,n=Dt.current,ft(Dt,i?n&1|2:n&1),ze&&Wi(t,r.treeForkCount),e):(gt(t),null);case 22:case 23:return Er(t),aE(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),n=t.updateQueue,n!==null&&fp(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&en(Qs),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),eo(Vt),gt(t),null;case 25:return null;case 30:return null}throw Error(W(156,t.tag))}function AU(e,t){switch(nE(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return eo(Vt),Fl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Lp(t),null;case 31:if(t.memoizedState!==null){if(Er(t),t.alternate===null)throw Error(W(340));ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Er(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return en(Dt),null;case 4:return Fl(),null;case 10:return eo(t.type),null;case 22:case 23:return Er(t),aE(),e!==null&&en(Qs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return eo(Vt),null;case 25:return null;default:return null}}function dw(e,t){switch(nE(t),t.tag){case 3:eo(Vt),Fl();break;case 26:case 27:case 5:Lp(t);break;case 4:Fl();break;case 31:t.memoizedState!==null&&Er(t);break;case 13:Er(t);break;case 19:en(Dt);break;case 10:eo(t.type);break;case 22:case 23:Er(t),aE(),e!==null&&en(Qs);break;case 24:eo(Vt)}}function lf(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var o=n.create,s=n.inst;r=o(),s.destroy=r}n=n.next}while(n!==i)}}catch(a){Je(t,t.return,a)}}function ls(e,t,n){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var o=i.next;r=o;do{if((r.tag&e)===e){var s=r.inst,a=s.destroy;if(a!==void 0){s.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(c){Je(i,l,c)}}}r=r.next}while(r!==o)}}catch(c){Je(t,t.return,c)}}function pw(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xN(t,n)}catch(r){Je(e,e.return,r)}}}function hw(e,t,n){n.props=ia(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Je(e,t,r)}}function Ic(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(i){Je(e,t,i)}}function hi(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(i){Je(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Je(e,t,i)}else n.current=null}function mw(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){Je(e,e.return,i)}}function Lb(e,t,n){try{var r=e.stateNode;YU(r,e.type,n,t),r[nr]=t}catch(i){Je(e,e.return,i)}}function gw(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&fs(e.type)||e.tag===4}function Pb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&fs(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function vy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qi));else if(r!==4&&(r===27&&fs(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(vy(e,t,n),e=e.sibling;e!==null;)vy(e,t,n),e=e.sibling}function jp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&fs(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(jp(e,t,n),e=e.sibling;e!==null;)jp(e,t,n),e=e.sibling}function bw(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);mn(t,r,n),t[dn]=e,t[nr]=n}catch(o){Je(e,e.return,o)}}var ji=!1,qt=!1,Bb=!1,XC=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function NU(e,t){if(e=e.containerInfo,My=sh,e=iN(e),Qy(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===e)break t;if(d===n&&++u===i&&(a=s),d===o&&++c===r&&(l=s),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Oy={focusedElem:e,selectionRange:n},sh=!1,Zt=t;Zt!==null;)if(t=Zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Zt=e;else for(;Zt!==null;){switch(t=Zt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),mn(o,r,n),o[dn]=e,Jt(o),r=o;break e;case"link":var s=yA("link","href",i).get(r+(n.href||""));if(s){for(var a=0;ay&&(s=y,y=g,g=s);var b=SC(a,g),E=SC(a,y);if(b&&E&&(p.rangeCount!==1||p.anchorNode!==b.node||p.anchorOffset!==b.offset||p.focusNode!==E.node||p.focusOffset!==E.offset)){var T=f.createRange();T.setStart(b.node,b.offset),p.removeAllRanges(),g>y?(p.addRange(T),p.extend(E.node,E.offset)):(T.setEnd(E.node,E.offset),p.addRange(T))}}}}for(f=[],p=a;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;an?32:n,_e.T=null,n=Ny,Ny=null;var o=ts,s=to;if(jt=0,Yl=ts=null,to=0,(We&6)!==0)throw Error(W(331));var a=We;if(We|=4,ww(o.current),Cw(o,o.current,s,n),We=a,uf(0,!1),_r&&typeof _r.onPostCommitFiberRoot=="function")try{_r.onPostCommitFiberRoot(ef,o)}catch{}return!0}finally{je.p=i,_e.T=r,Vw(e,t)}}function eA(e,t,n){t=zr(n,t),t=Sy(e.stateNode,t,2),e=Jo(e,t,2),e!==null&&(nf(e,2),bi(e))}function Je(e,t,n){if(e.tag===3)eA(e,e,n);else for(;t!==null;){if(t.tag===3){eA(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(es===null||!es.has(r))){e=zr(n,e),n=ow(2),r=Jo(t,n,2),r!==null&&(sw(n,r,t,e),nf(r,2),bi(r));break}}t=t.return}}function Fb(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new kU;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(CE=!0,i.add(n),e=LU.bind(null,e,t,n),t.then(e,e))}function LU(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,at===e&&(Fe&n)===n&&(kt===4||kt===3&&(Fe&62914560)===Fe&&300>xr()-Eh?(We&2)===0&&$l(e,0):AE|=n,Kl===Fe&&(Kl=0)),bi(e)}function Kw(e,t){t===0&&(t=PA()),e=la(e,t),e!==null&&(nf(e,t),bi(e))}function PU(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Kw(e,n)}function BU(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(W(314))}r!==null&&r.delete(t),Kw(e,n)}function UU(e,t){return qy(e,t)}var Jp=null,El=null,Ry=!1,eh=!1,Hb=!1,jo=0;function bi(e){e!==El&&e.next===null&&(El===null?Jp=El=e:El=El.next=e),eh=!0,Ry||(Ry=!0,HU())}function uf(e,t){if(!Hb&&eh){Hb=!0;do for(var n=!1,r=Jp;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var o=0;else{var s=r.suspendedLanes,a=r.pingedLanes;o=(1<<31-vr(42|e)+1)-1,o&=i&~(s&~a),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,tA(r,o))}else o=Fe,o=lh(r,r===at?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(o&3)===0||tf(r,o)||(n=!0,tA(r,o));r=r.next}while(n);Hb=!1}}function FU(){Yw()}function Yw(){eh=Ry=!1;var e=0;jo!==0&&WU()&&(e=jo);for(var t=xr(),n=null,r=Jp;r!==null;){var i=r.next,o=$w(r,t);o===0?(r.next=null,n===null?Jp=i:n.next=i,i===null&&(El=n)):(n=r,(e!==0||(o&3)!==0)&&(eh=!0)),r=i}jt!==0&&jt!==5||uf(e,!1),jo!==0&&(jo=0)}function $w(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes&-62914561;0a)break;var c=l.transferSize,f=l.initiatorType;c&&lA(f)&&(l=l.responseEnd,s+=c*(l"u"?null:document;function nR(e,t,n){var r=tu;if(r&&typeof t=="string"&&t){var i=Hr(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),mA.has(i)||(mA.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),mn(t,"link",e),Jt(t),r.head.appendChild(t)))}}function rF(e){ao.D(e),nR("dns-prefetch",e,null)}function iF(e,t){ao.C(e,t),nR("preconnect",e,t)}function oF(e,t,n){ao.L(e,t,n);var r=tu;if(r&&e&&t){var i='link[rel="preload"][as="'+Hr(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Hr(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Hr(n.imageSizes)+'"]')):i+='[href="'+Hr(e)+'"]';var o=i;switch(t){case"style":o=Wl(e);break;case"script":o=nu(e)}Kr.has(o)||(e=yt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Kr.set(o,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(cf(o))||t==="script"&&r.querySelector(ff(o))||(t=r.createElement("link"),mn(t,"link",e),Jt(t),r.head.appendChild(t)))}}function sF(e,t){ao.m(e,t);var n=tu;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Hr(r)+'"][href="'+Hr(e)+'"]',o=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=nu(e)}if(!Kr.has(o)&&(e=yt({rel:"modulepreload",href:e},t),Kr.set(o,e),n.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ff(o)))return}r=n.createElement("link"),mn(r,"link",e),Jt(r),n.head.appendChild(r)}}}function aF(e,t,n){ao.S(e,t,n);var r=tu;if(r&&e){var i=Ol(r).hoistableStyles,o=Wl(e);t=t||"default";var s=i.get(o);if(!s){var a={loading:0,preload:null};if(s=r.querySelector(cf(o)))a.loading=5;else{e=yt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Kr.get(o))&&kE(e,n);var l=s=r.createElement("link");Jt(l),mn(l,"link",e),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){a.loading|=1}),l.addEventListener("error",function(){a.loading|=2}),a.loading|=4,Rp(s,t,r)}s={type:"stylesheet",instance:s,count:1,state:a},i.set(o,s)}}}function lF(e,t){ao.X(e,t);var n=tu;if(n&&e){var r=Ol(n).hoistableScripts,i=nu(e),o=r.get(i);o||(o=n.querySelector(ff(i)),o||(e=yt({src:e,async:!0},t),(t=Kr.get(i))&&ME(e,t),o=n.createElement("script"),Jt(o),mn(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(i,o))}}function uF(e,t){ao.M(e,t);var n=tu;if(n&&e){var r=Ol(n).hoistableScripts,i=nu(e),o=r.get(i);o||(o=n.querySelector(ff(i)),o||(e=yt({src:e,async:!0,type:"module"},t),(t=Kr.get(i))&&ME(e,t),o=n.createElement("script"),Jt(o),mn(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(i,o))}}function gA(e,t,n,r){var i=(i=Xo.current)?rh(i):null;if(!i)throw Error(W(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Wl(n.href),n=Ol(i).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Wl(n.href);var o=Ol(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(cf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Kr.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Kr.set(e,n),o||cF(i,e,n,s.state))),t&&r===null)throw Error(W(528,""));return s}if(t&&r!==null)throw Error(W(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=nu(n),n=Ol(i).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(W(444,e))}}function Wl(e){return'href="'+Hr(e)+'"'}function cf(e){return'link[rel="stylesheet"]['+e+"]"}function rR(e){return yt({},e,{"data-precedence":e.precedence,precedence:null})}function cF(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),mn(t,"link",n),Jt(t),e.head.appendChild(t))}function nu(e){return'[src="'+Hr(e)+'"]'}function ff(e){return"script[async]"+e}function bA(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Hr(n.href)+'"]');if(r)return t.instance=r,Jt(r),r;var i=yt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Jt(r),mn(r,"style",i),Rp(r,n.precedence,e),t.instance=r;case"stylesheet":i=Wl(n.href);var o=e.querySelector(cf(i));if(o)return t.state.loading|=4,t.instance=o,Jt(o),o;r=rR(n),(i=Kr.get(i))&&kE(r,i),o=(e.ownerDocument||e).createElement("link"),Jt(o);var s=o;return s._p=new Promise(function(a,l){s.onload=a,s.onerror=l}),mn(o,"link",r),t.state.loading|=4,Rp(o,n.precedence,e),t.instance=o;case"script":return o=nu(n.src),(i=e.querySelector(ff(o)))?(t.instance=i,Jt(i),i):(r=n,(i=Kr.get(o))&&(r=yt({},n),ME(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),Jt(i),mn(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(W(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Rp(r,n.precedence,e));return t.instance}function Rp(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,o=i,s=0;s title"):null)}function fF(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function iR(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function dF(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Wl(r.href),o=t.querySelector(cf(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ih.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,Jt(o);return}o=t.ownerDocument||t,r=rR(r),(i=Kr.get(i))&&kE(r,i),o=o.createElement("link"),Jt(o);var s=o;s._p=new Promise(function(a,l){s.onload=a,s.onerror=l}),mn(o,"link",r),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ih.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Gb=0;function pF(e,t){return e.stylesheets&&e.count===0&&Mp(e,e.stylesheets),0Gb?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ih(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var oh=null;function Mp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oh=new Map,t.forEach(hF,e),oh=null,ih.call(e))}function hF(e,t){if(!(t.state.loading&4)){var n=oh.get(e);if(n)var r=n.get(null);else{n=new Map,oh.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o{"use strict";function pR(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(pR)}catch(e){console.error(e)}}pR(),hR.exports=dR()});var pk=Ht((Gae,dk)=>{"use strict";var lk=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,jH=/\n/g,XH=/^\s*/,QH=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ZH=/^:\s*/,JH=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ez=/^[;\s]*/,tz=/^\s+|\s+$/g,nz=` -`,uk="/",ck="*",da="",rz="comment",iz="declaration";function oz(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(h){var g=h.match(jH);g&&(n+=g.length);var y=h.lastIndexOf(nz);r=~y?h.length-y:r+h.length}function o(){var h={line:n,column:r};return function(g){return g.position=new s(h),u(),g}}function s(h){this.start=h,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(h){var g=new Error(t.source+":"+n+":"+r+": "+h);if(g.reason=h,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(h){var g=h.exec(e);if(g){var y=g[0];return i(y),e=e.slice(y.length),g}}function u(){l(XH)}function c(h){var g;for(h=h||[];g=f();)g!==!1&&h.push(g);return h}function f(){var h=o();if(!(uk!=e.charAt(0)||ck!=e.charAt(1))){for(var g=2;da!=e.charAt(g)&&(ck!=e.charAt(g)||uk!=e.charAt(g+1));)++g;if(g+=2,da===e.charAt(g-1))return a("End of comment missing");var y=e.slice(2,g-2);return r+=2,i(y),e=e.slice(g),r+=2,h({type:rz,comment:y})}}function d(){var h=o(),g=l(QH);if(g){if(f(),!l(ZH))return a("property missing ':'");var y=l(JH),b=h({type:iz,property:fk(g[0].replace(lk,da)),value:y?fk(y[0].replace(lk,da)):da});return l(ez),b}}function p(){var h=[];c(h);for(var g;g=d();)g!==!1&&(h.push(g),c(h));return h}return u(),p()}function fk(e){return e?e.replace(tz,da):da}dk.exports=oz});var hk=Ht(yf=>{"use strict";var sz=yf&&yf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yf,"__esModule",{value:!0});yf.default=lz;var az=sz(pk());function lz(e,t){let n=null;if(!e||typeof e!="string")return n;let r=(0,az.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;let{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}});var gk=Ht($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.camelCase=void 0;var uz=/^--[a-zA-Z0-9_-]+$/,cz=/-([a-z])/g,fz=/^[^-]+$/,dz=/^-(webkit|moz|ms|o|khtml)-/,pz=/^-(ms)-/,hz=function(e){return!e||fz.test(e)||uz.test(e)},mz=function(e,t){return t.toUpperCase()},mk=function(e,t){return"".concat(t,"-")},gz=function(e,t){return t===void 0&&(t={}),hz(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(pz,mk):e=e.replace(dz,mk),e.replace(cz,mz))};$h.camelCase=gz});var yk=Ht((m1,bk)=>{"use strict";var bz=m1&&m1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},yz=bz(hk()),Ez=gk();function h1(e,t){var n={};return!e||typeof e!="string"||(0,yz.default)(e,function(r,i){r&&i&&(n[(0,Ez.camelCase)(r,t)]=i)}),n}h1.default=h1;bk.exports=h1});var Lk=Ht(jh=>{"use strict";var Yz=Symbol.for("react.transitional.element"),$z=Symbol.for("react.fragment");function Ik(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:Yz,type:e,key:r,ref:t!==void 0?t:null,props:n}}jh.Fragment=$z;jh.jsx=Ik;jh.jsxs=Ik});var ie=Ht((Hle,Pk)=>{"use strict";Pk.exports=Lk()});var JM=Ht((Pce,ZM)=>{"use strict";var Em=Object.prototype.hasOwnProperty,QM=Object.prototype.toString,KM=Object.defineProperty,YM=Object.getOwnPropertyDescriptor,$M=function(t){return typeof Array.isArray=="function"?Array.isArray(t):QM.call(t)==="[object Array]"},WM=function(t){if(!t||QM.call(t)!=="[object Object]")return!1;var n=Em.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Em.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Em.call(t,i)},jM=function(t,n){KM&&n.name==="__proto__"?KM(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},XM=function(t,n){if(n==="__proto__")if(Em.call(t,n)){if(YM)return YM(t,n).value}else return;return t[n]};ZM.exports=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l{function AI(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&AI(n)}),e}var Jm=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function NI(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Cs(e,...t){let n=Object.create(null);for(let r in e)n[r]=e[r];return t.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var OW="",TI=e=>!!e.scope,DW=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`},bS=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=NI(t)}openNode(t){if(!TI(t))return;let n=DW(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){TI(t)&&(this.buffer+=OW)}value(){return this.buffer}span(t){this.buffer+=``}},SI=(e={})=>{let t={children:[]};return Object.assign(t,e),t},yS=class e{constructor(){this.rootNode=SI(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let n=SI({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{e._collapse(n)}))}},ES=class extends yS{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){let r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new bS(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Qf(e){return e?typeof e=="string"?e:e.source:null}function wI(e){return ka("(?=",e,")")}function IW(e){return ka("(?:",e,")*")}function LW(e){return ka("(?:",e,")?")}function ka(...e){return e.map(n=>Qf(n)).join("")}function PW(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function SS(...e){return"("+(PW(e).capture?"":"?:")+e.map(r=>Qf(r)).join("|")+")"}function RI(e){return new RegExp(e.toString()+"|").exec("").length-1}function BW(e,t){let n=e&&e.exec(t);return n&&n.index===0}var UW=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function xS(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;let i=n,o=Qf(r),s="";for(;o.length>0;){let a=UW.exec(o);if(!a){s+=o;break}s+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+i):(s+=a[0],a[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(t)}var FW=/\b\B/,kI="[a-zA-Z]\\w*",_S="[a-zA-Z_]\\w*",MI="\\b\\d+(\\.\\d+)?",OI="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",DI="\\b(0b[01]+)",HW="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",zW=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=ka(t,/.*\b/,e.binary,/\b.*/)),Cs({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Zf={begin:"\\\\[\\s\\S]",relevance:0},qW={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Zf]},VW={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Zf]},GW={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},tg=function(e,t,n={}){let r=Cs({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=SS("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ka(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},KW=tg("//","$"),YW=tg("/\\*","\\*/"),$W=tg("#","$"),WW={scope:"number",begin:MI,relevance:0},jW={scope:"number",begin:OI,relevance:0},XW={scope:"number",begin:DI,relevance:0},QW={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Zf,{begin:/\[/,end:/\]/,relevance:0,contains:[Zf]}]},ZW={scope:"title",begin:kI,relevance:0},JW={scope:"title",begin:_S,relevance:0},ej={begin:"\\.\\s*"+_S,relevance:0},tj=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})},Zm=Object.freeze({__proto__:null,APOS_STRING_MODE:qW,BACKSLASH_ESCAPE:Zf,BINARY_NUMBER_MODE:XW,BINARY_NUMBER_RE:DI,COMMENT:tg,C_BLOCK_COMMENT_MODE:YW,C_LINE_COMMENT_MODE:KW,C_NUMBER_MODE:jW,C_NUMBER_RE:OI,END_SAME_AS_BEGIN:tj,HASH_COMMENT_MODE:$W,IDENT_RE:kI,MATCH_NOTHING_RE:FW,METHOD_GUARD:ej,NUMBER_MODE:WW,NUMBER_RE:MI,PHRASAL_WORDS_MODE:GW,QUOTE_STRING_MODE:VW,REGEXP_MODE:QW,RE_STARTERS_RE:HW,SHEBANG:zW,TITLE_MODE:ZW,UNDERSCORE_IDENT_RE:_S,UNDERSCORE_TITLE_MODE:JW});function nj(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function rj(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ij(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=nj,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function oj(e,t){Array.isArray(e.illegal)&&(e.illegal=SS(...e.illegal))}function sj(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function aj(e,t){e.relevance===void 0&&(e.relevance=1)}var lj=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=ka(n.beforeMatch,wI(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},uj=["of","and","for","in","not","or","if","then","parent","list","value"],cj="keyword";function II(e,t,n=cj){let r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(o){Object.assign(r,II(e[o],t,o))}),r;function i(o,s){t&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let l=a.split("|");r[l[0]]=[o,fj(l[0],l[1])]})}}function fj(e,t){return t?Number(t):dj(e)?0:1}function dj(e){return uj.includes(e.toLowerCase())}var xI={},Ra=e=>{console.error(e)},_I=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Nu=(e,t)=>{xI[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),xI[`${e}/${t}`]=!0)},eg=new Error;function LI(e,t,{key:n}){let r=0,i=e[n],o={},s={};for(let a=1;a<=t.length;a++)s[a+r]=i[a],o[a+r]=!0,r+=RI(t[a-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function pj(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ra("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),eg;if(typeof e.beginScope!="object"||e.beginScope===null)throw Ra("beginScope must be object"),eg;LI(e,e.begin,{key:"beginScope"}),e.begin=xS(e.begin,{joinWith:""})}}function hj(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ra("skip, excludeEnd, returnEnd not compatible with endScope: {}"),eg;if(typeof e.endScope!="object"||e.endScope===null)throw Ra("endScope must be object"),eg;LI(e,e.end,{key:"endScope"}),e.end=xS(e.end,{joinWith:""})}}function mj(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function gj(e){mj(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),pj(e),hj(e)}function bj(e){function t(s,a){return new RegExp(Qf(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=RI(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=t(xS(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let u=l.findIndex((f,d)=>d>0&&f!==void 0),c=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,c)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new n;return this.rules.slice(a).forEach(([u,c])=>l.addRule(u,c)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(a);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){let c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,u=c.exec(a)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(s){let a=new r;return s.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function o(s,a){let l=s;if(s.isCompiled)return l;[rj,sj,gj,lj].forEach(c=>c(s,a)),e.compilerExtensions.forEach(c=>c(s,a)),s.__beforeBegin=null,[ij,oj,aj].forEach(c=>c(s,a)),s.isCompiled=!0;let u=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),u=s.keywords.$pattern,delete s.keywords.$pattern),u=u||/\w+/,s.keywords&&(s.keywords=II(s.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),a&&(s.begin||(s.begin=/\B|\b/),l.beginRe=t(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=t(l.end)),l.terminatorEnd=Qf(l.end)||"",s.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(l.illegalRe=t(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(c){return yj(c==="self"?s:c)})),s.contains.forEach(function(c){o(c,l)}),s.starts&&o(s.starts,a),l.matcher=i(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Cs(e.classNameAliases||{}),o(e)}function PI(e){return e?e.endsWithParent||PI(e.starts):!1}function yj(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Cs(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:PI(e)?Cs(e,{starts:e.starts?Cs(e.starts):null}):Object.isFrozen(e)?Cs(e):e}var Ej="11.11.1",TS=class extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}},gS=NI,vI=Cs,CI=Symbol("nomatch"),Tj=7,BI=function(e){let t=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ES};function l(I){return a.noHighlightRe.test(I)}function u(I){let P=I.className+" ";P+=I.parentNode?I.parentNode.className:"";let D=a.languageDetectRe.exec(P);if(D){let U=O(D[1]);return U||(_I(o.replace("{}",D[1])),_I("Falling back to no-highlight mode for this block.",I)),U?D[1]:"no-highlight"}return P.split(/\s+/).find(U=>l(U)||O(U))}function c(I,P,D){let U="",_="";typeof P=="object"?(U=I,D=P.ignoreIllegals,_=P.language):(Nu("10.7.0","highlight(lang, code, ...args) has been deprecated."),Nu("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),_=I,U=P),D===void 0&&(D=!0);let te={code:U,language:_};L("before:highlight",te);let ne=te.result?te.result:f(te.language,te.code,D);return ne.code=te.code,L("after:highlight",ne),ne}function f(I,P,D,U){let _=Object.create(null);function te(w,F){return w.keywords[F]}function ne(){if(!ue.keywords){Ie.addText(j);return}let w=0;ue.keywordPatternRe.lastIndex=0;let F=ue.keywordPatternRe.exec(j),$="";for(;F;){$+=j.substring(w,F.index);let oe=Ne.case_insensitive?F[0].toLowerCase():F[0],be=te(ue,oe);if(be){let[Ke,jn]=be;if(Ie.addText($),$="",_[oe]=(_[oe]||0)+1,_[oe]<=Tj&&(Se+=jn),Ke.startsWith("_"))$+=F[0];else{let Xn=Ne.classNameAliases[Ke]||Ke;se(F[0],Xn)}}else $+=F[0];w=ue.keywordPatternRe.lastIndex,F=ue.keywordPatternRe.exec(j)}$+=j.substring(w),Ie.addText($)}function A(){if(j==="")return;let w=null;if(typeof ue.subLanguage=="string"){if(!t[ue.subLanguage]){Ie.addText(j);return}w=f(ue.subLanguage,j,!0,St[ue.subLanguage]),St[ue.subLanguage]=w._top}else w=p(j,ue.subLanguage.length?ue.subLanguage:null);ue.relevance>0&&(Se+=w.relevance),Ie.__addSublanguage(w._emitter,w.language)}function re(){ue.subLanguage!=null?A():ne(),j=""}function se(w,F){w!==""&&(Ie.startScope(F),Ie.addText(w),Ie.endScope())}function xe(w,F){let $=1,oe=F.length-1;for(;$<=oe;){if(!w._emit[$]){$++;continue}let be=Ne.classNameAliases[w[$]]||w[$],Ke=F[$];be?se(Ke,be):(j=Ke,ne(),j=""),$++}}function Ve(w,F){return w.scope&&typeof w.scope=="string"&&Ie.openNode(Ne.classNameAliases[w.scope]||w.scope),w.beginScope&&(w.beginScope._wrap?(se(j,Ne.classNameAliases[w.beginScope._wrap]||w.beginScope._wrap),j=""):w.beginScope._multi&&(xe(w.beginScope,F),j="")),ue=Object.create(w,{parent:{value:ue}}),ue}function de(w,F,$){let oe=BW(w.endRe,$);if(oe){if(w["on:end"]){let be=new Jm(w);w["on:end"](F,be),be.isMatchIgnored&&(oe=!1)}if(oe){for(;w.endsParent&&w.parent;)w=w.parent;return w}}if(w.endsWithParent)return de(w.parent,F,$)}function ct(w){return ue.matcher.regexIndex===0?(j+=w[0],1):(xt=!0,0)}function Ge(w){let F=w[0],$=w.rule,oe=new Jm($),be=[$.__beforeBegin,$["on:begin"]];for(let Ke of be)if(Ke&&(Ke(w,oe),oe.isMatchIgnored))return ct(F);return $.skip?j+=F:($.excludeBegin&&(j+=F),re(),!$.returnBegin&&!$.excludeBegin&&(j=F)),Ve($,w),$.returnBegin?0:F.length}function rt(w){let F=w[0],$=P.substring(w.index),oe=de(ue,w,$);if(!oe)return CI;let be=ue;ue.endScope&&ue.endScope._wrap?(re(),se(F,ue.endScope._wrap)):ue.endScope&&ue.endScope._multi?(re(),xe(ue.endScope,w)):be.skip?j+=F:(be.returnEnd||be.excludeEnd||(j+=F),re(),be.excludeEnd&&(j=F));do ue.scope&&Ie.closeNode(),!ue.skip&&!ue.subLanguage&&(Se+=ue.relevance),ue=ue.parent;while(ue!==oe.parent);return oe.starts&&Ve(oe.starts,w),be.returnEnd?0:F.length}function he(){let w=[];for(let F=ue;F!==Ne;F=F.parent)F.scope&&w.unshift(F.scope);w.forEach(F=>Ie.openNode(F))}let Ce={};function Ae(w,F){let $=F&&F[0];if(j+=w,$==null)return re(),0;if(Ce.type==="begin"&&F.type==="end"&&Ce.index===F.index&&$===""){if(j+=P.slice(F.index,F.index+1),!i){let oe=new Error(`0 width match regex (${I})`);throw oe.languageName=I,oe.badRule=Ce.rule,oe}return 1}if(Ce=F,F.type==="begin")return Ge(F);if(F.type==="illegal"&&!D){let oe=new Error('Illegal lexeme "'+$+'" for mode "'+(ue.scope||"")+'"');throw oe.mode=ue,oe}else if(F.type==="end"){let oe=rt(F);if(oe!==CI)return oe}if(F.type==="illegal"&&$==="")return j+=` -`,1;if(wt>1e5&&wt>F.index*3)throw new Error("potential infinite loop, way more iterations than matches");return j+=$,$.length}let Ne=O(I);if(!Ne)throw Ra(o.replace("{}",I)),new Error('Unknown language: "'+I+'"');let me=bj(Ne),we="",ue=U||me,St={},Ie=new a.__emitter(a);he();let j="",Se=0,Xe=0,wt=0,xt=!1;try{if(Ne.__emitTokens)Ne.__emitTokens(P,Ie);else{for(ue.matcher.considerAll();;){wt++,xt?xt=!1:ue.matcher.considerAll(),ue.matcher.lastIndex=Xe;let w=ue.matcher.exec(P);if(!w)break;let F=P.substring(Xe,w.index),$=Ae(F,w);Xe=w.index+$}Ae(P.substring(Xe))}return Ie.finalize(),we=Ie.toHTML(),{language:I,value:we,relevance:Se,illegal:!1,_emitter:Ie,_top:ue}}catch(w){if(w.message&&w.message.includes("Illegal"))return{language:I,value:gS(P),illegal:!0,relevance:0,_illegalBy:{message:w.message,index:Xe,context:P.slice(Xe-100,Xe+100),mode:w.mode,resultSoFar:we},_emitter:Ie};if(i)return{language:I,value:gS(P),illegal:!1,relevance:0,errorRaised:w,_emitter:Ie,_top:ue};throw w}}function d(I){let P={value:gS(I),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return P._emitter.addText(I),P}function p(I,P){P=P||a.languages||Object.keys(t);let D=d(I),U=P.filter(O).filter(C).map(re=>f(re,I,!1));U.unshift(D);let _=U.sort((re,se)=>{if(re.relevance!==se.relevance)return se.relevance-re.relevance;if(re.language&&se.language){if(O(re.language).supersetOf===se.language)return 1;if(O(se.language).supersetOf===re.language)return-1}return 0}),[te,ne]=_,A=te;return A.secondBest=ne,A}function h(I,P,D){let U=P&&n[P]||D;I.classList.add("hljs"),I.classList.add(`language-${U}`)}function g(I){let P=null,D=u(I);if(l(D))return;if(L("before:highlightElement",{el:I,language:D}),I.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",I);return}if(I.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(I)),a.throwUnescapedHTML))throw new TS("One of your code blocks includes unescaped HTML.",I.innerHTML);P=I;let U=P.textContent,_=D?c(U,{language:D,ignoreIllegals:!0}):p(U);I.innerHTML=_.value,I.dataset.highlighted="yes",h(I,D,_.language),I.result={language:_.language,re:_.relevance,relevance:_.relevance},_.secondBest&&(I.secondBest={language:_.secondBest.language,relevance:_.secondBest.relevance}),L("after:highlightElement",{el:I,result:_,text:U})}function y(I){a=vI(a,I)}let b=()=>{S(),Nu("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){S(),Nu("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let T=!1;function S(){function I(){S()}if(document.readyState==="loading"){T||window.addEventListener("DOMContentLoaded",I,!1),T=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function v(I,P){let D=null;try{D=P(e)}catch(U){if(Ra("Language definition for '{}' could not be registered.".replace("{}",I)),i)Ra(U);else throw U;D=s}D.name||(D.name=I),t[I]=D,D.rawDefinition=P.bind(null,e),D.aliases&&B(D.aliases,{languageName:I})}function x(I){delete t[I];for(let P of Object.keys(n))n[P]===I&&delete n[P]}function R(){return Object.keys(t)}function O(I){return I=(I||"").toLowerCase(),t[I]||t[n[I]]}function B(I,{languageName:P}){typeof I=="string"&&(I=[I]),I.forEach(D=>{n[D.toLowerCase()]=P})}function C(I){let P=O(I);return P&&!P.disableAutodetect}function V(I){I["before:highlightBlock"]&&!I["before:highlightElement"]&&(I["before:highlightElement"]=P=>{I["before:highlightBlock"](Object.assign({block:P.el},P))}),I["after:highlightBlock"]&&!I["after:highlightElement"]&&(I["after:highlightElement"]=P=>{I["after:highlightBlock"](Object.assign({block:P.el},P))})}function Y(I){V(I),r.push(I)}function q(I){let P=r.indexOf(I);P!==-1&&r.splice(P,1)}function L(I,P){let D=I;r.forEach(function(U){U[D]&&U[D](P)})}function H(I){return Nu("10.7.0","highlightBlock will be removed entirely in v12.0"),Nu("10.7.0","Please use highlightElement now."),g(I)}Object.assign(e,{highlight:c,highlightAuto:p,highlightAll:S,highlightElement:g,highlightBlock:H,configure:y,initHighlighting:b,initHighlightingOnLoad:E,registerLanguage:v,unregisterLanguage:x,listLanguages:R,getLanguage:O,registerAliases:B,autoDetection:C,inherit:vI,addPlugin:Y,removePlugin:q}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=Ej,e.regex={concat:ka,lookahead:wI,either:SS,optional:LW,anyNumberOfTimes:IW};for(let I in Zm)typeof Zm[I]=="object"&&AI(Zm[I]);return Object.assign(e,Zm),e},wu=BI({});wu.newInstance=()=>BI({});UI.exports=wu;wu.HighlightJS=wu;wu.default=wu});var K6=Ht(G6=>{"use strict";var Yu=fe();function gZ(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bZ=typeof Object.is=="function"?Object.is:gZ,yZ=Yu.useState,EZ=Yu.useEffect,TZ=Yu.useLayoutEffect,SZ=Yu.useDebugValue;function xZ(e,t){var n=t(),r=yZ({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return TZ(function(){i.value=n,i.getSnapshot=t,Rx(i)&&o({inst:i})},[e,n,t]),EZ(function(){return Rx(i)&&o({inst:i}),e(function(){Rx(i)&&o({inst:i})})},[e]),SZ(n),n}function Rx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bZ(e,n)}catch{return!0}}function _Z(e,t){return t()}var vZ=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?_Z:xZ;G6.useSyncExternalStore=Yu.useSyncExternalStore!==void 0?Yu.useSyncExternalStore:vZ});var Kg=Ht((g_e,Y6)=>{"use strict";Y6.exports=K6()});var h5=Ht(p5=>{"use strict";var L0=fe(),Gre=Kg();function Kre(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yre=typeof Object.is=="function"?Object.is:Kre,$re=Gre.useSyncExternalStore,Wre=L0.useRef,jre=L0.useEffect,Xre=L0.useMemo,Qre=L0.useDebugValue;p5.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Wre(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Xre(function(){function l(p){if(!u){if(u=!0,c=p,p=r(p),i!==void 0&&s.hasValue){var h=s.value;if(i(h,p))return f=h}return f=p}if(h=f,Yre(c,p))return h;var g=r(p);return i!==void 0&&i(h,g)?(c=p,h):(c=p,f=g)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return l(t())},d===null?void 0:function(){return l(d())}]},[t,n,r,i]);var a=$re(e,o[0],o[1]);return jre(function(){s.hasValue=!0,s.value=a},[a]),Qre(a),a}});var g5=Ht((wCe,m5)=>{"use strict";m5.exports=h5()});var y8=G(Ch(),1),Sv=G(fe(),1);var ut=G(fe(),1);var gn=G(fe(),1);function Yr(){let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,n=>n.toString(16).padStart(2,"0"));return`${t[0]}${t[1]}${t[2]}${t[3]}-${t[4]}${t[5]}-${t[6]}${t[7]}-${t[8]}${t[9]}-${t[10]}${t[11]}${t[12]}${t[13]}${t[14]}${t[15]}`}var mR=String.raw` {0,3}((\`|~)\2{2,}).*`,xF=new RegExp(`^${mR} -[\\s\\S]*?^ {0,3}\\1\\2*[ ]*$`,"gm"),_F=new RegExp(`^${mR}$`,"gm");function Ah(e,t=!1){let n=[];for(let i of e.matchAll(xF))n.push([i.index,i.index+i[0].length]);if(t){let i=o=>n.some(([s,a])=>o>=s&&o[i.index,i[0].length]);for(let i=0;in.some(([o,s])=>i>=o&&i").replace(/&#(\d+);/g,(t,n)=>gR(t,parseInt(n,10))).replace(/&#[xX]([0-9a-fA-F]+);/g,(t,n)=>gR(t,parseInt(n,16))).replace(/&/g,"&"):e}function gR(e,t){return!Number.isFinite(t)||t<0||t>1114111||t>=55296&&t<=57343?e:String.fromCodePoint(t)}function NF(e,t){let n=null;for(let r=t;r")return r}return-1}function wF(e){let t={};BE.lastIndex=0;let n;for(;(n=BE.exec(e))!==null;){if(n[0]===""){BE.lastIndex++;continue}if(n[1]===void 0)continue;let r=n[2]??n[3]??n[4]??"";t[n[1].toLowerCase()]=AF(r)}return t}function ru(e){return e===!0||e===""||e==="true"}function Nh(e,t){return t in e&&ru(e[t])}function yi(e,t){let n=e[t];return n||void 0}function RF(e){let t=e.grouping;return t==="none"||t==="tool"||t==="all"?t:void 0}function kF(e,t,n=!1){let r=[],i=t==="markdown"?Ah(e,n):()=>!1;PE.lastIndex=0;let o;for(;(o=PE.exec(e))!==null;){if(i(o.index))continue;let s=o[1],a=o.index+o[0].length,l=NF(e,a);if(l===-1)break;let u=``,c=e.indexOf(u,l+1);if(c===-1)break;let f=c+u.length;r.push({tag:s,attrs:wF(e.slice(a,l)),start:o.index,end:f}),PE.lastIndex=f}return r}function MF(e){let{attrs:t}=e,n=RF(t),r={requestId:t["request-id"]??"",toolName:t["tool-name"]??"",...n!==void 0?{grouping:n}:{},...t.intent!==void 0?{intent:t.intent}:{},start:e.start,end:e.end};return e.tag==="request"?{kind:"request",...r,...yi(t,"tool-title")!==void 0?{definitionTitle:yi(t,"tool-title")}:{},...yi(t,"icon")!==void 0?{definitionIcon:yi(t,"icon")}:{},...t.arguments!==void 0?{arguments:t.arguments}:{}}:{kind:"result",...r,...yi(t,"tool-title")!==void 0?{title:yi(t,"tool-title")}:{},...yi(t,"icon")!==void 0?{icon:yi(t,"icon")}:{},status:t.status==="error"?"error":"success",...t.label!==void 0?{label:t.label}:{},...t["value-preview"]!==void 0?{valuePreview:t["value-preview"]}:{},...t.value!==void 0?{value:t.value}:{},...yi(t,"value-type")!==void 0?{valueType:yi(t,"value-type")}:{},...t["request-call"]!==void 0?{requestCall:t["request-call"]}:{},showRequest:Nh(t,"show-request"),fullScreen:Nh(t,"full-screen"),expanded:Nh(t,"expanded"),customDisplay:Nh(t,"custom-display"),...t.footer!==void 0?{footer:t.footer}:{}}}function HE(e,t,n=!1){return kF(e,t,n).map(MF)}function OF(e,t,n){if(t.toolName&&(e.toolName=t.toolName),t.grouping!==void 0&&(e.grouping=t.grouping),t.intent!==void 0&&(e.intent=t.intent),t.kind==="request"){t.definitionTitle!==void 0&&(e.definitionTitle=t.definitionTitle),t.definitionIcon!==void 0&&(e.definitionIcon=t.definitionIcon),t.arguments!==void 0&&(e.arguments=t.arguments);return}t.title!==void 0&&(e.title=t.title),t.icon!==void 0&&(e.icon=t.icon),e.status=t.status,t.label!==void 0&&(e.label=t.label),t.valuePreview!==void 0&&(e.valuePreview=t.valuePreview),t.value!==void 0&&(e.value=t.value),t.valueType!==void 0&&(e.valueType=t.valueType),t.requestCall!==void 0&&(e.requestCall=t.requestCall),t.footer!==void 0&&(e.footer=t.footer),e.showRequest=t.showRequest,e.fullScreen=t.fullScreen,e.expanded=t.expanded,e.customDisplay=t.customDisplay,e.resolveIndex=t.start,e.resolveBlock=n}function DF(e,t,n){let r=[],i=new Map;return e.forEach((o,s)=>{let a=o.requestId,l=a||`__anon-${t}-${s}`,u=i.get(l);u||(u={requestId:a,localId:l,toolName:o.toolName,status:"running"},i.set(l,u),r.push(l)),OF(u,o,n)}),r.map(o=>i.get(o))}function yR(e){let t=e.find(i=>i.status!=="running"),n=e.find(i=>i.definitionTitle!==void 0)?.definitionTitle,r=t?.title??e.find(i=>i.title!==void 0)?.title;return e.length>1?n??r:r??n}function IF(e){let t=e.find(n=>n.definitionIcon!==void 0)?.definitionIcon;return e.length===1?e[0].icon??t:t}function LF(e){let t=[],n=new Map;for(let r of e){let i=n.get(r.toolName);i||(i=[],n.set(r.toolName,i),t.push(r.toolName)),i.push(r)}return t.map(r=>{let i=n.get(r);return{toolName:r,title:yR(i),count:i.length,settled:i.some(o=>o.status!=="running")}})}function iu(e){let t=e.find(n=>n.status!=="running");return{title:yR(e),titleSettled:t!==void 0,icon:IF(e),count:e.length,segments:LF(e)}}function ER(e,t){let n=new Map;if(t!=="none")for(let o of e)o.grouping&&!n.has(o.toolName)&&n.set(o.toolName,o.grouping);let r=[],i=new Map;return e.forEach(o=>{let s=n.get(o.toolName)??t,a=s==="none"?`none:${o.localId}`:s==="all"?"all":`tool:${o.toolName}`,l=i.get(a);l||(l=[],i.set(a,l),r.push(a)),l.push(o)}),r.map(o=>{let s=i.get(o),a=iu(s);return{key:o,toolName:s[0].toolName,title:a.title,titleSettled:a.titleSettled,icon:a.icon,count:a.count,calls:s,segments:a.segments}})}function PF(e,t,n,r,i,o){let s=DF(e,i,o);return{type:"tool_loop",content:t,contentType:n,grouping:r,groups:ER(s,r)}}function lo(e,t,n,r=!1){if(n==="user")return e;let i=[];return e.forEach((o,s)=>{if(o.type!=="content"||!UE(o.contentType)||!FE(o.content)){i.push(o);return}let a=HE(o.content,o.contentType,r);if(a.length===0){i.push(o);return}let l=o.contentType,u=0,c=-1,f=[],d=()=>{f.length!==0&&(i.push(PF(f,o.content.slice(c,u),l,t,`${s}:${c}`,s)),f=[],c=-1)};for(let h of a){let g=o.content.slice(u,h.start);g.trim()!==""&&(d(),i.push({type:"content",content:g,contentType:l})),f.length===0&&(c=h.start),f.push(h),u=h.end}d();let p=o.content.slice(u);p.trim()!==""&&i.push({type:"content",content:p,contentType:l})}),BF(i,t)}function BF(e,t){let n=[];for(let r of e){let i=n[n.length-1];if(r.type==="tool_loop"&&i?.type==="tool_loop"&&i.contentType===r.contentType){let o=[...i.groups.flatMap(l=>l.calls)],s=i.content+r.content,a=o.concat(r.groups.flatMap(l=>l.calls));n[n.length-1]={type:"tool_loop",content:s,contentType:i.contentType,grouping:t,groups:ER(a,t)}}else n.push(r)}return n}function zE(e,t){let n=new Set;for(let r of e)bR(r,n);return t&&bR(t,n),n}function bR(e,t){if(e.role==="user")return;let n=e.streaming===!0||e.insideFence===!0;for(let r of e.blocks){if(r.type==="tool_loop"){for(let i of r.groups)for(let o of i.calls)o.status!=="running"&&o.requestId&&t.add(o.requestId);continue}if(!(r.type!=="content"||!UE(r.contentType)||!FE(r.content)))for(let i of HE(r.content,r.contentType,n))i.kind==="result"&&i.requestId&&t.add(i.requestId)}}var uo={messages:[],streamingMessage:null,greeting:null,inputDisabled:!1,inputPlaceholder:"Enter a message...",cancelRequested:!1,enableCancel:!1,enableCancelExplicit:!1,enableUpload:!1,enableUploadExplicit:!1,toolGrouping:"tool",slashCommands:[],history:{enabled:!1,conversations:[],activeId:null}};function TR(e,t="tool"){let n=[];for(let s of e.segments)n.push(...Mh(s.content,s.content_type));let r=lo(n,t,e.role),i=e.attachments??[],o=pf(r);return{id:e.id??Yr(),role:e.role,content:o,streaming:!1,icon:e.icon,...i.length>0?{attachments:i}:{},blocks:r,siblings:e.siblings}}function wh(e){return e.filter(t=>!t.isPlaceholder)}function df(e,t){return t?[...e??[],...t]:e}function Rh(e){return e?.options.persistent!==!0&&e?.status==="visible"?{...e,status:"dismissing"}:e}function SR(e,t,n){return e?.status==="dismissed"||!t&&n?"dismissed":"visible"}var GE=/\n?([\s\S]*?)\n?<\/thinking>\n*/g;function Mh(e,t){if(t==="thinking")return[{type:"thinking",content:e,streaming:!1}];if(t!=="markdown")return[{type:"content",content:e,contentType:t}];let n=Ah(e),r=[],i=0;for(let s of e.matchAll(GE)){if(n(s.index))continue;let a=e.slice(i,s.index);a&&r.push({type:"content",content:a,contentType:t});let l=s[1]??"",{cleaned:u,topic:c}=UF(l);r.push({type:"thinking",content:u,streaming:!1,...c!==null?{topic:c}:{}}),i=s.index+s[0].length}let o=e.slice(i);return o&&r.push({type:"content",content:o,contentType:t}),r}function pf(e){return e.filter(t=>t.type==="content").map(t=>t.content).join("")}function UF(e){let t=null;return{cleaned:e.replace(AR,(r,i)=>(t=i,` +`+r.stack}}var Zb=Object.prototype.hasOwnProperty,qy=Xt.unstable_scheduleCallback,mb=Xt.unstable_cancelCallback,i9=Xt.unstable_shouldYield,o9=Xt.unstable_requestPaint,xr=Xt.unstable_now,s9=Xt.unstable_getCurrentPriorityLevel,DA=Xt.unstable_ImmediatePriority,IA=Xt.unstable_UserBlockingPriority,Pp=Xt.unstable_NormalPriority,a9=Xt.unstable_LowPriority,LA=Xt.unstable_IdlePriority,l9=Xt.log,u9=Xt.unstable_setDisableYieldValue,ef=null,_r=null;function Ko(e){if(typeof l9=="function"&&u9(e),_r&&typeof _r.setStrictMode=="function")try{_r.setStrictMode(ef,e)}catch{}}var vr=Math.clz32?Math.clz32:d9,c9=Math.log,f9=Math.LN2;function d9(e){return e>>>=0,e===0?32:31-(c9(e)/f9|0)|0}var tp=256,np=262144,rp=4194304;function Ys(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function lh(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,o=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var a=r&134217727;return a!==0?(r=a&~o,r!==0?i=Ys(r):(s&=a,s!==0?i=Ys(s):n||(n=a&~e,n!==0&&(i=Ys(n))))):(a=r&~o,a!==0?i=Ys(a):s!==0?i=Ys(s):n||(n=r&~e,n!==0&&(i=Ys(n)))),i===0?0:t!==0&&t!==i&&(t&o)===0&&(o=i&-i,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:i}function tf(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function p9(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function PA(){var e=rp;return rp<<=1,(rp&62914560)===0&&(rp=4194304),e}function gb(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function nf(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function h9(e,t,n,r,i,o){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var a=e.entanglements,l=e.expirationTimes,u=e.hiddenUpdates;for(n=s&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var T9=/[\n"\\]/g;function Hr(e){return e.replace(T9,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ty(e,t,n,r,i,o,s,a){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Br(t)):e.value!==""+Br(t)&&(e.value=""+Br(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?ny(e,s,Br(t)):n!=null?ny(e,s,Br(n)):r!=null&&e.removeAttribute("value"),i==null&&o!=null&&(e.defaultChecked=!!o),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.name=""+Br(a):e.removeAttribute("name")}function KA(e,t,n,r,i,o,s,a){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){ey(e);return}n=n!=null?""+Br(n):"",t=t!=null?""+Br(t):n,a||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=a?e.checked:!!r,e.defaultChecked=!!r,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),ey(e)}function ny(e,t,n){t==="number"&&Bp(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Dl(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),iy=!1;if(no)try{ml={},Object.defineProperty(ml,"passive",{get:function(){iy=!0}}),window.addEventListener("test",ml,ml),window.removeEventListener("test",ml,ml)}catch{iy=!1}var ml,Yo=null,Wy=null,Tp=null;function XA(){if(Tp)return Tp;var e,t=Wy,n=t.length,r,i="value"in Yo?Yo.value:Yo.textContent,o=i.length;for(e=0;e=Ac),mC=" ",gC=!1;function ZA(e,t){switch(e){case"keyup":return W9.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function JA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vl=!1;function X9(e,t){switch(e){case"compositionend":return JA(t);case"keypress":return t.which!==32?null:(gC=!0,mC);case"textInput":return e=t.data,e===mC&&gC?null:e;default:return null}}function Q9(e,t){if(vl)return e==="compositionend"||!Xy&&ZA(e,t)?(e=XA(),Tp=Wy=Yo=null,vl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=TC(n)}}function rN(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?rN(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function iN(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bp(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bp(e.document)}return t}function Qy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var oU=no&&"documentMode"in document&&11>=document.documentMode,Cl=null,oy=null,wc=null,sy=!1;function xC(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;sy||Cl==null||Cl!==Bp(r)||(r=Cl,"selectionStart"in r&&Qy(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),wc&&qc(wc,r)||(wc=r,r=th(oy,"onSelect"),0>=s,i-=s,di=1<<32-vr(t)+i|n<O?(B=R,R=null):B=R.sibling;var C=d(b,R,T[O],S);if(C===null){R===null&&(R=B);break}e&&R&&C.alternate===null&&t(b,R),E=o(C,E,O),x===null?v=C:x.sibling=C,x=C,R=B}if(O===T.length)return n(b,R),ze&&Wi(b,O),v;if(R===null){for(;OO?(B=R,R=null):B=R.sibling;var V=d(b,R,C.value,S);if(V===null){R===null&&(R=B);break}e&&R&&V.alternate===null&&t(b,R),E=o(V,E,O),x===null?v=V:x.sibling=V,x=V,R=B}if(C.done)return n(b,R),ze&&Wi(b,O),v;if(R===null){for(;!C.done;O++,C=T.next())C=f(b,C.value,S),C!==null&&(E=o(C,E,O),x===null?v=C:x.sibling=C,x=C);return ze&&Wi(b,O),v}for(R=r(R);!C.done;O++,C=T.next())C=p(R,b,O,C.value,S),C!==null&&(e&&C.alternate!==null&&R.delete(C.key===null?O:C.key),E=o(C,E,O),x===null?v=C:x.sibling=C,x=C);return e&&R.forEach(function(Y){return t(b,Y)}),ze&&Wi(b,O),v}function y(b,E,T,S){if(typeof T=="object"&&T!==null&&T.type===Tl&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case ep:e:{for(var v=T.key;E!==null;){if(E.key===v){if(v=T.type,v===Tl){if(E.tag===7){n(b,E.sibling),S=i(E,T.props.children),S.return=b,b=S;break e}}else if(E.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===Fo&&$s(v)===E.type){n(b,E.sibling),S=i(E,T.props),gc(S,T),S.return=b,b=S;break e}n(b,E);break}else t(b,E);E=E.sibling}T.type===Tl?(S=Xs(T.props.children,b.mode,S,T.key),S.return=b,b=S):(S=xp(T.type,T.key,T.props,null,b.mode,S),gc(S,T),S.return=b,b=S)}return s(b);case Sc:e:{for(v=T.key;E!==null;){if(E.key===v)if(E.tag===4&&E.stateNode.containerInfo===T.containerInfo&&E.stateNode.implementation===T.implementation){n(b,E.sibling),S=i(E,T.children||[]),S.return=b,b=S;break e}else{n(b,E);break}else t(b,E);E=E.sibling}S=vb(T,b.mode,S),S.return=b,b=S}return s(b);case Fo:return T=$s(T),y(b,E,T,S)}if(xc(T))return h(b,E,T,S);if(hc(T)){if(v=hc(T),typeof v!="function")throw Error(W(150));return T=v.call(T),g(b,E,T,S)}if(typeof T.then=="function")return y(b,E,up(T),S);if(T.$$typeof===Xi)return y(b,E,lp(b,T),S);cp(b,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,E!==null&&E.tag===6?(n(b,E.sibling),S=i(E,T),S.return=b,b=S):(n(b,E),S=_b(T,b.mode,S),S.return=b,b=S),s(b)):n(b,E)}return function(b,E,T,S){try{Kc=0;var v=y(b,E,T,S);return Pl=null,v}catch(R){if(R===Jl||R===hh)throw R;var x=Tr(29,R,null,b.mode);return x.lanes=S,x.return=b,x}finally{}}}var na=EN(!0),TN=EN(!1),Ho=!1;function sE(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function py(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Zo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Jo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(We&2)!==0){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Fp(e),fN(e,null,n),t}return ph(e,r,t,n),Fp(e)}function kc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,UA(e,n)}}function Ab(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var hy=!1;function Mc(){if(hy){var e=Ll;if(e!==null)throw e}}function Oc(e,t,n,r){hy=!1;var i=e.updateQueue;Ho=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,c=u=l=null,a=o;do{var d=a.lane&-536870913,p=d!==a.lane;if(p?(Fe&d)===d:(r&d)===d){d!==0&&d===ql&&(hy=!0),c!==null&&(c=c.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var h=e,g=a;d=t;var y=n;switch(g.tag){case 1:if(h=g.payload,typeof h=="function"){f=h.call(y,f,d);break e}f=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,d=typeof h=="function"?h.call(y,f,d):h,d==null)break e;f=yt({},f,d);break e;case 2:Ho=!0}}d=a.callback,d!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[d]:p.push(d))}else p={lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=p,l=f):c=c.next=p,s|=d;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);c===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,o===null&&(i.shared.lanes=0),us|=s,e.lanes=s,e.memoizedState=f}}function SN(e,t){if(typeof e!="function")throw Error(W(191,e));e.call(t)}function xN(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;eo?o:8;var s=_e.T,a={};_e.T=a,EE(e,!1,t,n);try{var l=i(),u=_e.S;if(u!==null&&u(a,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=hU(l,r);Dc(e,t,c,Cr(e))}else Dc(e,t,r,Cr(e))}catch(f){Dc(e,t,{then:function(){},status:"rejected",reason:f},Cr())}finally{je.p=o,s!==null&&a.types!==null&&(s.types=a.types),_e.T=s}}function TU(){}function Ey(e,t,n,r){if(e.tag!==5)throw Error(W(476));var i=$N(e).queue;YN(e,i,t,js,n===null?TU:function(){return WN(e),n(r)})}function $N(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:js,baseState:js,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:io,lastRenderedState:js},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function WN(e){var t=$N(e);t.next===null&&(t=e.alternate.memoizedState),Dc(e,t.next.queue,{},Cr())}function yE(){return hn(Xc)}function jN(){return It().memoizedState}function XN(){return It().memoizedState}function SU(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cr();e=Zo(n);var r=Jo(t,e,n);r!==null&&(tr(r,t,n),kc(r,t,n)),t={cache:rE()},e.payload=t;return}t=t.return}}function xU(e,t,n){var r=Cr();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},yh(e)?ZN(t,n):(n=Jy(e,t,n,r),n!==null&&(tr(n,e,r),JN(n,t,r)))}function QN(e,t,n){var r=Cr();Dc(e,t,n,r)}function Dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(yh(e))ZN(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Ar(a,s))return ph(e,t,i,0),at===null&&dh(),!1}catch{}finally{}if(n=Jy(e,t,i,r),n!==null)return tr(n,e,r),JN(n,t,r),!0}return!1}function EE(e,t,n,r){if(r={lane:2,revertLane:wE(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},yh(e)){if(t)throw Error(W(479))}else t=Jy(e,n,r,2),t!==null&&tr(t,e,2)}function yh(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function ZN(e,t){Bl=Kp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function JN(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,UA(e,n)}}var $c={readContext:hn,use:gh,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};$c.useEffectEvent=Rt;var ew={readContext:hn,use:gh,useCallback:function(e,t){return Un().memoizedState=[e,t===void 0?null:t],e},useContext:hn,useEffect:BC,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Cp(4194308,4,zN.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Cp(4194308,4,e,t)},useInsertionEffect:function(e,t){Cp(4,2,e,t)},useMemo:function(e,t){var n=Un();t=t===void 0?null:t;var r=e();if(ra){Ko(!0);try{e()}finally{Ko(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Un();if(n!==void 0){var i=n(t);if(ra){Ko(!0);try{n(t)}finally{Ko(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=xU.bind(null,Me,e),[r.memoizedState,e]},useRef:function(e){var t=Un();return e={current:e},t.memoizedState=e},useState:function(e){e=by(e);var t=e.queue,n=QN.bind(null,Me,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:gE,useDeferredValue:function(e,t){var n=Un();return bE(n,e,t)},useTransition:function(){var e=by(!1);return e=YN.bind(null,Me,e.queue,!0,!1),Un().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Me,i=Un();if(ze){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),at===null)throw Error(W(349));(Fe&127)!==0||NN(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,BC(RN.bind(null,r,o,e),[e]),r.flags|=2048,Gl(9,{destroy:void 0},wN.bind(null,r,o,n,t),null),n},useId:function(){var e=Un(),t=at.identifierPrefix;if(ze){var n=pi,r=di;n=(r&~(1<<32-vr(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Yp++,0<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof r.is=="string"?s.createElement("select",{is:r.is}):s.createElement("select"),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is=="string"?s.createElement(i,{is:r.is}):s.createElement(i)}}o[dn]=t,o[nr]=r;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;e:switch(mn(o,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Gi(t)}}return gt(t),Ib(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Gi(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(W(166));if(e=Xo.current,gl(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=pn,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[dn]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Qw(e.nodeValue,n)),e||as(t,!0)}else e=nh(e).createTextNode(r),e[dn]=t,t.stateNode=e}return gt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=gl(t),n!==null){if(e===null){if(!r)throw Error(W(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(557));e[dn]=t}else ea(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),e=!1}else n=Cb(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Er(t),t):(Er(t),null);if((t.flags&128)!==0)throw Error(W(558))}return gt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=gl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(W(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(W(317));i[dn]=t}else ea(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),i=!1}else i=Cb(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Er(t),t):(Er(t),null)}return Er(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fp(t,t.updateQueue),gt(t),null);case 4:return Fl(),e===null&&RE(t.stateNode.containerInfo),gt(t),null;case 10:return eo(t.type),gt(t),null;case 19:if(en(Dt),r=t.memoizedState,r===null)return gt(t),null;if(i=(t.flags&128)!==0,o=r.rendering,o===null)if(i)bc(r,!1);else{if(kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Gp(e),o!==null){for(t.flags|=128,bc(r,!1),e=o.updateQueue,t.updateQueue=e,fp(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)dN(n,e),n=n.sibling;return ft(Dt,Dt.current&1|2),ze&&Wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&xr()>Xp&&(t.flags|=128,i=!0,bc(r,!1),t.lanes=4194304)}else{if(!i)if(e=Gp(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,fp(t,e),bc(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!ze)return gt(t),null}else 2*xr()-r.renderingStartTime>Xp&&n!==536870912&&(t.flags|=128,i=!0,bc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e!==null?e.sibling=o:t.child=o,r.last=o)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=xr(),e.sibling=null,n=Dt.current,ft(Dt,i?n&1|2:n&1),ze&&Wi(t,r.treeForkCount),e):(gt(t),null);case 22:case 23:return Er(t),aE(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),n=t.updateQueue,n!==null&&fp(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&en(Qs),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),eo(Vt),gt(t),null;case 25:return null;case 30:return null}throw Error(W(156,t.tag))}function NU(e,t){switch(nE(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return eo(Vt),Fl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Lp(t),null;case 31:if(t.memoizedState!==null){if(Er(t),t.alternate===null)throw Error(W(340));ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Er(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return en(Dt),null;case 4:return Fl(),null;case 10:return eo(t.type),null;case 22:case 23:return Er(t),aE(),e!==null&&en(Qs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return eo(Vt),null;case 25:return null;default:return null}}function dw(e,t){switch(nE(t),t.tag){case 3:eo(Vt),Fl();break;case 26:case 27:case 5:Lp(t);break;case 4:Fl();break;case 31:t.memoizedState!==null&&Er(t);break;case 13:Er(t);break;case 19:en(Dt);break;case 10:eo(t.type);break;case 22:case 23:Er(t),aE(),e!==null&&en(Qs);break;case 24:eo(Vt)}}function lf(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var o=n.create,s=n.inst;r=o(),s.destroy=r}n=n.next}while(n!==i)}}catch(a){Je(t,t.return,a)}}function ls(e,t,n){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var o=i.next;r=o;do{if((r.tag&e)===e){var s=r.inst,a=s.destroy;if(a!==void 0){s.destroy=void 0,i=t;var l=n,u=a;try{u()}catch(c){Je(i,l,c)}}}r=r.next}while(r!==o)}}catch(c){Je(t,t.return,c)}}function pw(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xN(t,n)}catch(r){Je(e,e.return,r)}}}function hw(e,t,n){n.props=ia(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){Je(e,t,r)}}function Ic(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(i){Je(e,t,i)}}function hi(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(i){Je(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Je(e,t,i)}else n.current=null}function mw(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){Je(e,e.return,i)}}function Lb(e,t,n){try{var r=e.stateNode;$U(r,e.type,n,t),r[nr]=t}catch(i){Je(e,e.return,i)}}function gw(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&fs(e.type)||e.tag===4}function Pb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&fs(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function vy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qi));else if(r!==4&&(r===27&&fs(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(vy(e,t,n),e=e.sibling;e!==null;)vy(e,t,n),e=e.sibling}function jp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&fs(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(jp(e,t,n),e=e.sibling;e!==null;)jp(e,t,n),e=e.sibling}function bw(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);mn(t,r,n),t[dn]=e,t[nr]=n}catch(o){Je(e,e.return,o)}}var ji=!1,qt=!1,Bb=!1,XC=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function wU(e,t){if(e=e.containerInfo,My=sh,e=iN(e),Qy(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===e)break t;if(d===n&&++u===i&&(a=s),d===o&&++c===r&&(l=s),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Oy={focusedElem:e,selectionRange:n},sh=!1,Zt=t;Zt!==null;)if(t=Zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Zt=e;else for(;Zt!==null;){switch(t=Zt,o=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),mn(o,r,n),o[dn]=e,Jt(o),r=o;break e;case"link":var s=yA("link","href",i).get(r+(n.href||""));if(s){for(var a=0;ay&&(s=y,y=g,g=s);var b=SC(a,g),E=SC(a,y);if(b&&E&&(p.rangeCount!==1||p.anchorNode!==b.node||p.anchorOffset!==b.offset||p.focusNode!==E.node||p.focusOffset!==E.offset)){var T=f.createRange();T.setStart(b.node,b.offset),p.removeAllRanges(),g>y?(p.addRange(T),p.extend(E.node,E.offset)):(T.setEnd(E.node,E.offset),p.addRange(T))}}}}for(f=[],p=a;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;an?32:n,_e.T=null,n=Ny,Ny=null;var o=ts,s=to;if(jt=0,Yl=ts=null,to=0,(We&6)!==0)throw Error(W(331));var a=We;if(We|=4,ww(o.current),Cw(o,o.current,s,n),We=a,uf(0,!1),_r&&typeof _r.onPostCommitFiberRoot=="function")try{_r.onPostCommitFiberRoot(ef,o)}catch{}return!0}finally{je.p=i,_e.T=r,Vw(e,t)}}function eA(e,t,n){t=zr(n,t),t=Sy(e.stateNode,t,2),e=Jo(e,t,2),e!==null&&(nf(e,2),bi(e))}function Je(e,t,n){if(e.tag===3)eA(e,e,n);else for(;t!==null;){if(t.tag===3){eA(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(es===null||!es.has(r))){e=zr(n,e),n=ow(2),r=Jo(t,n,2),r!==null&&(sw(n,r,t,e),nf(r,2),bi(r));break}}t=t.return}}function Fb(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new MU;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(CE=!0,i.add(n),e=PU.bind(null,e,t,n),t.then(e,e))}function PU(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,at===e&&(Fe&n)===n&&(kt===4||kt===3&&(Fe&62914560)===Fe&&300>xr()-Eh?(We&2)===0&&$l(e,0):AE|=n,Kl===Fe&&(Kl=0)),bi(e)}function Kw(e,t){t===0&&(t=PA()),e=la(e,t),e!==null&&(nf(e,t),bi(e))}function BU(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Kw(e,n)}function UU(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(W(314))}r!==null&&r.delete(t),Kw(e,n)}function FU(e,t){return qy(e,t)}var Jp=null,El=null,Ry=!1,eh=!1,Hb=!1,jo=0;function bi(e){e!==El&&e.next===null&&(El===null?Jp=El=e:El=El.next=e),eh=!0,Ry||(Ry=!0,zU())}function uf(e,t){if(!Hb&&eh){Hb=!0;do for(var n=!1,r=Jp;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var o=0;else{var s=r.suspendedLanes,a=r.pingedLanes;o=(1<<31-vr(42|e)+1)-1,o&=i&~(s&~a),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,tA(r,o))}else o=Fe,o=lh(r,r===at?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(o&3)===0||tf(r,o)||(n=!0,tA(r,o));r=r.next}while(n);Hb=!1}}function HU(){Yw()}function Yw(){eh=Ry=!1;var e=0;jo!==0&&jU()&&(e=jo);for(var t=xr(),n=null,r=Jp;r!==null;){var i=r.next,o=$w(r,t);o===0?(r.next=null,n===null?Jp=i:n.next=i,i===null&&(El=n)):(n=r,(e!==0||(o&3)!==0)&&(eh=!0)),r=i}jt!==0&&jt!==5||uf(e,!1),jo!==0&&(jo=0)}function $w(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes&-62914561;0a)break;var c=l.transferSize,f=l.initiatorType;c&&lA(f)&&(l=l.responseEnd,s+=c*(l"u"?null:document;function nR(e,t,n){var r=tu;if(r&&typeof t=="string"&&t){var i=Hr(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),mA.has(i)||(mA.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),mn(t,"link",e),Jt(t),r.head.appendChild(t)))}}function iF(e){ao.D(e),nR("dns-prefetch",e,null)}function oF(e,t){ao.C(e,t),nR("preconnect",e,t)}function sF(e,t,n){ao.L(e,t,n);var r=tu;if(r&&e&&t){var i='link[rel="preload"][as="'+Hr(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Hr(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Hr(n.imageSizes)+'"]')):i+='[href="'+Hr(e)+'"]';var o=i;switch(t){case"style":o=Wl(e);break;case"script":o=nu(e)}Kr.has(o)||(e=yt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Kr.set(o,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(cf(o))||t==="script"&&r.querySelector(ff(o))||(t=r.createElement("link"),mn(t,"link",e),Jt(t),r.head.appendChild(t)))}}function aF(e,t){ao.m(e,t);var n=tu;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Hr(r)+'"][href="'+Hr(e)+'"]',o=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=nu(e)}if(!Kr.has(o)&&(e=yt({rel:"modulepreload",href:e},t),Kr.set(o,e),n.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ff(o)))return}r=n.createElement("link"),mn(r,"link",e),Jt(r),n.head.appendChild(r)}}}function lF(e,t,n){ao.S(e,t,n);var r=tu;if(r&&e){var i=Ol(r).hoistableStyles,o=Wl(e);t=t||"default";var s=i.get(o);if(!s){var a={loading:0,preload:null};if(s=r.querySelector(cf(o)))a.loading=5;else{e=yt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Kr.get(o))&&kE(e,n);var l=s=r.createElement("link");Jt(l),mn(l,"link",e),l._p=new Promise(function(u,c){l.onload=u,l.onerror=c}),l.addEventListener("load",function(){a.loading|=1}),l.addEventListener("error",function(){a.loading|=2}),a.loading|=4,Rp(s,t,r)}s={type:"stylesheet",instance:s,count:1,state:a},i.set(o,s)}}}function uF(e,t){ao.X(e,t);var n=tu;if(n&&e){var r=Ol(n).hoistableScripts,i=nu(e),o=r.get(i);o||(o=n.querySelector(ff(i)),o||(e=yt({src:e,async:!0},t),(t=Kr.get(i))&&ME(e,t),o=n.createElement("script"),Jt(o),mn(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(i,o))}}function cF(e,t){ao.M(e,t);var n=tu;if(n&&e){var r=Ol(n).hoistableScripts,i=nu(e),o=r.get(i);o||(o=n.querySelector(ff(i)),o||(e=yt({src:e,async:!0,type:"module"},t),(t=Kr.get(i))&&ME(e,t),o=n.createElement("script"),Jt(o),mn(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(i,o))}}function gA(e,t,n,r){var i=(i=Xo.current)?rh(i):null;if(!i)throw Error(W(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Wl(n.href),n=Ol(i).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Wl(n.href);var o=Ol(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(cf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Kr.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Kr.set(e,n),o||fF(i,e,n,s.state))),t&&r===null)throw Error(W(528,""));return s}if(t&&r!==null)throw Error(W(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=nu(n),n=Ol(i).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(W(444,e))}}function Wl(e){return'href="'+Hr(e)+'"'}function cf(e){return'link[rel="stylesheet"]['+e+"]"}function rR(e){return yt({},e,{"data-precedence":e.precedence,precedence:null})}function fF(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),mn(t,"link",n),Jt(t),e.head.appendChild(t))}function nu(e){return'[src="'+Hr(e)+'"]'}function ff(e){return"script[async]"+e}function bA(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Hr(n.href)+'"]');if(r)return t.instance=r,Jt(r),r;var i=yt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Jt(r),mn(r,"style",i),Rp(r,n.precedence,e),t.instance=r;case"stylesheet":i=Wl(n.href);var o=e.querySelector(cf(i));if(o)return t.state.loading|=4,t.instance=o,Jt(o),o;r=rR(n),(i=Kr.get(i))&&kE(r,i),o=(e.ownerDocument||e).createElement("link"),Jt(o);var s=o;return s._p=new Promise(function(a,l){s.onload=a,s.onerror=l}),mn(o,"link",r),t.state.loading|=4,Rp(o,n.precedence,e),t.instance=o;case"script":return o=nu(n.src),(i=e.querySelector(ff(o)))?(t.instance=i,Jt(i),i):(r=n,(i=Kr.get(o))&&(r=yt({},n),ME(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),Jt(i),mn(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(W(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Rp(r,n.precedence,e));return t.instance}function Rp(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,o=i,s=0;s title"):null)}function dF(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function iR(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function pF(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Wl(r.href),o=t.querySelector(cf(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ih.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,Jt(o);return}o=t.ownerDocument||t,r=rR(r),(i=Kr.get(i))&&kE(r,i),o=o.createElement("link"),Jt(o);var s=o;s._p=new Promise(function(a,l){s.onload=a,s.onerror=l}),mn(o,"link",r),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ih.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Gb=0;function hF(e,t){return e.stylesheets&&e.count===0&&Mp(e,e.stylesheets),0Gb?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ih(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var oh=null;function Mp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oh=new Map,t.forEach(mF,e),oh=null,ih.call(e))}function mF(e,t){if(!(t.state.loading&4)){var n=oh.get(e);if(n)var r=n.get(null);else{n=new Map,oh.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o{"use strict";function pR(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(pR)}catch(e){console.error(e)}}pR(),hR.exports=dR()});var pk=Ht(($ae,dk)=>{"use strict";var lk=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,XH=/\n/g,QH=/^\s*/,ZH=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,JH=/^:\s*/,ez=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,tz=/^[;\s]*/,nz=/^\s+|\s+$/g,rz=` +`,uk="/",ck="*",da="",iz="comment",oz="declaration";function sz(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(h){var g=h.match(XH);g&&(n+=g.length);var y=h.lastIndexOf(rz);r=~y?h.length-y:r+h.length}function o(){var h={line:n,column:r};return function(g){return g.position=new s(h),u(),g}}function s(h){this.start=h,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(h){var g=new Error(t.source+":"+n+":"+r+": "+h);if(g.reason=h,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(h){var g=h.exec(e);if(g){var y=g[0];return i(y),e=e.slice(y.length),g}}function u(){l(QH)}function c(h){var g;for(h=h||[];g=f();)g!==!1&&h.push(g);return h}function f(){var h=o();if(!(uk!=e.charAt(0)||ck!=e.charAt(1))){for(var g=2;da!=e.charAt(g)&&(ck!=e.charAt(g)||uk!=e.charAt(g+1));)++g;if(g+=2,da===e.charAt(g-1))return a("End of comment missing");var y=e.slice(2,g-2);return r+=2,i(y),e=e.slice(g),r+=2,h({type:iz,comment:y})}}function d(){var h=o(),g=l(ZH);if(g){if(f(),!l(JH))return a("property missing ':'");var y=l(ez),b=h({type:oz,property:fk(g[0].replace(lk,da)),value:y?fk(y[0].replace(lk,da)):da});return l(tz),b}}function p(){var h=[];c(h);for(var g;g=d();)g!==!1&&(h.push(g),c(h));return h}return u(),p()}function fk(e){return e?e.replace(nz,da):da}dk.exports=sz});var hk=Ht(yf=>{"use strict";var az=yf&&yf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yf,"__esModule",{value:!0});yf.default=uz;var lz=az(pk());function uz(e,t){let n=null;if(!e||typeof e!="string")return n;let r=(0,lz.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;let{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}});var gk=Ht($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.camelCase=void 0;var cz=/^--[a-zA-Z0-9_-]+$/,fz=/-([a-z])/g,dz=/^[^-]+$/,pz=/^-(webkit|moz|ms|o|khtml)-/,hz=/^-(ms)-/,mz=function(e){return!e||dz.test(e)||cz.test(e)},gz=function(e,t){return t.toUpperCase()},mk=function(e,t){return"".concat(t,"-")},bz=function(e,t){return t===void 0&&(t={}),mz(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(hz,mk):e=e.replace(pz,mk),e.replace(fz,gz))};$h.camelCase=bz});var yk=Ht((m1,bk)=>{"use strict";var yz=m1&&m1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ez=yz(hk()),Tz=gk();function h1(e,t){var n={};return!e||typeof e!="string"||(0,Ez.default)(e,function(r,i){r&&i&&(n[(0,Tz.camelCase)(r,t)]=i)}),n}h1.default=h1;bk.exports=h1});var Lk=Ht(jh=>{"use strict";var $z=Symbol.for("react.transitional.element"),Wz=Symbol.for("react.fragment");function Ik(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:$z,type:e,key:r,ref:t!==void 0?t:null,props:n}}jh.Fragment=Wz;jh.jsx=Ik;jh.jsxs=Ik});var ie=Ht((Vle,Pk)=>{"use strict";Pk.exports=Lk()});var JM=Ht((Fce,ZM)=>{"use strict";var Em=Object.prototype.hasOwnProperty,QM=Object.prototype.toString,KM=Object.defineProperty,YM=Object.getOwnPropertyDescriptor,$M=function(t){return typeof Array.isArray=="function"?Array.isArray(t):QM.call(t)==="[object Array]"},WM=function(t){if(!t||QM.call(t)!=="[object Object]")return!1;var n=Em.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Em.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Em.call(t,i)},jM=function(t,n){KM&&n.name==="__proto__"?KM(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},XM=function(t,n){if(n==="__proto__")if(Em.call(t,n)){if(YM)return YM(t,n).value}else return;return t[n]};ZM.exports=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l{function AI(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&AI(n)}),e}var Jm=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function NI(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Cs(e,...t){let n=Object.create(null);for(let r in e)n[r]=e[r];return t.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var DW="",TI=e=>!!e.scope,IW=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`},bS=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=NI(t)}openNode(t){if(!TI(t))return;let n=IW(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){TI(t)&&(this.buffer+=DW)}value(){return this.buffer}span(t){this.buffer+=``}},SI=(e={})=>{let t={children:[]};return Object.assign(t,e),t},yS=class e{constructor(){this.rootNode=SI(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let n=SI({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{e._collapse(n)}))}},ES=class extends yS{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){let r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new bS(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Qf(e){return e?typeof e=="string"?e:e.source:null}function wI(e){return ka("(?=",e,")")}function LW(e){return ka("(?:",e,")*")}function PW(e){return ka("(?:",e,")?")}function ka(...e){return e.map(n=>Qf(n)).join("")}function BW(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function SS(...e){return"("+(BW(e).capture?"":"?:")+e.map(r=>Qf(r)).join("|")+")"}function RI(e){return new RegExp(e.toString()+"|").exec("").length-1}function UW(e,t){let n=e&&e.exec(t);return n&&n.index===0}var FW=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function xS(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;let i=n,o=Qf(r),s="";for(;o.length>0;){let a=FW.exec(o);if(!a){s+=o;break}s+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+i):(s+=a[0],a[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(t)}var HW=/\b\B/,kI="[a-zA-Z]\\w*",_S="[a-zA-Z_]\\w*",MI="\\b\\d+(\\.\\d+)?",OI="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",DI="\\b(0b[01]+)",zW="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",qW=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=ka(t,/.*\b/,e.binary,/\b.*/)),Cs({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Zf={begin:"\\\\[\\s\\S]",relevance:0},VW={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Zf]},GW={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Zf]},KW={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},tg=function(e,t,n={}){let r=Cs({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=SS("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:ka(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},YW=tg("//","$"),$W=tg("/\\*","\\*/"),WW=tg("#","$"),jW={scope:"number",begin:MI,relevance:0},XW={scope:"number",begin:OI,relevance:0},QW={scope:"number",begin:DI,relevance:0},ZW={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Zf,{begin:/\[/,end:/\]/,relevance:0,contains:[Zf]}]},JW={scope:"title",begin:kI,relevance:0},ej={scope:"title",begin:_S,relevance:0},tj={begin:"\\.\\s*"+_S,relevance:0},nj=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})},Zm=Object.freeze({__proto__:null,APOS_STRING_MODE:VW,BACKSLASH_ESCAPE:Zf,BINARY_NUMBER_MODE:QW,BINARY_NUMBER_RE:DI,COMMENT:tg,C_BLOCK_COMMENT_MODE:$W,C_LINE_COMMENT_MODE:YW,C_NUMBER_MODE:XW,C_NUMBER_RE:OI,END_SAME_AS_BEGIN:nj,HASH_COMMENT_MODE:WW,IDENT_RE:kI,MATCH_NOTHING_RE:HW,METHOD_GUARD:tj,NUMBER_MODE:jW,NUMBER_RE:MI,PHRASAL_WORDS_MODE:KW,QUOTE_STRING_MODE:GW,REGEXP_MODE:ZW,RE_STARTERS_RE:zW,SHEBANG:qW,TITLE_MODE:JW,UNDERSCORE_IDENT_RE:_S,UNDERSCORE_TITLE_MODE:ej});function rj(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function ij(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function oj(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=rj,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function sj(e,t){Array.isArray(e.illegal)&&(e.illegal=SS(...e.illegal))}function aj(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function lj(e,t){e.relevance===void 0&&(e.relevance=1)}var uj=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=ka(n.beforeMatch,wI(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},cj=["of","and","for","in","not","or","if","then","parent","list","value"],fj="keyword";function II(e,t,n=fj){let r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(o){Object.assign(r,II(e[o],t,o))}),r;function i(o,s){t&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let l=a.split("|");r[l[0]]=[o,dj(l[0],l[1])]})}}function dj(e,t){return t?Number(t):pj(e)?0:1}function pj(e){return cj.includes(e.toLowerCase())}var xI={},Ra=e=>{console.error(e)},_I=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Nu=(e,t)=>{xI[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),xI[`${e}/${t}`]=!0)},eg=new Error;function LI(e,t,{key:n}){let r=0,i=e[n],o={},s={};for(let a=1;a<=t.length;a++)s[a+r]=i[a],o[a+r]=!0,r+=RI(t[a-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function hj(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ra("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),eg;if(typeof e.beginScope!="object"||e.beginScope===null)throw Ra("beginScope must be object"),eg;LI(e,e.begin,{key:"beginScope"}),e.begin=xS(e.begin,{joinWith:""})}}function mj(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ra("skip, excludeEnd, returnEnd not compatible with endScope: {}"),eg;if(typeof e.endScope!="object"||e.endScope===null)throw Ra("endScope must be object"),eg;LI(e,e.end,{key:"endScope"}),e.end=xS(e.end,{joinWith:""})}}function gj(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function bj(e){gj(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),hj(e),mj(e)}function yj(e){function t(s,a){return new RegExp(Qf(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=RI(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=t(xS(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let u=l.findIndex((f,d)=>d>0&&f!==void 0),c=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,c)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new n;return this.rules.slice(a).forEach(([u,c])=>l.addRule(u,c)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(a);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){let c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,u=c.exec(a)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(s){let a=new r;return s.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function o(s,a){let l=s;if(s.isCompiled)return l;[ij,aj,bj,uj].forEach(c=>c(s,a)),e.compilerExtensions.forEach(c=>c(s,a)),s.__beforeBegin=null,[oj,sj,lj].forEach(c=>c(s,a)),s.isCompiled=!0;let u=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),u=s.keywords.$pattern,delete s.keywords.$pattern),u=u||/\w+/,s.keywords&&(s.keywords=II(s.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),a&&(s.begin||(s.begin=/\B|\b/),l.beginRe=t(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=t(l.end)),l.terminatorEnd=Qf(l.end)||"",s.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(l.illegalRe=t(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(c){return Ej(c==="self"?s:c)})),s.contains.forEach(function(c){o(c,l)}),s.starts&&o(s.starts,a),l.matcher=i(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Cs(e.classNameAliases||{}),o(e)}function PI(e){return e?e.endsWithParent||PI(e.starts):!1}function Ej(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Cs(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:PI(e)?Cs(e,{starts:e.starts?Cs(e.starts):null}):Object.isFrozen(e)?Cs(e):e}var Tj="11.11.1",TS=class extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}},gS=NI,vI=Cs,CI=Symbol("nomatch"),Sj=7,BI=function(e){let t=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ES};function l(I){return a.noHighlightRe.test(I)}function u(I){let P=I.className+" ";P+=I.parentNode?I.parentNode.className:"";let D=a.languageDetectRe.exec(P);if(D){let U=O(D[1]);return U||(_I(o.replace("{}",D[1])),_I("Falling back to no-highlight mode for this block.",I)),U?D[1]:"no-highlight"}return P.split(/\s+/).find(U=>l(U)||O(U))}function c(I,P,D){let U="",_="";typeof P=="object"?(U=I,D=P.ignoreIllegals,_=P.language):(Nu("10.7.0","highlight(lang, code, ...args) has been deprecated."),Nu("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),_=I,U=P),D===void 0&&(D=!0);let te={code:U,language:_};L("before:highlight",te);let ne=te.result?te.result:f(te.language,te.code,D);return ne.code=te.code,L("after:highlight",ne),ne}function f(I,P,D,U){let _=Object.create(null);function te(w,F){return w.keywords[F]}function ne(){if(!ue.keywords){Ie.addText(j);return}let w=0;ue.keywordPatternRe.lastIndex=0;let F=ue.keywordPatternRe.exec(j),$="";for(;F;){$+=j.substring(w,F.index);let oe=Ne.case_insensitive?F[0].toLowerCase():F[0],be=te(ue,oe);if(be){let[Ke,jn]=be;if(Ie.addText($),$="",_[oe]=(_[oe]||0)+1,_[oe]<=Sj&&(Se+=jn),Ke.startsWith("_"))$+=F[0];else{let Xn=Ne.classNameAliases[Ke]||Ke;se(F[0],Xn)}}else $+=F[0];w=ue.keywordPatternRe.lastIndex,F=ue.keywordPatternRe.exec(j)}$+=j.substring(w),Ie.addText($)}function A(){if(j==="")return;let w=null;if(typeof ue.subLanguage=="string"){if(!t[ue.subLanguage]){Ie.addText(j);return}w=f(ue.subLanguage,j,!0,St[ue.subLanguage]),St[ue.subLanguage]=w._top}else w=p(j,ue.subLanguage.length?ue.subLanguage:null);ue.relevance>0&&(Se+=w.relevance),Ie.__addSublanguage(w._emitter,w.language)}function re(){ue.subLanguage!=null?A():ne(),j=""}function se(w,F){w!==""&&(Ie.startScope(F),Ie.addText(w),Ie.endScope())}function xe(w,F){let $=1,oe=F.length-1;for(;$<=oe;){if(!w._emit[$]){$++;continue}let be=Ne.classNameAliases[w[$]]||w[$],Ke=F[$];be?se(Ke,be):(j=Ke,ne(),j=""),$++}}function Ve(w,F){return w.scope&&typeof w.scope=="string"&&Ie.openNode(Ne.classNameAliases[w.scope]||w.scope),w.beginScope&&(w.beginScope._wrap?(se(j,Ne.classNameAliases[w.beginScope._wrap]||w.beginScope._wrap),j=""):w.beginScope._multi&&(xe(w.beginScope,F),j="")),ue=Object.create(w,{parent:{value:ue}}),ue}function de(w,F,$){let oe=UW(w.endRe,$);if(oe){if(w["on:end"]){let be=new Jm(w);w["on:end"](F,be),be.isMatchIgnored&&(oe=!1)}if(oe){for(;w.endsParent&&w.parent;)w=w.parent;return w}}if(w.endsWithParent)return de(w.parent,F,$)}function ct(w){return ue.matcher.regexIndex===0?(j+=w[0],1):(xt=!0,0)}function Ge(w){let F=w[0],$=w.rule,oe=new Jm($),be=[$.__beforeBegin,$["on:begin"]];for(let Ke of be)if(Ke&&(Ke(w,oe),oe.isMatchIgnored))return ct(F);return $.skip?j+=F:($.excludeBegin&&(j+=F),re(),!$.returnBegin&&!$.excludeBegin&&(j=F)),Ve($,w),$.returnBegin?0:F.length}function rt(w){let F=w[0],$=P.substring(w.index),oe=de(ue,w,$);if(!oe)return CI;let be=ue;ue.endScope&&ue.endScope._wrap?(re(),se(F,ue.endScope._wrap)):ue.endScope&&ue.endScope._multi?(re(),xe(ue.endScope,w)):be.skip?j+=F:(be.returnEnd||be.excludeEnd||(j+=F),re(),be.excludeEnd&&(j=F));do ue.scope&&Ie.closeNode(),!ue.skip&&!ue.subLanguage&&(Se+=ue.relevance),ue=ue.parent;while(ue!==oe.parent);return oe.starts&&Ve(oe.starts,w),be.returnEnd?0:F.length}function he(){let w=[];for(let F=ue;F!==Ne;F=F.parent)F.scope&&w.unshift(F.scope);w.forEach(F=>Ie.openNode(F))}let Ce={};function Ae(w,F){let $=F&&F[0];if(j+=w,$==null)return re(),0;if(Ce.type==="begin"&&F.type==="end"&&Ce.index===F.index&&$===""){if(j+=P.slice(F.index,F.index+1),!i){let oe=new Error(`0 width match regex (${I})`);throw oe.languageName=I,oe.badRule=Ce.rule,oe}return 1}if(Ce=F,F.type==="begin")return Ge(F);if(F.type==="illegal"&&!D){let oe=new Error('Illegal lexeme "'+$+'" for mode "'+(ue.scope||"")+'"');throw oe.mode=ue,oe}else if(F.type==="end"){let oe=rt(F);if(oe!==CI)return oe}if(F.type==="illegal"&&$==="")return j+=` +`,1;if(wt>1e5&&wt>F.index*3)throw new Error("potential infinite loop, way more iterations than matches");return j+=$,$.length}let Ne=O(I);if(!Ne)throw Ra(o.replace("{}",I)),new Error('Unknown language: "'+I+'"');let me=yj(Ne),we="",ue=U||me,St={},Ie=new a.__emitter(a);he();let j="",Se=0,Xe=0,wt=0,xt=!1;try{if(Ne.__emitTokens)Ne.__emitTokens(P,Ie);else{for(ue.matcher.considerAll();;){wt++,xt?xt=!1:ue.matcher.considerAll(),ue.matcher.lastIndex=Xe;let w=ue.matcher.exec(P);if(!w)break;let F=P.substring(Xe,w.index),$=Ae(F,w);Xe=w.index+$}Ae(P.substring(Xe))}return Ie.finalize(),we=Ie.toHTML(),{language:I,value:we,relevance:Se,illegal:!1,_emitter:Ie,_top:ue}}catch(w){if(w.message&&w.message.includes("Illegal"))return{language:I,value:gS(P),illegal:!0,relevance:0,_illegalBy:{message:w.message,index:Xe,context:P.slice(Xe-100,Xe+100),mode:w.mode,resultSoFar:we},_emitter:Ie};if(i)return{language:I,value:gS(P),illegal:!1,relevance:0,errorRaised:w,_emitter:Ie,_top:ue};throw w}}function d(I){let P={value:gS(I),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return P._emitter.addText(I),P}function p(I,P){P=P||a.languages||Object.keys(t);let D=d(I),U=P.filter(O).filter(C).map(re=>f(re,I,!1));U.unshift(D);let _=U.sort((re,se)=>{if(re.relevance!==se.relevance)return se.relevance-re.relevance;if(re.language&&se.language){if(O(re.language).supersetOf===se.language)return 1;if(O(se.language).supersetOf===re.language)return-1}return 0}),[te,ne]=_,A=te;return A.secondBest=ne,A}function h(I,P,D){let U=P&&n[P]||D;I.classList.add("hljs"),I.classList.add(`language-${U}`)}function g(I){let P=null,D=u(I);if(l(D))return;if(L("before:highlightElement",{el:I,language:D}),I.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",I);return}if(I.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(I)),a.throwUnescapedHTML))throw new TS("One of your code blocks includes unescaped HTML.",I.innerHTML);P=I;let U=P.textContent,_=D?c(U,{language:D,ignoreIllegals:!0}):p(U);I.innerHTML=_.value,I.dataset.highlighted="yes",h(I,D,_.language),I.result={language:_.language,re:_.relevance,relevance:_.relevance},_.secondBest&&(I.secondBest={language:_.secondBest.language,relevance:_.secondBest.relevance}),L("after:highlightElement",{el:I,result:_,text:U})}function y(I){a=vI(a,I)}let b=()=>{S(),Nu("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){S(),Nu("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let T=!1;function S(){function I(){S()}if(document.readyState==="loading"){T||window.addEventListener("DOMContentLoaded",I,!1),T=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function v(I,P){let D=null;try{D=P(e)}catch(U){if(Ra("Language definition for '{}' could not be registered.".replace("{}",I)),i)Ra(U);else throw U;D=s}D.name||(D.name=I),t[I]=D,D.rawDefinition=P.bind(null,e),D.aliases&&B(D.aliases,{languageName:I})}function x(I){delete t[I];for(let P of Object.keys(n))n[P]===I&&delete n[P]}function R(){return Object.keys(t)}function O(I){return I=(I||"").toLowerCase(),t[I]||t[n[I]]}function B(I,{languageName:P}){typeof I=="string"&&(I=[I]),I.forEach(D=>{n[D.toLowerCase()]=P})}function C(I){let P=O(I);return P&&!P.disableAutodetect}function V(I){I["before:highlightBlock"]&&!I["before:highlightElement"]&&(I["before:highlightElement"]=P=>{I["before:highlightBlock"](Object.assign({block:P.el},P))}),I["after:highlightBlock"]&&!I["after:highlightElement"]&&(I["after:highlightElement"]=P=>{I["after:highlightBlock"](Object.assign({block:P.el},P))})}function Y(I){V(I),r.push(I)}function q(I){let P=r.indexOf(I);P!==-1&&r.splice(P,1)}function L(I,P){let D=I;r.forEach(function(U){U[D]&&U[D](P)})}function H(I){return Nu("10.7.0","highlightBlock will be removed entirely in v12.0"),Nu("10.7.0","Please use highlightElement now."),g(I)}Object.assign(e,{highlight:c,highlightAuto:p,highlightAll:S,highlightElement:g,highlightBlock:H,configure:y,initHighlighting:b,initHighlightingOnLoad:E,registerLanguage:v,unregisterLanguage:x,listLanguages:R,getLanguage:O,registerAliases:B,autoDetection:C,inherit:vI,addPlugin:Y,removePlugin:q}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=Tj,e.regex={concat:ka,lookahead:wI,either:SS,optional:PW,anyNumberOfTimes:LW};for(let I in Zm)typeof Zm[I]=="object"&&AI(Zm[I]);return Object.assign(e,Zm),e},wu=BI({});wu.newInstance=()=>BI({});UI.exports=wu;wu.HighlightJS=wu;wu.default=wu});var Y6=Ht(K6=>{"use strict";var Yu=fe();function EZ(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var TZ=typeof Object.is=="function"?Object.is:EZ,SZ=Yu.useState,xZ=Yu.useEffect,_Z=Yu.useLayoutEffect,vZ=Yu.useDebugValue;function CZ(e,t){var n=t(),r=SZ({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return _Z(function(){i.value=n,i.getSnapshot=t,Rx(i)&&o({inst:i})},[e,n,t]),xZ(function(){return Rx(i)&&o({inst:i}),e(function(){Rx(i)&&o({inst:i})})},[e]),vZ(n),n}function Rx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!TZ(e,n)}catch{return!0}}function AZ(e,t){return t()}var NZ=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?AZ:CZ;K6.useSyncExternalStore=Yu.useSyncExternalStore!==void 0?Yu.useSyncExternalStore:NZ});var Kg=Ht((S_e,$6)=>{"use strict";$6.exports=Y6()});var m5=Ht(h5=>{"use strict";var L0=fe(),$re=Kg();function Wre(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jre=typeof Object.is=="function"?Object.is:Wre,Xre=$re.useSyncExternalStore,Qre=L0.useRef,Zre=L0.useEffect,Jre=L0.useMemo,eie=L0.useDebugValue;h5.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Qre(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Jre(function(){function l(p){if(!u){if(u=!0,c=p,p=r(p),i!==void 0&&s.hasValue){var h=s.value;if(i(h,p))return f=h}return f=p}if(h=f,jre(c,p))return h;var g=r(p);return i!==void 0&&i(h,g)?(c=p,h):(c=p,f=g)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return l(t())},d===null?void 0:function(){return l(d())}]},[t,n,r,i]);var a=Xre(e,o[0],o[1]);return Zre(function(){s.hasValue=!0,s.value=a},[a]),eie(a),a}});var b5=Ht((DCe,g5)=>{"use strict";g5.exports=m5()});var E8=G(Ch(),1),Sv=G(fe(),1);var ut=G(fe(),1);var gn=G(fe(),1);function Yr(){let e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,n=>n.toString(16).padStart(2,"0"));return`${t[0]}${t[1]}${t[2]}${t[3]}-${t[4]}${t[5]}-${t[6]}${t[7]}-${t[8]}${t[9]}-${t[10]}${t[11]}${t[12]}${t[13]}${t[14]}${t[15]}`}var mR=String.raw` {0,3}((\`|~)\2{2,}).*`,_F=new RegExp(`^${mR} +[\\s\\S]*?^ {0,3}\\1\\2*[ ]*$`,"gm"),vF=new RegExp(`^${mR}$`,"gm");function Ah(e,t=!1){let n=[];for(let i of e.matchAll(_F))n.push([i.index,i.index+i[0].length]);if(t){let i=o=>n.some(([s,a])=>o>=s&&o[i.index,i[0].length]);for(let i=0;in.some(([o,s])=>i>=o&&i").replace(/&#(\d+);/g,(t,n)=>gR(t,parseInt(n,10))).replace(/&#[xX]([0-9a-fA-F]+);/g,(t,n)=>gR(t,parseInt(n,16))).replace(/&/g,"&"):e}function gR(e,t){return!Number.isFinite(t)||t<0||t>1114111||t>=55296&&t<=57343?e:String.fromCodePoint(t)}function wF(e,t){let n=null;for(let r=t;r")return r}return-1}function RF(e){let t={};BE.lastIndex=0;let n;for(;(n=BE.exec(e))!==null;){if(n[0]===""){BE.lastIndex++;continue}if(n[1]===void 0)continue;let r=n[2]??n[3]??n[4]??"";t[n[1].toLowerCase()]=NF(r)}return t}function ru(e){return e===!0||e===""||e==="true"}function Nh(e,t){return t in e&&ru(e[t])}function yi(e,t){let n=e[t];return n||void 0}function kF(e){let t=e.grouping;return t==="none"||t==="tool"||t==="all"?t:void 0}function MF(e,t,n=!1){let r=[],i=t==="markdown"?Ah(e,n):()=>!1;PE.lastIndex=0;let o;for(;(o=PE.exec(e))!==null;){if(i(o.index))continue;let s=o[1],a=o.index+o[0].length,l=wF(e,a);if(l===-1)break;let u=``,c=e.indexOf(u,l+1);if(c===-1)break;let f=c+u.length;r.push({tag:s,attrs:RF(e.slice(a,l)),start:o.index,end:f}),PE.lastIndex=f}return r}function OF(e){let{attrs:t}=e,n=kF(t),r={requestId:t["request-id"]??"",toolName:t["tool-name"]??"",...n!==void 0?{grouping:n}:{},...t.intent!==void 0?{intent:t.intent}:{},start:e.start,end:e.end};return e.tag==="request"?{kind:"request",...r,...yi(t,"tool-title")!==void 0?{definitionTitle:yi(t,"tool-title")}:{},...yi(t,"icon")!==void 0?{definitionIcon:yi(t,"icon")}:{},...t.arguments!==void 0?{arguments:t.arguments}:{}}:{kind:"result",...r,...yi(t,"tool-title")!==void 0?{title:yi(t,"tool-title")}:{},...yi(t,"icon")!==void 0?{icon:yi(t,"icon")}:{},status:t.status==="error"?"error":"success",...t.label!==void 0?{label:t.label}:{},...t["value-preview"]!==void 0?{valuePreview:t["value-preview"]}:{},...t.value!==void 0?{value:t.value}:{},...yi(t,"value-type")!==void 0?{valueType:yi(t,"value-type")}:{},...t["request-call"]!==void 0?{requestCall:t["request-call"]}:{},showRequest:Nh(t,"show-request"),fullScreen:Nh(t,"full-screen"),expanded:Nh(t,"expanded"),customDisplay:Nh(t,"custom-display"),...t.footer!==void 0?{footer:t.footer}:{}}}function HE(e,t,n=!1){return MF(e,t,n).map(OF)}function DF(e,t,n){if(t.toolName&&(e.toolName=t.toolName),t.grouping!==void 0&&(e.grouping=t.grouping),t.intent!==void 0&&(e.intent=t.intent),t.kind==="request"){t.definitionTitle!==void 0&&(e.definitionTitle=t.definitionTitle),t.definitionIcon!==void 0&&(e.definitionIcon=t.definitionIcon),t.arguments!==void 0&&(e.arguments=t.arguments);return}t.title!==void 0&&(e.title=t.title),t.icon!==void 0&&(e.icon=t.icon),e.status=t.status,t.label!==void 0&&(e.label=t.label),t.valuePreview!==void 0&&(e.valuePreview=t.valuePreview),t.value!==void 0&&(e.value=t.value),t.valueType!==void 0&&(e.valueType=t.valueType),t.requestCall!==void 0&&(e.requestCall=t.requestCall),t.footer!==void 0&&(e.footer=t.footer),e.showRequest=t.showRequest,e.fullScreen=t.fullScreen,e.expanded=t.expanded,e.customDisplay=t.customDisplay,e.resolveIndex=t.start,e.resolveBlock=n}function IF(e,t,n){let r=[],i=new Map;return e.forEach((o,s)=>{let a=o.requestId,l=a||`__anon-${t}-${s}`,u=i.get(l);u||(u={requestId:a,localId:l,toolName:o.toolName,status:"running"},i.set(l,u),r.push(l)),DF(u,o,n)}),r.map(o=>i.get(o))}function yR(e){let t=e.find(i=>i.status!=="running"),n=e.find(i=>i.definitionTitle!==void 0)?.definitionTitle,r=t?.title??e.find(i=>i.title!==void 0)?.title;return e.length>1?n??r:r??n}function LF(e){let t=e.find(n=>n.definitionIcon!==void 0)?.definitionIcon;return e.length===1?e[0].icon??t:t}function PF(e){let t=[],n=new Map;for(let r of e){let i=n.get(r.toolName);i||(i=[],n.set(r.toolName,i),t.push(r.toolName)),i.push(r)}return t.map(r=>{let i=n.get(r);return{toolName:r,title:yR(i),count:i.length,settled:i.some(o=>o.status!=="running")}})}function iu(e){let t=e.find(n=>n.status!=="running");return{title:yR(e),titleSettled:t!==void 0,icon:LF(e),count:e.length,segments:PF(e)}}function ER(e,t){let n=new Map;if(t!=="none")for(let o of e)o.grouping&&!n.has(o.toolName)&&n.set(o.toolName,o.grouping);let r=[],i=new Map;return e.forEach(o=>{let s=n.get(o.toolName)??t,a=s==="none"?`none:${o.localId}`:s==="all"?"all":`tool:${o.toolName}`,l=i.get(a);l||(l=[],i.set(a,l),r.push(a)),l.push(o)}),r.map(o=>{let s=i.get(o),a=iu(s);return{key:o,toolName:s[0].toolName,title:a.title,titleSettled:a.titleSettled,icon:a.icon,count:a.count,calls:s,segments:a.segments}})}function BF(e,t,n,r,i,o){let s=IF(e,i,o);return{type:"tool_loop",content:t,contentType:n,grouping:r,groups:ER(s,r)}}function lo(e,t,n,r=!1){if(n==="user")return e;let i=[];return e.forEach((o,s)=>{if(o.type!=="content"||!UE(o.contentType)||!FE(o.content)){i.push(o);return}let a=HE(o.content,o.contentType,r);if(a.length===0){i.push(o);return}let l=o.contentType,u=0,c=-1,f=[],d=()=>{f.length!==0&&(i.push(BF(f,o.content.slice(c,u),l,t,`${s}:${c}`,s)),f=[],c=-1)};for(let h of a){let g=o.content.slice(u,h.start);g.trim()!==""&&(d(),i.push({type:"content",content:g,contentType:l})),f.length===0&&(c=h.start),f.push(h),u=h.end}d();let p=o.content.slice(u);p.trim()!==""&&i.push({type:"content",content:p,contentType:l})}),UF(i,t)}function UF(e,t){let n=[];for(let r of e){let i=n[n.length-1];if(r.type==="tool_loop"&&i?.type==="tool_loop"&&i.contentType===r.contentType){let o=[...i.groups.flatMap(l=>l.calls)],s=i.content+r.content,a=o.concat(r.groups.flatMap(l=>l.calls));n[n.length-1]={type:"tool_loop",content:s,contentType:i.contentType,grouping:t,groups:ER(a,t)}}else n.push(r)}return n}function zE(e,t){let n=new Set;for(let r of e)bR(r,n);return t&&bR(t,n),n}function bR(e,t){if(e.role==="user")return;let n=e.streaming===!0||e.insideFence===!0;for(let r of e.blocks){if(r.type==="tool_loop"){for(let i of r.groups)for(let o of i.calls)o.status!=="running"&&o.requestId&&t.add(o.requestId);continue}if(!(r.type!=="content"||!UE(r.contentType)||!FE(r.content)))for(let i of HE(r.content,r.contentType,n))i.kind==="result"&&i.requestId&&t.add(i.requestId)}}var uo={messages:[],streamingMessage:null,greeting:null,inputDisabled:!1,inputPlaceholder:"Enter a message...",cancelRequested:!1,enableCancel:!1,enableCancelExplicit:!1,enableUpload:!1,enableUploadExplicit:!1,toolGrouping:"tool",slashCommands:[],history:{enabled:!1,conversations:[],activeId:null}};function TR(e,t="tool"){let n=[];for(let s of e.segments)n.push(...Mh(s.content,s.content_type));let r=lo(n,t,e.role),i=e.attachments??[],o=pf(r);return{id:e.id??Yr(),role:e.role,content:o,streaming:!1,icon:e.icon,...i.length>0?{attachments:i}:{},blocks:r,siblings:e.siblings}}function wh(e){return e.filter(t=>!t.isPlaceholder)}function df(e,t){return t?[...e??[],...t]:e}function Rh(e){return e?.options.persistent!==!0&&e?.status==="visible"?{...e,status:"dismissing"}:e}function SR(e,t,n){return e?.status==="dismissed"||!t&&n?"dismissed":"visible"}var GE=/\n?([\s\S]*?)\n?<\/thinking>\n*/g;function Mh(e,t){if(t==="thinking")return[{type:"thinking",content:e,streaming:!1}];if(t!=="markdown")return[{type:"content",content:e,contentType:t}];let n=Ah(e),r=[],i=0;for(let s of e.matchAll(GE)){if(n(s.index))continue;let a=e.slice(i,s.index);a&&r.push({type:"content",content:a,contentType:t});let l=s[1]??"",{cleaned:u,topic:c}=FF(l);r.push({type:"thinking",content:u,streaming:!1,...c!==null?{topic:c}:{}}),i=s.index+s[0].length}let o=e.slice(i);return o&&r.push({type:"content",content:o,contentType:t}),r}function pf(e){return e.filter(t=>t.type==="content").map(t=>t.content).join("")}function FF(e){let t=null;return{cleaned:e.replace(AR,(r,i)=>(t=i,`
${i}
`)),topic:t}}var xR=` `,qE="",_R=` -`,VE="",FF=/^(`{3,}|~{3,})[^\n]*(\n|$)/m;function HF(e){let t=e[0];return new RegExp(`^${t}{${e.length},}[ \\t]*(?:\\n|$)`,"m")}function zF(e){if(e.length===0)return!0;let t=e[e.length-1];return t.type==="thinking"?!0:t.content===""||t.content.endsWith(` -`)}function qF(e,t,n){let r=t.tagBuffer+e,i=t.insideThinkingTag?"thinking":t.insideFence?"fence":"outside",o=t.fenceMarker,s=t.tagBuffer?!0:n,a=[],l="";for(;r.length>0;)if(i==="outside"){let u=FF.exec(r),c=u!==null&&(u.index>0||s),f=r.indexOf(xR),d=f===-1?r.indexOf(qE):-1,p=f!==-1?f:d,h=f!==-1?xR:qE;if(c&&(p===-1||u.index`,VE="
",HF=/^(`{3,}|~{3,})[^\n]*(\n|$)/m;function zF(e){let t=e[0];return new RegExp(`^${t}{${e.length},}[ \\t]*(?:\\n|$)`,"m")}function qF(e){if(e.length===0)return!0;let t=e[e.length-1];return t.type==="thinking"?!0:t.content===""||t.content.endsWith(` +`)}function VF(e,t,n){let r=t.tagBuffer+e,i=t.insideThinkingTag?"thinking":t.insideFence?"fence":"outside",o=t.fenceMarker,s=t.tagBuffer?!0:n,a=[],l="";for(;r.length>0;)if(i==="outside"){let u=HF.exec(r),c=u!==null&&(u.index>0||s),f=r.indexOf(xR),d=f===-1?r.indexOf(qE):-1,p=f!==-1?f:d,h=f!==-1?xR:qE;if(c&&(p===-1||u.index0&&b.trim()===""&&(b.includes(` `)||s)?(l=r.slice(r.length-y),b&&a.push({type:"content",text:b}),r=""):(a.push({type:"content",text:r}),s=r.endsWith(` -`),r="")}}else if(i==="fence"){let c=HF(o).exec(r);if(c!==null){let f=r.slice(0,c.index+c[0].length);f&&a.push({type:"content",text:f}),s=f.endsWith(` +`),r="")}}else if(i==="fence"){let c=zF(o).exec(r);if(c!==null){let f=r.slice(0,c.index+c[0].length);f&&a.push({type:"content",text:f}),s=f.endsWith(` `),i="outside",o="",r=r.slice(c.index+c[0].length)}else a.push({type:"content",text:r}),s=r.endsWith(` `),r=""}else{let u=r.indexOf(_R),c=u===-1?r.indexOf(VE):-1,f=u!==-1?u:c,d=u!==-1?_R:VE;if(f!==-1){let p=r.slice(0,f);p&&a.push({type:"thinking",text:p}),i="outside",s=!0,r=r.slice(f+d.length),r.startsWith(` `)&&(r=r.slice(1)),r.startsWith(` -`)&&(r=r.slice(1))}else{let p=vR(r,VE);if(p>0){l=r.slice(r.length-p);let h=r.slice(0,r.length-p);h&&a.push({type:"thinking",text:h}),r=""}else a.push({type:"thinking",text:r}),r=""}}return{segments:a,state:{insideThinkingTag:i==="thinking",tagBuffer:l,insideFence:i==="fence",fenceMarker:o}}}function vR(e,t){for(let n=Math.min(t.length-1,e.length);n>0;n--)if(e.endsWith(t.slice(0,n)))return n;return 0}var AR=/(.*?)<\/topic>/g,VF=/<(?:t(?:o(?:p(?:i(?:c(?:>[^<]*)?)?)?)?)?)?\s*$/,GF=/<(?:\/(?:t(?:o(?:p(?:i(?:c(?:>)?)?)?)?)?)?)?\s*$/;function kh(e,t){let n=t+e,r=null;n=n.replace(AR,(l,u)=>(r=u,` +`)&&(r=r.slice(1))}else{let p=vR(r,VE);if(p>0){l=r.slice(r.length-p);let h=r.slice(0,r.length-p);h&&a.push({type:"thinking",text:h}),r=""}else a.push({type:"thinking",text:r}),r=""}}return{segments:a,state:{insideThinkingTag:i==="thinking",tagBuffer:l,insideFence:i==="fence",fenceMarker:o}}}function vR(e,t){for(let n=Math.min(t.length-1,e.length);n>0;n--)if(e.endsWith(t.slice(0,n)))return n;return 0}var AR=/(.*?)<\/topic>/g,GF=/<(?:t(?:o(?:p(?:i(?:c(?:>[^<]*)?)?)?)?)?)?\s*$/,KF=/<(?:\/(?:t(?:o(?:p(?:i(?:c(?:>)?)?)?)?)?)?)?\s*$/;function kh(e,t){let n=t+e,r=null;n=n.replace(AR,(l,u)=>(r=u,`
${u}
-`));let i="",o=VF.exec(n),s=GF.exec(n),a=o&&s?o.index>s.index?o:s:o||s;return a&&a[0]&&(i=a[0],n=n.slice(0,a.index)),{cleaned:n,topic:r,buffer:i}}function NR(e,t){switch(t.type){case"INPUT_SENT":{let n={id:Yr(),role:"user",content:t.content,streaming:!1,...t.attachments&&t.attachments.length>0?{attachments:t.attachments}:{},blocks:[{type:"content",content:t.content,contentType:"markdown"}]};if(t.awaitResponse===!1)return{...e,messages:[...e.messages,n],greeting:Rh(e.greeting)};let r={id:Yr(),role:"assistant",content:"",streaming:!1,isPlaceholder:!0,blocks:[]};return{...e,messages:[...e.messages,n,r],inputDisabled:!0,greeting:Rh(e.greeting)}}case"message":{let n=wh(e.messages),r=TR(t.message,e.toolGrouping);return t.html_deps&&(r.htmlDeps=t.html_deps),{...e,messages:[...n,r],streamingMessage:null,inputDisabled:!1,greeting:Rh(e.greeting)}}case"chunk_start":{let n=wh(e.messages),r=TR(t.message,e.toolGrouping);return r.streaming=!0,r.blocks=r.blocks.map(i=>i.type==="thinking"?{...i,streaming:!0}:i),t.html_deps&&(r.htmlDeps=t.html_deps),{...e,messages:n,streamingMessage:r,inputDisabled:!0,greeting:Rh(e.greeting)}}case"chunk":{let n=e.streamingMessage;if(!n||!n.streaming)return e;let r=t.content_type,i=n.blocks[n.blocks.length-1],o=(i?.type==="content"?i.contentType:void 0)??"markdown";if(r==="thinking"){let u=[...n.blocks],c=i?.type==="thinking"&&i.streaming?i:null;if(c){let{cleaned:f,topic:d,buffer:p}=kh(t.content,c.topicBuffer??"");u[u.length-1]={...c,content:c.content+f,topicBuffer:p,...d!==null?{topic:d}:{}}}else{let{cleaned:f,topic:d,buffer:p}=kh(t.content,"");u.push({type:"thinking",content:f,topicBuffer:p,streaming:!0,startedAt:Date.now(),...d!==null?{topic:d}:{}})}return{...e,streamingMessage:{...n,blocks:u,htmlDeps:df(n.htmlDeps,t.html_deps)}}}let s=r??o;if(n.insideThinkingTag||n.tagBuffer||n.insideFence||t.content.includes("<")||t.content.includes("```")||t.content.includes("~~~")){let u={insideThinkingTag:n.insideThinkingTag??!1,tagBuffer:n.tagBuffer??"",insideFence:n.insideFence??!1,fenceMarker:n.fenceMarker??""},{segments:c,state:f}=qF(t.content,u,zF(n.blocks)),d=!!(n.insideThinkingTag||n.tagBuffer||n.insideFence),p=c.some(y=>y.type==="thinking"),h=f.insideThinkingTag,g=f.insideFence!==(n.insideFence??!1);if(d||p||h||g){let y=[...n.blocks];for(let E of c)if(E.type==="thinking"){let T=y[y.length-1];if(T?.type==="thinking"&&T.streaming){let{cleaned:S,topic:v,buffer:x}=kh(E.text,T.topicBuffer??"");y[y.length-1]={...T,content:T.content+S,topicBuffer:x,...v!==null?{topic:v}:{}}}else{let{cleaned:S,topic:v,buffer:x}=kh(E.text,"");y.push({type:"thinking",content:S,topicBuffer:x,streaming:!0,startedAt:Date.now(),...v!==null?{topic:v}:{}})}}else{let T=y[y.length-1];T?.type==="thinking"&&T.streaming&&(y[y.length-1]={...T,content:T.content+(T.topicBuffer??""),topicBuffer:"",streaming:!1,durationMs:T.startedAt?Date.now()-T.startedAt:void 0});let S=y[y.length-1];S?.type==="content"&&S.contentType===s?y[y.length-1]={...S,content:S.content+E.text}:E.text&&y.push({type:"content",content:E.text,contentType:s})}let b=y.filter(E=>E.type==="content").map(E=>E.content).join("");return{...e,streamingMessage:{...n,content:b,blocks:y,insideThinkingTag:f.insideThinkingTag,tagBuffer:f.tagBuffer,insideFence:f.insideFence,fenceMarker:f.fenceMarker,htmlDeps:df(n.htmlDeps,t.html_deps)}}}if(f.tagBuffer)return{...e,streamingMessage:{...n,insideThinkingTag:f.insideThinkingTag,tagBuffer:f.tagBuffer,insideFence:f.insideFence,fenceMarker:f.fenceMarker,htmlDeps:df(n.htmlDeps,t.html_deps)}}}let a=[...n.blocks];if(i?.type==="thinking"&&i.streaming&&(a[a.length-1]={...i,content:i.content+(i.topicBuffer??""),topicBuffer:"",streaming:!1,durationMs:i.startedAt?Date.now()-i.startedAt:void 0}),t.operation==="replace"){let u=a.filter(c=>c.type==="thinking");return u.push({type:"content",content:t.content,contentType:s}),{...e,streamingMessage:{...n,content:t.content,blocks:u,htmlDeps:df(n.htmlDeps,t.html_deps)}}}else{let u=a[a.length-1];u?.type==="content"&&u.contentType===s?a[a.length-1]={...u,content:u.content+t.content}:a.push({type:"content",content:t.content,contentType:s})}let l=a.filter(u=>u.type==="content").map(u=>u.content).join("");return{...e,streamingMessage:{...n,content:l,blocks:a,insideThinkingTag:!1,tagBuffer:"",htmlDeps:df(n.htmlDeps,t.html_deps)}}}case"chunk_end":{let n=e.streamingMessage;if(!n||!n.streaming){if(e.cancelRequested){let o=wh(e.messages),s={id:Yr(),role:"assistant",content:"",streaming:!1,cancelled:!0,blocks:[]};return{...e,messages:[...o,s],streamingMessage:null,inputDisabled:!1,cancelRequested:!1}}return e}let r=CR(n,e.toolGrouping),i=e.cancelRequested?{...r,cancelled:!0}:r;return{...e,messages:[...e.messages,i],streamingMessage:null,inputDisabled:!1,cancelRequested:!1}}case"CANCEL_REQUESTED":return{...e,cancelRequested:!0};case"update_cancel":return e.enableCancelExplicit?e:{...e,enableCancel:t.enable_cancel};case"update_upload":return e.enableUploadExplicit?e:{...e,enableUpload:t.enable_upload};case"SET_TOOL_GROUPING":return t.grouping===e.toolGrouping?e:{...e,toolGrouping:t.grouping,messages:e.messages.map(n=>YF(n,t.grouping))};case"clear":{let n=t.greeting?null:e.greeting?{...e.greeting,status:"visible"}:null;return{...uo,inputPlaceholder:e.inputPlaceholder,greeting:n,enableCancel:e.enableCancel,enableCancelExplicit:e.enableCancelExplicit,slashCommands:e.slashCommands,enableUpload:e.enableUpload,enableUploadExplicit:e.enableUploadExplicit,toolGrouping:e.toolGrouping,history:e.history}}case"update_input":return{...e,inputPlaceholder:t.placeholder??e.inputPlaceholder};case"remove_loading":{let n=wh(e.messages);if(e.streamingMessage){let r=CR(e.streamingMessage,e.toolGrouping),i=e.cancelRequested?{...r,cancelled:!0}:r;n.push(i)}return{...e,messages:n,streamingMessage:null,inputDisabled:!1,cancelRequested:!1}}case"greeting":{let n=t.options.persistent===!0,r=SR(e.greeting,n,e.messages.length>0);return{...e,greeting:{content:t.content,contentType:t.content_type,streaming:!1,status:r,options:t.options,blocks:[{type:"content",content:t.content,contentType:t.content_type}]}}}case"greeting_start":{let n=t.options.persistent===!0,r=SR(e.greeting,n,e.messages.length>0);return{...e,greeting:{content:t.content,contentType:t.content_type,streaming:!0,status:r,options:t.options,blocks:t.content?[{type:"content",content:t.content,contentType:t.content_type}]:[]}}}case"greeting_dismissed":{let n=e.greeting;return!n||n.status!=="dismissing"?e:{...e,greeting:{...n,status:"dismissed"}}}case"greeting_chunk":{let n=e.greeting;if(!n||!n.streaming)return e;let r=t.content_type??n.contentType,i;if(t.operation==="replace")i=[{type:"content",content:t.content,contentType:r}];else{let s=[...n.blocks],a=s[s.length-1];a&&a.contentType===r?(s[s.length-1]={...a,content:a.content+t.content},i=s):i=[...s,{type:"content",content:t.content,contentType:r}]}let o=i.map(s=>s.content).join("");return{...e,greeting:{...n,content:o,contentType:r,blocks:i}}}case"greeting_end":{let n=e.greeting;return n?.streaming?n.content?{...e,greeting:{...n,streaming:!1}}:{...e,greeting:null}:e}case"greeting_clear":return{...e,greeting:null};case"update_slash_commands":return{...e,slashCommands:t.commands};case"history_update":return{...e,history:{enabled:t.enabled,conversations:t.conversations,activeId:t.active_id}};case"history_navigate":return e;case"update_siblings":{let n=e.messages.map((r,i)=>{let o=t.data[i];return o?{...r,siblings:o}:r.siblings?{...r,siblings:void 0}:r});return{...e,messages:n}}default:{let n=t;return e}}}function KF(e){return e.type==="thinking"?{content:e.content,content_type:"thinking"}:{content:e.content,content_type:e.contentType}}function KE(e){return e.messages.filter(t=>!t.isPlaceholder&&!t.streaming).map(t=>{let n={role:t.role,segments:t.blocks.map(KF)};return t.attachments&&t.attachments.length>0&&(n.attachments=t.attachments),t.htmlDeps&&t.htmlDeps.length>0&&(n.htmlDeps=t.htmlDeps),n})}function YF(e,t){if(!e.blocks.some(i=>i.type==="tool_loop"))return e;let n=e.blocks.map(i=>i.type==="tool_loop"?{type:"content",content:i.content,contentType:i.contentType}:i),r=lo(n,t,e.role,e.insideFence??!1);return{...e,blocks:r,content:pf(r)}}function CR(e,t="tool"){let n=[];for(let o of e.blocks)o.type==="thinking"&&o.streaming?n.push({...o,content:o.content+(o.topicBuffer??""),topicBuffer:"",streaming:!1,durationMs:o.startedAt?Date.now()-o.startedAt:void 0}):o.type==="content"&&GE.test(o.content)?(GE.lastIndex=0,n.push(...Mh(o.content,o.contentType))):n.push(o);let r=lo(n,t,e.role,e.insideFence??!1),i=pf(r);return{...e,content:i,streaming:!1,blocks:r}}var ds=(0,gn.createContext)(null),YE=(0,gn.createContext)(null);function wR(){return(0,gn.useContext)(YE)}var $F={supersededRequests:new Set},$E=(0,gn.createContext)($F),WE=(0,gn.createContext)(uo.toolGrouping);function RR(){return(0,gn.useContext)(WE)}var hf=(0,gn.createContext)(null),jE=(0,gn.createContext)(null),XE=(0,gn.createContext)([]),QE=(0,gn.createContext)(!0);function Oh(){return(0,gn.useContext)($E)}function Dh(){let e=(0,gn.useContext)(hf);if(!e)throw new Error("useChatDispatch must be used within a ChatDispatchContext.Provider");return e}function kR(){let e=(0,gn.useContext)(jE);if(e===null)throw new Error("useChatSubmit must be used within a ChatSubmitContext.Provider");return e}function ou(){return(0,gn.useContext)(QE)}function MR(){return(0,gn.useContext)(XE)}var ZE="shinychat-current",WF="shinychat_conversation_id";function OR(){try{return new URLSearchParams(window.location.search).get(WF)}catch{return null}}function DR(e){try{return localStorage.getItem(`${ZE}:${e}`)}catch{return null}}function JE(e,t){try{t===null?localStorage.removeItem(`${ZE}:${e}`):localStorage.setItem(`${ZE}:${e}`,t)}catch{}}function IR(e,t=!1){let n=e??window.location.pathname;if(t){window.location.assign(n);return}history.replaceState(null,"",n)}var Ih=G(fe(),1);function LR(e,t){let n=(0,Ih.useRef)(new Set);return(0,Ih.useMemo)(()=>{let r=zE(e,t),i=n.current;return r.size===i.size&&[...r].every(o=>i.has(o))?i:(n.current=r,r)},[e,t])}var nt=G(fe(),1),p8=G(qi(),1);var bn=G(fe(),1);var jF={damping:.7,stiffness:.05,mass:1.25},XF=70,QF=1e3/60,ZF=350,Lh=!1;globalThis.document?.addEventListener("mousedown",()=>{Lh=!0});globalThis.document?.addEventListener("mouseup",()=>{Lh=!1});globalThis.document?.addEventListener("click",()=>{Lh=!1});var Ph=(e={})=>{let[t,n]=(0,bn.useState)(!1),[r,i]=(0,bn.useState)(e.initial!==!1),[o,s]=(0,bn.useState)(!1),a=(0,bn.useRef)(null);a.current=e;let l=(0,bn.useCallback)(()=>{if(!Lh)return!1;let E=window.getSelection();if(!E||!E.rangeCount)return!1;let T=E.getRangeAt(0);return T.commonAncestorContainer.contains(y.current)||y.current?.contains(T.commonAncestorContainer)},[]),u=(0,bn.useCallback)(E=>{f.isAtBottom=E,i(E)},[]),c=(0,bn.useCallback)(E=>{f.escapedFromLock=E,n(E)},[]),f=(0,bn.useMemo)(()=>{let E;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return y.current?.scrollTop??0},set scrollTop(T){y.current&&(y.current.scrollTop=T,f.ignoreScrollToTop=y.current.scrollTop)},get targetScrollTop(){return!y.current||!b.current?0:y.current.scrollHeight-1-y.current.clientHeight},get calculatedTargetScrollTop(){if(!y.current||!b.current)return 0;let{targetScrollTop:T}=this;if(!e.targetScrollTop)return T;if(E?.targetScrollTop===T)return E.calculatedScrollTop;let S=Math.max(Math.min(e.targetScrollTop(T,{scrollElement:y.current,contentElement:b.current}),T),0);return E={targetScrollTop:T,calculatedScrollTop:S},requestAnimationFrame(()=>{E=void 0}),S},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=XF}}},[]),d=(0,bn.useCallback)((E={})=>{typeof E=="string"&&(E={animation:E}),E.preserveScrollPosition||u(!0);let T=Date.now()+(Number(E.wait)||0),S=t1(a.current,E.animation),{ignoreEscapes:v=!1}=E,x,R=f.calculatedTargetScrollTop;E.duration instanceof Promise?E.duration.finally(()=>{x=Date.now()}):x=T+(E.duration??0);let O=async()=>{let B=new Promise(requestAnimationFrame).then(()=>{if(!f.isAtBottom)return f.animation=void 0,!1;let{scrollTop:C}=f,V=performance.now(),Y=(V-(f.lastTick??V))/QF;if(f.animation||(f.animation={behavior:S,promise:B,ignoreEscapes:v}),f.animation.behavior===S&&(f.lastTick=V),l()||T>Date.now())return O();if(CDate.now()?(R=f.calculatedTargetScrollTop,O()):(f.animation=void 0,f.scrollTop(requestAnimationFrame(()=>{f.animation||(f.lastTick=void 0,f.velocity=0)}),C))};return E.wait!==!0&&(f.animation=void 0),f.animation?.behavior===S?f.animation.promise:O()},[u,l,f]),p=(0,bn.useCallback)(()=>{c(!0),u(!1)},[c,u]),h=(0,bn.useCallback)(({target:E})=>{if(E!==y.current)return;let{scrollTop:T,ignoreScrollToTop:S}=f,{lastScrollTop:v=T}=f;f.lastScrollTop=T,f.ignoreScrollToTop=void 0,S&&S>T&&(v=S),s(f.isNearBottom),setTimeout(()=>{if(f.resizeDifference||T===S)return;if(l()){c(!0),u(!1);return}let x=T>v,R=T{let S=E;for(;!["scroll","auto"].includes(getComputedStyle(S).overflow);){if(!S.parentElement)return;S=S.parentElement}S===y.current&&T<0&&y.current.scrollHeight>y.current.clientHeight&&!f.animation?.ignoreEscapes&&(c(!0),u(!1))},[c,u,f]),y=PR(E=>{y.current?.removeEventListener("scroll",h),y.current?.removeEventListener("wheel",g),E?.addEventListener("scroll",h,{passive:!0}),E?.addEventListener("wheel",g,{passive:!0})},[]),b=PR(E=>{if(f.resizeObserver?.disconnect(),!E)return;let T;f.resizeObserver=new ResizeObserver(([S])=>{let{height:v}=S.contentRect,x=v-(T??v);if(f.resizeDifference=x,f.scrollTop>f.targetScrollTop&&(f.scrollTop=f.targetScrollTop),s(f.isNearBottom),x>=0){let R=t1(a.current,T?a.current.resize:a.current.initial);d({animation:R,wait:!0,preserveScrollPosition:!0,duration:R==="instant"?void 0:ZF})}else f.isNearBottom&&(c(!1),u(!0));T=v,requestAnimationFrame(()=>{setTimeout(()=>{f.resizeDifference===x&&(f.resizeDifference=0)},1)})}),f.resizeObserver?.observe(E)},[]);return{contentRef:b,scrollRef:y,scrollToBottom:d,stopScroll:p,isAtBottom:r||o,isNearBottom:o,escapedFromLock:t,state:f}};function PR(e,t){let n=(0,bn.useCallback)(r=>(n.current=r,e(r)),t);return n}var e1=new Map;function t1(...e){let t={...jF},n=!1;for(let i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}let r=JSON.stringify(t);return e1.has(r)||e1.set(r,Object.freeze(t)),n?"instant":e1.get(r)}var ul=G(fe(),1);var tt=G(fe(),1);var yo=G(fe(),1);var Bh=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var co=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};co.prototype.normal={};co.prototype.property={};co.prototype.space=void 0;function n1(e,t){let n={},r={};for(let i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new co(n,r,t)}function fo(e){return e.toLowerCase()}var tn=class{constructor(t,n){this.attribute=n,this.property=t}};tn.prototype.attribute="";tn.prototype.booleanish=!1;tn.prototype.boolean=!1;tn.prototype.commaOrSpaceSeparated=!1;tn.prototype.commaSeparated=!1;tn.prototype.defined=!1;tn.prototype.mustUseProperty=!1;tn.prototype.number=!1;tn.prototype.overloadedBoolean=!1;tn.prototype.property="";tn.prototype.spaceSeparated=!1;tn.prototype.space=void 0;var mf={};Wd(mf,{boolean:()=>ke,booleanish:()=>Mt,commaOrSpaceSeparated:()=>ir,commaSeparated:()=>ps,number:()=>ee,overloadedBoolean:()=>Uh,spaceSeparated:()=>et});var JF=0,ke=ca(),Mt=ca(),Uh=ca(),ee=ca(),et=ca(),ps=ca(),ir=ca();function ca(){return 2**++JF}var r1=Object.keys(mf),fa=class extends tn{constructor(t,n,r,i){let o=-1;if(super(t,n),BR(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&tH.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(HR,rH);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!HR.test(o)){let s=o.replace(eH,nH);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=fa}return new i(r,t)}function nH(e){return"-"+e.toLowerCase()}function rH(e){return e.charAt(1).toUpperCase()}var ri=n1([i1,UR,o1,s1,a1],"html"),An=n1([i1,FR,o1,s1,a1],"svg");var zR={}.hasOwnProperty;function su(e,t){let n=t||{};function r(i,...o){let s=r.invalid,a=r.handlers;if(i&&zR.call(i,e)){let l=String(i[e]);s=zR.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var iH=/["&'<>`]/g,oH=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,sH=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,aH=/[|\\{}()[\]^$+*?.]/g,qR=new WeakMap;function VR(e,t){if(e=e.replace(t.subset?lH(t.subset):iH,r),t.subset||t.escapeOnly)return e;return e.replace(oH,n).replace(sH,r);function n(i,o,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function r(i,o,s){return t.format(i.charCodeAt(0),s.charCodeAt(o+1),t)}}function lH(e){let t=qR.get(e);return t||(t=uH(e),qR.set(e,t)),t}function uH(e){let t=[],n=-1;for(;++n",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"};var $R=["cent","copy","divide","gt","lt","not","para","times"];var WR={}.hasOwnProperty,u1={},qh;for(qh in zh)WR.call(zh,qh)&&(u1[zh[qh]]=qh);var dH=/[^\dA-Za-z]/;function jR(e,t,n,r){let i=String.fromCharCode(e);if(WR.call(u1,i)){let o=u1[i],s="&"+o;return n&&YR.includes(o)&&!$R.includes(o)&&(!r||t&&t!==61&&dH.test(String.fromCharCode(t)))?s:s+";"}return""}function XR(e,t,n){let r=GR(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=jR(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let o=KR(e,t,n.omitOptionalSemicolons);o.length|^->||--!>|"],mH=["<",">"];function QR(e,t,n,r){return r.settings.bogusComments?"":"";function i(o){return po(o,Object.assign({},r.settings.characterReferences,{subset:mH}))}}function ZR(e,t,n,r){return""}function au(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function c1(e){let t=[],n=String(e||""),r=n.indexOf(","),i=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);let s=n.slice(i,r).trim();(s||!o)&&t.push(s),i=r+1,r=n.indexOf(",",i)}return t}function lu(e,t){let n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function f1(e){let t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function uu(e){return e.join(" ").trim()}var gH=/[ \t\n\f\r]/g;function ho(e){return typeof e=="object"?e.type==="text"?JR(e.value):!1:JR(e)}function JR(e){return e.replace(gH,"")===""}var Lt=ek(1),d1=ek(-1),bH=[];function ek(e){return t;function t(n,r,i){let o=n?n.children:bH,s=(r||0)+e,a=o[s];if(!i)for(;a&&ho(a);)s+=e,a=o[s];return a}}var yH={}.hasOwnProperty;function Vh(e){return t;function t(n,r,i){return yH.call(e,n.tagName)&&e[n.tagName](n,r,i)}}var gf=Vh({body:TH,caption:p1,colgroup:p1,dd:vH,dt:_H,head:p1,html:EH,li:xH,optgroup:CH,option:AH,p:SH,rp:tk,rt:tk,tbody:wH,td:nk,tfoot:RH,th:nk,thead:NH,tr:kH});function p1(e,t,n){let r=Lt(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&ho(r.value.charAt(0)))}function EH(e,t,n){let r=Lt(n,t);return!r||r.type!=="comment"}function TH(e,t,n){let r=Lt(n,t);return!r||r.type!=="comment"}function SH(e,t,n){let r=Lt(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function xH(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&r.tagName==="li"}function _H(e,t,n){let r=Lt(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function vH(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function tk(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function CH(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function AH(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function NH(e,t,n){let r=Lt(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function wH(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function RH(e,t,n){return!Lt(n,t)}function kH(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function nk(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}var rk=Vh({body:DH,colgroup:IH,head:OH,html:MH,tbody:LH});function MH(e){let t=Lt(e,-1);return!t||t.type!=="comment"}function OH(e){let t=new Set;for(let r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}let n=e.children[0];return!n||n.type==="element"}function DH(e){let t=Lt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&ho(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function IH(e,t,n){let r=d1(n,t),i=Lt(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&gf(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function LH(e,t,n){let r=d1(n,t),i=Lt(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&gf(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}var Gh={name:[[` +`));let i="",o=GF.exec(n),s=KF.exec(n),a=o&&s?o.index>s.index?o:s:o||s;return a&&a[0]&&(i=a[0],n=n.slice(0,a.index)),{cleaned:n,topic:r,buffer:i}}function NR(e,t){switch(t.type){case"INPUT_SENT":{let n={id:Yr(),role:"user",content:t.content,streaming:!1,...t.attachments&&t.attachments.length>0?{attachments:t.attachments}:{},blocks:[{type:"content",content:t.content,contentType:"markdown"}]};if(t.awaitResponse===!1)return{...e,messages:[...e.messages,n],greeting:Rh(e.greeting)};let r={id:Yr(),role:"assistant",content:"",streaming:!1,isPlaceholder:!0,blocks:[]};return{...e,messages:[...e.messages,n,r],inputDisabled:!0,greeting:Rh(e.greeting)}}case"message":{let n=wh(e.messages),r=TR(t.message,e.toolGrouping);return t.html_deps&&(r.htmlDeps=t.html_deps),{...e,messages:[...n,r],streamingMessage:null,inputDisabled:!1,greeting:Rh(e.greeting)}}case"chunk_start":{let n=wh(e.messages),r=TR(t.message,e.toolGrouping);return r.streaming=!0,r.blocks=r.blocks.map(i=>i.type==="thinking"?{...i,streaming:!0}:i),t.html_deps&&(r.htmlDeps=t.html_deps),{...e,messages:n,streamingMessage:r,inputDisabled:!0,greeting:Rh(e.greeting)}}case"chunk":{let n=e.streamingMessage;if(!n||!n.streaming)return e;let r=t.content_type,i=n.blocks[n.blocks.length-1],o=(i?.type==="content"?i.contentType:void 0)??"markdown";if(r==="thinking"){let u=[...n.blocks],c=i?.type==="thinking"&&i.streaming?i:null;if(c){let{cleaned:f,topic:d,buffer:p}=kh(t.content,c.topicBuffer??"");u[u.length-1]={...c,content:c.content+f,topicBuffer:p,...d!==null?{topic:d}:{}}}else{let{cleaned:f,topic:d,buffer:p}=kh(t.content,"");u.push({type:"thinking",content:f,topicBuffer:p,streaming:!0,startedAt:Date.now(),...d!==null?{topic:d}:{}})}return{...e,streamingMessage:{...n,blocks:u,htmlDeps:df(n.htmlDeps,t.html_deps)}}}let s=r??o;if(n.insideThinkingTag||n.tagBuffer||n.insideFence||t.content.includes("<")||t.content.includes("```")||t.content.includes("~~~")){let u={insideThinkingTag:n.insideThinkingTag??!1,tagBuffer:n.tagBuffer??"",insideFence:n.insideFence??!1,fenceMarker:n.fenceMarker??""},{segments:c,state:f}=VF(t.content,u,qF(n.blocks)),d=!!(n.insideThinkingTag||n.tagBuffer||n.insideFence),p=c.some(y=>y.type==="thinking"),h=f.insideThinkingTag,g=f.insideFence!==(n.insideFence??!1);if(d||p||h||g){let y=[...n.blocks];for(let E of c)if(E.type==="thinking"){let T=y[y.length-1];if(T?.type==="thinking"&&T.streaming){let{cleaned:S,topic:v,buffer:x}=kh(E.text,T.topicBuffer??"");y[y.length-1]={...T,content:T.content+S,topicBuffer:x,...v!==null?{topic:v}:{}}}else{let{cleaned:S,topic:v,buffer:x}=kh(E.text,"");y.push({type:"thinking",content:S,topicBuffer:x,streaming:!0,startedAt:Date.now(),...v!==null?{topic:v}:{}})}}else{let T=y[y.length-1];T?.type==="thinking"&&T.streaming&&(y[y.length-1]={...T,content:T.content+(T.topicBuffer??""),topicBuffer:"",streaming:!1,durationMs:T.startedAt?Date.now()-T.startedAt:void 0});let S=y[y.length-1];S?.type==="content"&&S.contentType===s?y[y.length-1]={...S,content:S.content+E.text}:E.text&&y.push({type:"content",content:E.text,contentType:s})}let b=y.filter(E=>E.type==="content").map(E=>E.content).join("");return{...e,streamingMessage:{...n,content:b,blocks:y,insideThinkingTag:f.insideThinkingTag,tagBuffer:f.tagBuffer,insideFence:f.insideFence,fenceMarker:f.fenceMarker,htmlDeps:df(n.htmlDeps,t.html_deps)}}}if(f.tagBuffer)return{...e,streamingMessage:{...n,insideThinkingTag:f.insideThinkingTag,tagBuffer:f.tagBuffer,insideFence:f.insideFence,fenceMarker:f.fenceMarker,htmlDeps:df(n.htmlDeps,t.html_deps)}}}let a=[...n.blocks];if(i?.type==="thinking"&&i.streaming&&(a[a.length-1]={...i,content:i.content+(i.topicBuffer??""),topicBuffer:"",streaming:!1,durationMs:i.startedAt?Date.now()-i.startedAt:void 0}),t.operation==="replace"){let u=a.filter(c=>c.type==="thinking");return u.push({type:"content",content:t.content,contentType:s}),{...e,streamingMessage:{...n,content:t.content,blocks:u,htmlDeps:df(n.htmlDeps,t.html_deps)}}}else{let u=a[a.length-1];u?.type==="content"&&u.contentType===s?a[a.length-1]={...u,content:u.content+t.content}:a.push({type:"content",content:t.content,contentType:s})}let l=a.filter(u=>u.type==="content").map(u=>u.content).join("");return{...e,streamingMessage:{...n,content:l,blocks:a,insideThinkingTag:!1,tagBuffer:"",htmlDeps:df(n.htmlDeps,t.html_deps)}}}case"chunk_end":{let n=e.streamingMessage;if(!n||!n.streaming){if(e.cancelRequested){let o=wh(e.messages),s={id:Yr(),role:"assistant",content:"",streaming:!1,cancelled:!0,blocks:[]};return{...e,messages:[...o,s],streamingMessage:null,inputDisabled:!1,cancelRequested:!1}}return e}let r=CR(n,e.toolGrouping),i=e.cancelRequested?{...r,cancelled:!0}:r;return{...e,messages:[...e.messages,i],streamingMessage:null,inputDisabled:!1,cancelRequested:!1}}case"CANCEL_REQUESTED":return{...e,cancelRequested:!0};case"update_cancel":return e.enableCancelExplicit?e:{...e,enableCancel:t.enable_cancel};case"update_upload":return e.enableUploadExplicit?e:{...e,enableUpload:t.enable_upload};case"SET_TOOL_GROUPING":return t.grouping===e.toolGrouping?e:{...e,toolGrouping:t.grouping,messages:e.messages.map(n=>$F(n,t.grouping))};case"clear":{let n=t.greeting?null:e.greeting?{...e.greeting,status:"visible"}:null;return{...uo,inputPlaceholder:e.inputPlaceholder,greeting:n,enableCancel:e.enableCancel,enableCancelExplicit:e.enableCancelExplicit,slashCommands:e.slashCommands,enableUpload:e.enableUpload,enableUploadExplicit:e.enableUploadExplicit,toolGrouping:e.toolGrouping,history:e.history}}case"update_input":return{...e,inputPlaceholder:t.placeholder??e.inputPlaceholder};case"remove_loading":{let n=wh(e.messages);if(e.streamingMessage){let r=CR(e.streamingMessage,e.toolGrouping),i=e.cancelRequested?{...r,cancelled:!0}:r;n.push(i)}return{...e,messages:n,streamingMessage:null,inputDisabled:!1,cancelRequested:!1}}case"greeting":{let n=t.options.persistent===!0,r=SR(e.greeting,n,e.messages.length>0);return{...e,greeting:{content:t.content,contentType:t.content_type,streaming:!1,status:r,options:t.options,blocks:[{type:"content",content:t.content,contentType:t.content_type}]}}}case"greeting_start":{let n=t.options.persistent===!0,r=SR(e.greeting,n,e.messages.length>0);return{...e,greeting:{content:t.content,contentType:t.content_type,streaming:!0,status:r,options:t.options,blocks:t.content?[{type:"content",content:t.content,contentType:t.content_type}]:[]}}}case"greeting_dismissed":{let n=e.greeting;return!n||n.status!=="dismissing"?e:{...e,greeting:{...n,status:"dismissed"}}}case"greeting_chunk":{let n=e.greeting;if(!n||!n.streaming)return e;let r=t.content_type??n.contentType,i;if(t.operation==="replace")i=[{type:"content",content:t.content,contentType:r}];else{let s=[...n.blocks],a=s[s.length-1];a&&a.contentType===r?(s[s.length-1]={...a,content:a.content+t.content},i=s):i=[...s,{type:"content",content:t.content,contentType:r}]}let o=i.map(s=>s.content).join("");return{...e,greeting:{...n,content:o,contentType:r,blocks:i}}}case"greeting_end":{let n=e.greeting;return n?.streaming?n.content?{...e,greeting:{...n,streaming:!1}}:{...e,greeting:null}:e}case"greeting_clear":return{...e,greeting:null};case"update_slash_commands":return{...e,slashCommands:t.commands};case"history_update":return{...e,history:{enabled:t.enabled,conversations:t.conversations,activeId:t.active_id}};case"history_navigate":return e;case"update_siblings":{let n=e.messages.map((r,i)=>{let o=t.data[i];return o?{...r,siblings:o}:r.siblings?{...r,siblings:void 0}:r});return{...e,messages:n}}default:{let n=t;return e}}}function YF(e){return e.type==="thinking"?{content:e.content,content_type:"thinking"}:{content:e.content,content_type:e.contentType}}function KE(e){return e.messages.filter(t=>!t.isPlaceholder&&!t.streaming).map(t=>{let n={role:t.role,segments:t.blocks.map(YF)};return t.attachments&&t.attachments.length>0&&(n.attachments=t.attachments),t.htmlDeps&&t.htmlDeps.length>0&&(n.htmlDeps=t.htmlDeps),n})}function $F(e,t){if(!e.blocks.some(i=>i.type==="tool_loop"))return e;let n=e.blocks.map(i=>i.type==="tool_loop"?{type:"content",content:i.content,contentType:i.contentType}:i),r=lo(n,t,e.role,e.insideFence??!1);return{...e,blocks:r,content:pf(r)}}function CR(e,t="tool"){let n=[];for(let o of e.blocks)o.type==="thinking"&&o.streaming?n.push({...o,content:o.content+(o.topicBuffer??""),topicBuffer:"",streaming:!1,durationMs:o.startedAt?Date.now()-o.startedAt:void 0}):o.type==="content"&&GE.test(o.content)?(GE.lastIndex=0,n.push(...Mh(o.content,o.contentType))):n.push(o);let r=lo(n,t,e.role,e.insideFence??!1),i=pf(r);return{...e,content:i,streaming:!1,blocks:r}}var ds=(0,gn.createContext)(null),YE=(0,gn.createContext)(null);function wR(){return(0,gn.useContext)(YE)}var WF={supersededRequests:new Set},$E=(0,gn.createContext)(WF),WE=(0,gn.createContext)(uo.toolGrouping);function RR(){return(0,gn.useContext)(WE)}var hf=(0,gn.createContext)(null),jE=(0,gn.createContext)(null),XE=(0,gn.createContext)([]),QE=(0,gn.createContext)(!0);function Oh(){return(0,gn.useContext)($E)}function Dh(){let e=(0,gn.useContext)(hf);if(!e)throw new Error("useChatDispatch must be used within a ChatDispatchContext.Provider");return e}function kR(){let e=(0,gn.useContext)(jE);if(e===null)throw new Error("useChatSubmit must be used within a ChatSubmitContext.Provider");return e}function ou(){return(0,gn.useContext)(QE)}function MR(){return(0,gn.useContext)(XE)}var ZE="shinychat-current",jF="shinychat_conversation_id";function OR(){try{return new URLSearchParams(window.location.search).get(jF)}catch{return null}}function DR(e){try{return localStorage.getItem(`${ZE}:${e}`)}catch{return null}}function JE(e,t){try{t===null?localStorage.removeItem(`${ZE}:${e}`):localStorage.setItem(`${ZE}:${e}`,t)}catch{}}function IR(e,t=!1){let n=e??window.location.pathname;if(t){window.location.assign(n);return}history.replaceState(null,"",n)}var Ih=G(fe(),1);function LR(e,t){let n=(0,Ih.useRef)(new Set);return(0,Ih.useMemo)(()=>{let r=zE(e,t),i=n.current;return r.size===i.size&&[...r].every(o=>i.has(o))?i:(n.current=r,r)},[e,t])}var nt=G(fe(),1),h8=G(qi(),1);var bn=G(fe(),1);var XF={damping:.7,stiffness:.05,mass:1.25},QF=70,ZF=1e3/60,JF=350,Lh=!1;globalThis.document?.addEventListener("mousedown",()=>{Lh=!0});globalThis.document?.addEventListener("mouseup",()=>{Lh=!1});globalThis.document?.addEventListener("click",()=>{Lh=!1});var Ph=(e={})=>{let[t,n]=(0,bn.useState)(!1),[r,i]=(0,bn.useState)(e.initial!==!1),[o,s]=(0,bn.useState)(!1),a=(0,bn.useRef)(null);a.current=e;let l=(0,bn.useCallback)(()=>{if(!Lh)return!1;let E=window.getSelection();if(!E||!E.rangeCount)return!1;let T=E.getRangeAt(0);return T.commonAncestorContainer.contains(y.current)||y.current?.contains(T.commonAncestorContainer)},[]),u=(0,bn.useCallback)(E=>{f.isAtBottom=E,i(E)},[]),c=(0,bn.useCallback)(E=>{f.escapedFromLock=E,n(E)},[]),f=(0,bn.useMemo)(()=>{let E;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return y.current?.scrollTop??0},set scrollTop(T){y.current&&(y.current.scrollTop=T,f.ignoreScrollToTop=y.current.scrollTop)},get targetScrollTop(){return!y.current||!b.current?0:y.current.scrollHeight-1-y.current.clientHeight},get calculatedTargetScrollTop(){if(!y.current||!b.current)return 0;let{targetScrollTop:T}=this;if(!e.targetScrollTop)return T;if(E?.targetScrollTop===T)return E.calculatedScrollTop;let S=Math.max(Math.min(e.targetScrollTop(T,{scrollElement:y.current,contentElement:b.current}),T),0);return E={targetScrollTop:T,calculatedScrollTop:S},requestAnimationFrame(()=>{E=void 0}),S},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=QF}}},[]),d=(0,bn.useCallback)((E={})=>{typeof E=="string"&&(E={animation:E}),E.preserveScrollPosition||u(!0);let T=Date.now()+(Number(E.wait)||0),S=t1(a.current,E.animation),{ignoreEscapes:v=!1}=E,x,R=f.calculatedTargetScrollTop;E.duration instanceof Promise?E.duration.finally(()=>{x=Date.now()}):x=T+(E.duration??0);let O=async()=>{let B=new Promise(requestAnimationFrame).then(()=>{if(!f.isAtBottom)return f.animation=void 0,!1;let{scrollTop:C}=f,V=performance.now(),Y=(V-(f.lastTick??V))/ZF;if(f.animation||(f.animation={behavior:S,promise:B,ignoreEscapes:v}),f.animation.behavior===S&&(f.lastTick=V),l()||T>Date.now())return O();if(CDate.now()?(R=f.calculatedTargetScrollTop,O()):(f.animation=void 0,f.scrollTop(requestAnimationFrame(()=>{f.animation||(f.lastTick=void 0,f.velocity=0)}),C))};return E.wait!==!0&&(f.animation=void 0),f.animation?.behavior===S?f.animation.promise:O()},[u,l,f]),p=(0,bn.useCallback)(()=>{c(!0),u(!1)},[c,u]),h=(0,bn.useCallback)(({target:E})=>{if(E!==y.current)return;let{scrollTop:T,ignoreScrollToTop:S}=f,{lastScrollTop:v=T}=f;f.lastScrollTop=T,f.ignoreScrollToTop=void 0,S&&S>T&&(v=S),s(f.isNearBottom),setTimeout(()=>{if(f.resizeDifference||T===S)return;if(l()){c(!0),u(!1);return}let x=T>v,R=T{let S=E;for(;!["scroll","auto"].includes(getComputedStyle(S).overflow);){if(!S.parentElement)return;S=S.parentElement}S===y.current&&T<0&&y.current.scrollHeight>y.current.clientHeight&&!f.animation?.ignoreEscapes&&(c(!0),u(!1))},[c,u,f]),y=PR(E=>{y.current?.removeEventListener("scroll",h),y.current?.removeEventListener("wheel",g),E?.addEventListener("scroll",h,{passive:!0}),E?.addEventListener("wheel",g,{passive:!0})},[]),b=PR(E=>{if(f.resizeObserver?.disconnect(),!E)return;let T;f.resizeObserver=new ResizeObserver(([S])=>{let{height:v}=S.contentRect,x=v-(T??v);if(f.resizeDifference=x,f.scrollTop>f.targetScrollTop&&(f.scrollTop=f.targetScrollTop),s(f.isNearBottom),x>=0){let R=t1(a.current,T?a.current.resize:a.current.initial);d({animation:R,wait:!0,preserveScrollPosition:!0,duration:R==="instant"?void 0:JF})}else f.isNearBottom&&(c(!1),u(!0));T=v,requestAnimationFrame(()=>{setTimeout(()=>{f.resizeDifference===x&&(f.resizeDifference=0)},1)})}),f.resizeObserver?.observe(E)},[]);return{contentRef:b,scrollRef:y,scrollToBottom:d,stopScroll:p,isAtBottom:r||o,isNearBottom:o,escapedFromLock:t,state:f}};function PR(e,t){let n=(0,bn.useCallback)(r=>(n.current=r,e(r)),t);return n}var e1=new Map;function t1(...e){let t={...XF},n=!1;for(let i of e){if(i==="instant"){n=!0;continue}typeof i=="object"&&(n=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}let r=JSON.stringify(t);return e1.has(r)||e1.set(r,Object.freeze(t)),n?"instant":e1.get(r)}var ul=G(fe(),1);var tt=G(fe(),1);var yo=G(fe(),1);var Bh=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var co=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};co.prototype.normal={};co.prototype.property={};co.prototype.space=void 0;function n1(e,t){let n={},r={};for(let i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new co(n,r,t)}function fo(e){return e.toLowerCase()}var tn=class{constructor(t,n){this.attribute=n,this.property=t}};tn.prototype.attribute="";tn.prototype.booleanish=!1;tn.prototype.boolean=!1;tn.prototype.commaOrSpaceSeparated=!1;tn.prototype.commaSeparated=!1;tn.prototype.defined=!1;tn.prototype.mustUseProperty=!1;tn.prototype.number=!1;tn.prototype.overloadedBoolean=!1;tn.prototype.property="";tn.prototype.spaceSeparated=!1;tn.prototype.space=void 0;var mf={};Wd(mf,{boolean:()=>ke,booleanish:()=>Mt,commaOrSpaceSeparated:()=>ir,commaSeparated:()=>ps,number:()=>ee,overloadedBoolean:()=>Uh,spaceSeparated:()=>et});var eH=0,ke=ca(),Mt=ca(),Uh=ca(),ee=ca(),et=ca(),ps=ca(),ir=ca();function ca(){return 2**++eH}var r1=Object.keys(mf),fa=class extends tn{constructor(t,n,r,i){let o=-1;if(super(t,n),BR(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&nH.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(HR,iH);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!HR.test(o)){let s=o.replace(tH,rH);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=fa}return new i(r,t)}function rH(e){return"-"+e.toLowerCase()}function iH(e){return e.charAt(1).toUpperCase()}var ri=n1([i1,UR,o1,s1,a1],"html"),An=n1([i1,FR,o1,s1,a1],"svg");var zR={}.hasOwnProperty;function su(e,t){let n=t||{};function r(i,...o){let s=r.invalid,a=r.handlers;if(i&&zR.call(i,e)){let l=String(i[e]);s=zR.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var oH=/["&'<>`]/g,sH=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,aH=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,lH=/[|\\{}()[\]^$+*?.]/g,qR=new WeakMap;function VR(e,t){if(e=e.replace(t.subset?uH(t.subset):oH,r),t.subset||t.escapeOnly)return e;return e.replace(sH,n).replace(aH,r);function n(i,o,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function r(i,o,s){return t.format(i.charCodeAt(0),s.charCodeAt(o+1),t)}}function uH(e){let t=qR.get(e);return t||(t=cH(e),qR.set(e,t)),t}function cH(e){let t=[],n=-1;for(;++n",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"};var $R=["cent","copy","divide","gt","lt","not","para","times"];var WR={}.hasOwnProperty,u1={},qh;for(qh in zh)WR.call(zh,qh)&&(u1[zh[qh]]=qh);var pH=/[^\dA-Za-z]/;function jR(e,t,n,r){let i=String.fromCharCode(e);if(WR.call(u1,i)){let o=u1[i],s="&"+o;return n&&YR.includes(o)&&!$R.includes(o)&&(!r||t&&t!==61&&pH.test(String.fromCharCode(t)))?s:s+";"}return""}function XR(e,t,n){let r=GR(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=jR(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let o=KR(e,t,n.omitOptionalSemicolons);o.length|^->||--!>|"],gH=["<",">"];function QR(e,t,n,r){return r.settings.bogusComments?"":"";function i(o){return po(o,Object.assign({},r.settings.characterReferences,{subset:gH}))}}function ZR(e,t,n,r){return""}function au(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function c1(e){let t=[],n=String(e||""),r=n.indexOf(","),i=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);let s=n.slice(i,r).trim();(s||!o)&&t.push(s),i=r+1,r=n.indexOf(",",i)}return t}function lu(e,t){let n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function f1(e){let t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function uu(e){return e.join(" ").trim()}var bH=/[ \t\n\f\r]/g;function ho(e){return typeof e=="object"?e.type==="text"?JR(e.value):!1:JR(e)}function JR(e){return e.replace(bH,"")===""}var Lt=ek(1),d1=ek(-1),yH=[];function ek(e){return t;function t(n,r,i){let o=n?n.children:yH,s=(r||0)+e,a=o[s];if(!i)for(;a&&ho(a);)s+=e,a=o[s];return a}}var EH={}.hasOwnProperty;function Vh(e){return t;function t(n,r,i){return EH.call(e,n.tagName)&&e[n.tagName](n,r,i)}}var gf=Vh({body:SH,caption:p1,colgroup:p1,dd:CH,dt:vH,head:p1,html:TH,li:_H,optgroup:AH,option:NH,p:xH,rp:tk,rt:tk,tbody:RH,td:nk,tfoot:kH,th:nk,thead:wH,tr:MH});function p1(e,t,n){let r=Lt(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&ho(r.value.charAt(0)))}function TH(e,t,n){let r=Lt(n,t);return!r||r.type!=="comment"}function SH(e,t,n){let r=Lt(n,t);return!r||r.type!=="comment"}function xH(e,t,n){let r=Lt(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function _H(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&r.tagName==="li"}function vH(e,t,n){let r=Lt(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function CH(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function tk(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function AH(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function NH(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function wH(e,t,n){let r=Lt(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function RH(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function kH(e,t,n){return!Lt(n,t)}function MH(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function nk(e,t,n){let r=Lt(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}var rk=Vh({body:IH,colgroup:LH,head:DH,html:OH,tbody:PH});function OH(e){let t=Lt(e,-1);return!t||t.type!=="comment"}function DH(e){let t=new Set;for(let r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}let n=e.children[0];return!n||n.type==="element"}function IH(e){let t=Lt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&ho(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function LH(e,t,n){let r=d1(n,t),i=Lt(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&gf(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function PH(e,t,n){let r=d1(n,t),i=Lt(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&gf(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}var Gh={name:[[` \f\r &/=>`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 @@ -45,66 +45,66 @@ https://github.com/highlightjs/highlight.js/issues/2277`),_=I,U=P),D===void 0&&( \f\r &>`.split(""),`\0 \f\r "&'<=>\``.split("")],[`\0 \f\r "&'<=>\``.split(""),`\0 -\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function ik(e,t,n,r){let i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags,s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),a=[],l;i.space==="html"&&e.tagName==="svg"&&(r.schema=An);let u=PH(r,e.properties),c=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,c&&(s=!1),(u||!o||!rk(e,t,n))&&(a.push("<",e.tagName,u?" "+u:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!s&&(!o||!gf(e,t,n))&&a.push(""),a.join("")}function PH(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let o=BH(e,i,t[i]);o&&n.push(o)}}for(;++rau(n,e.alternative)&&(s=e.alternative),a=s+po(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Gh.single:Gh.double)[i][o],attribute:!0}))+s),l+(a&&"="+a))}var UH=["<","&"];function Kh(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:po(e.value,Object.assign({},r.settings.characterReferences,{subset:UH}))}function ok(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Kh(e,t,n,r)}function sk(e,t,n,r){return r.all(e)}var ak=su("type",{invalid:FH,unknown:HH,handlers:{comment:QR,doctype:ZR,element:ik,raw:ok,root:sk,text:Kh}});function FH(e){throw new Error("Expected node, not `"+e+"`")}function HH(e){let t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}var zH={},qH={},VH=[];function bf(e,t){let n=t||zH,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:GH,all:KH,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Bh,characterReferences:n.characterReferences||qH,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?An:ri,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function GH(e,t,n){return ak(e,t,n,this)}function KH(e){let t=[],n=e&&e.children||VH,r=-1;for(;++r0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Ef(e){let t=or(e),n=pa(e);if(t&&n)return{start:t,end:n}}function hs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Tk(e.position):"start"in e||"end"in e?Tk(e):"line"in e||"column"in e?g1(e):""}function g1(e){return Sk(e&&e.line)+":"+Sk(e&&e.column)}function Tk(e){return g1(e&&e.start)+"-"+g1(e&&e.end)}function Sk(e){return e&&typeof e=="number"?e:1}var Pt=class extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){let l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){let l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}let a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=hs(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Pt.prototype.file="";Pt.prototype.name="";Pt.prototype.reason="";Pt.prototype.message="";Pt.prototype.stack="";Pt.prototype.column=void 0;Pt.prototype.line=void 0;Pt.prototype.ancestors=void 0;Pt.prototype.cause=void 0;Pt.prototype.fatal=void 0;Pt.prototype.place=void 0;Pt.prototype.ruleId=void 0;Pt.prototype.source=void 0;var b1={}.hasOwnProperty,Tz=new Map,Sz=/[A-Z]/g,xz=new Set(["table","tbody","thead","tfoot","tr"]),_z=new Set(["td","th"]),_k="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function y1(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Mz(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=kz(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?An:ri,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=vk(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function vk(e,t,n){if(t.type==="element")return vz(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Cz(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Nz(e,t,n);if(t.type==="mdxjsEsm")return Az(e,t);if(t.type==="root")return wz(e,t,n);if(t.type==="text")return Rz(e,t)}function vz(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=An,e.schema=i),e.ancestors.push(t);let o=Ak(e,t.tagName,!1),s=Oz(e,t),a=T1(e,t);return xz.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!ho(l):!0})),Ck(e,s,o,t),E1(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Cz(e,t){if(t.data&&t.data.estree&&e.evaluater){let r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Tf(e,t.position)}function Az(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Tf(e,t.position)}function Nz(e,t,n){let r=e.schema,i=r;t.name==="svg"&&r.space==="html"&&(i=An,e.schema=i),e.ancestors.push(t);let o=t.name===null?e.Fragment:Ak(e,t.name,!0),s=Dz(e,t),a=T1(e,t);return Ck(e,s,o,t),E1(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function wz(e,t,n){let r={};return E1(r,T1(e,t)),e.create(t,e.Fragment,r,n)}function Rz(e,t){return t.value}function Ck(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function E1(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function kz(e,t,n){return r;function r(i,o,s,a){let u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function Mz(e,t){return n;function n(r,i,o,s){let a=Array.isArray(o.children),l=or(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Oz(e,t){let n={},r,i;for(i in t.properties)if(i!=="children"&&b1.call(t.properties,i)){let o=Iz(e,i,t.properties[i]);if(o){let[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&_z.has(t.tagName)?r=a:n[s]=a}}if(r){let o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Dz(e,t){let n={};for(let r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){let o=r.data.estree.body[0];o.type;let s=o.expression;s.type;let a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Tf(e,t.position);else{let i=r.name,o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){let a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Tf(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function T1(e,t){let n=[],r=-1,i=e.passKeys?new Map:Tz;for(;++r-1&&o<=t.length){let s=0;for(;;){let a=n[s];if(a===void 0){let l=kk(t,n[s-1]);a=l===-1?t.length+1:l+1,n[s]=a}if(a>o)return{line:s+1,column:o-(s>0?n[s-1]:0)+1,offset:o};s++}}}function i(o){if(o&&typeof o.line=="number"&&typeof o.column=="number"&&!Number.isNaN(o.line)&&!Number.isNaN(o.column)){for(;n.length1?n[o.line-2]:0)+o.column-1;if(s=55296&&e<=57343}function Bk(e){return e>=56320&&e<=57343}function Uk(e,t){return(e-55296)*1024+9216+t}function Qh(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Zh(e){return e>=64976&&e<=65007||Wz.has(e)}var K;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(K||(K={}));var Xz=65536,Jh=class{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Xz,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){let{line:r,col:i,offset:o}=this,s=i+n,a=o+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:a,endOffset:a}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){let n=this.html.charCodeAt(this.pos+1);if(Bk(n))return this.pos++,this._addGap(),Uk(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,N.EOF;return this._err(K.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,N.EOF;let r=this.html.charCodeAt(n);return r===N.CARRIAGE_RETURN?N.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,N.EOF;let t=this.html.charCodeAt(this.pos);return t===N.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,N.LINE_FEED):t===N.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Xh(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===N.LINE_FEED||t===N.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Qh(t)?this._err(K.controlCharacterInInputStream):Zh(t)&&this._err(K.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.posHe,getTokenAttr:()=>xf});var He;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(He||(He={}));function xf(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var em=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(e=>e.charCodeAt(0)));var w1,Qz=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Fk=(w1=String.fromCodePoint)!==null&&w1!==void 0?w1:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function R1(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Qz.get(e))!==null&&t!==void 0?t:e}var rn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(rn||(rn={}));var Jz=32,gs;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(gs||(gs={}));function k1(e){return e>=rn.ZERO&&e<=rn.NINE}function e7(e){return e>=rn.UPPER_A&&e<=rn.UPPER_F||e>=rn.LOWER_A&&e<=rn.LOWER_F}function t7(e){return e>=rn.UPPER_A&&e<=rn.UPPER_Z||e>=rn.LOWER_A&&e<=rn.LOWER_Z||k1(e)}function n7(e){return e===rn.EQUALS||t7(e)}var nn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(nn||(nn={}));var Ti;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ti||(Ti={}));var tm=class{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=nn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ti.Strict}startEntity(t){this.decodeMode=t,this.state=nn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case nn.EntityStart:return t.charCodeAt(n)===rn.NUM?(this.state=nn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=nn.NamedEntity,this.stateNamedEntity(t,n));case nn.NumericStart:return this.stateNumericStart(t,n);case nn.NumericDecimal:return this.stateNumericDecimal(t,n);case nn.NumericHex:return this.stateNumericHex(t,n);case nn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Jz)===rn.LOWER_X?(this.state=nn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=nn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){let o=r-n;this.result=this.result*Math.pow(i,o)+Number.parseInt(t.substr(n,o),i),this.consumed+=o}}stateNumericHex(t,n){let r=n;for(;n>14;for(;n>14,o!==0){if(s===rn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Ti.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;let{result:n,decodeTree:r}=this,i=(r[n]&gs.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){let{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~gs.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case nn.NamedEntity:return this.result!==0&&(this.decodeMode!==Ti.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case nn.NumericDecimal:return this.emitNumericEntity(0,2);case nn.NumericHex:return this.emitNumericEntity(0,3);case nn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case nn.EntityStart:return 0}}};function r7(e,t,n,r){let i=(t&gs.BRANCH_LENGTH)>>7,o=t&gs.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){let l=r-o;return l<0||l>=i?-1:e[n+l]-1}let s=n,a=s+i-1;for(;s<=a;){let l=s+a>>>1,u=e[l];if(ur)a=l-1;else return e[l+i]}return-1}var _f={};Wd(_f,{ATTRS:()=>Si,DOCUMENT_MODE:()=>Nn,NS:()=>X,NUMBERED_HEADERS:()=>fu,SPECIAL_ELEMENTS:()=>M1,TAG_ID:()=>m,TAG_NAMES:()=>z,getTagID:()=>bs,hasUnescapedText:()=>Hk});var X;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(X||(X={}));var Si;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Si||(Si={}));var Nn;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Nn||(Nn={}));var z;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(z||(z={}));var m;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(m||(m={}));var i7=new Map([[z.A,m.A],[z.ADDRESS,m.ADDRESS],[z.ANNOTATION_XML,m.ANNOTATION_XML],[z.APPLET,m.APPLET],[z.AREA,m.AREA],[z.ARTICLE,m.ARTICLE],[z.ASIDE,m.ASIDE],[z.B,m.B],[z.BASE,m.BASE],[z.BASEFONT,m.BASEFONT],[z.BGSOUND,m.BGSOUND],[z.BIG,m.BIG],[z.BLOCKQUOTE,m.BLOCKQUOTE],[z.BODY,m.BODY],[z.BR,m.BR],[z.BUTTON,m.BUTTON],[z.CAPTION,m.CAPTION],[z.CENTER,m.CENTER],[z.CODE,m.CODE],[z.COL,m.COL],[z.COLGROUP,m.COLGROUP],[z.DD,m.DD],[z.DESC,m.DESC],[z.DETAILS,m.DETAILS],[z.DIALOG,m.DIALOG],[z.DIR,m.DIR],[z.DIV,m.DIV],[z.DL,m.DL],[z.DT,m.DT],[z.EM,m.EM],[z.EMBED,m.EMBED],[z.FIELDSET,m.FIELDSET],[z.FIGCAPTION,m.FIGCAPTION],[z.FIGURE,m.FIGURE],[z.FONT,m.FONT],[z.FOOTER,m.FOOTER],[z.FOREIGN_OBJECT,m.FOREIGN_OBJECT],[z.FORM,m.FORM],[z.FRAME,m.FRAME],[z.FRAMESET,m.FRAMESET],[z.H1,m.H1],[z.H2,m.H2],[z.H3,m.H3],[z.H4,m.H4],[z.H5,m.H5],[z.H6,m.H6],[z.HEAD,m.HEAD],[z.HEADER,m.HEADER],[z.HGROUP,m.HGROUP],[z.HR,m.HR],[z.HTML,m.HTML],[z.I,m.I],[z.IMG,m.IMG],[z.IMAGE,m.IMAGE],[z.INPUT,m.INPUT],[z.IFRAME,m.IFRAME],[z.KEYGEN,m.KEYGEN],[z.LABEL,m.LABEL],[z.LI,m.LI],[z.LINK,m.LINK],[z.LISTING,m.LISTING],[z.MAIN,m.MAIN],[z.MALIGNMARK,m.MALIGNMARK],[z.MARQUEE,m.MARQUEE],[z.MATH,m.MATH],[z.MENU,m.MENU],[z.META,m.META],[z.MGLYPH,m.MGLYPH],[z.MI,m.MI],[z.MO,m.MO],[z.MN,m.MN],[z.MS,m.MS],[z.MTEXT,m.MTEXT],[z.NAV,m.NAV],[z.NOBR,m.NOBR],[z.NOFRAMES,m.NOFRAMES],[z.NOEMBED,m.NOEMBED],[z.NOSCRIPT,m.NOSCRIPT],[z.OBJECT,m.OBJECT],[z.OL,m.OL],[z.OPTGROUP,m.OPTGROUP],[z.OPTION,m.OPTION],[z.P,m.P],[z.PARAM,m.PARAM],[z.PLAINTEXT,m.PLAINTEXT],[z.PRE,m.PRE],[z.RB,m.RB],[z.RP,m.RP],[z.RT,m.RT],[z.RTC,m.RTC],[z.RUBY,m.RUBY],[z.S,m.S],[z.SCRIPT,m.SCRIPT],[z.SEARCH,m.SEARCH],[z.SECTION,m.SECTION],[z.SELECT,m.SELECT],[z.SOURCE,m.SOURCE],[z.SMALL,m.SMALL],[z.SPAN,m.SPAN],[z.STRIKE,m.STRIKE],[z.STRONG,m.STRONG],[z.STYLE,m.STYLE],[z.SUB,m.SUB],[z.SUMMARY,m.SUMMARY],[z.SUP,m.SUP],[z.TABLE,m.TABLE],[z.TBODY,m.TBODY],[z.TEMPLATE,m.TEMPLATE],[z.TEXTAREA,m.TEXTAREA],[z.TFOOT,m.TFOOT],[z.TD,m.TD],[z.TH,m.TH],[z.THEAD,m.THEAD],[z.TITLE,m.TITLE],[z.TR,m.TR],[z.TRACK,m.TRACK],[z.TT,m.TT],[z.U,m.U],[z.UL,m.UL],[z.SVG,m.SVG],[z.VAR,m.VAR],[z.WBR,m.WBR],[z.XMP,m.XMP]]);function bs(e){var t;return(t=i7.get(e))!==null&&t!==void 0?t:m.UNKNOWN}var Z=m,M1={[X.HTML]:new Set([Z.ADDRESS,Z.APPLET,Z.AREA,Z.ARTICLE,Z.ASIDE,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BLOCKQUOTE,Z.BODY,Z.BR,Z.BUTTON,Z.CAPTION,Z.CENTER,Z.COL,Z.COLGROUP,Z.DD,Z.DETAILS,Z.DIR,Z.DIV,Z.DL,Z.DT,Z.EMBED,Z.FIELDSET,Z.FIGCAPTION,Z.FIGURE,Z.FOOTER,Z.FORM,Z.FRAME,Z.FRAMESET,Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6,Z.HEAD,Z.HEADER,Z.HGROUP,Z.HR,Z.HTML,Z.IFRAME,Z.IMG,Z.INPUT,Z.LI,Z.LINK,Z.LISTING,Z.MAIN,Z.MARQUEE,Z.MENU,Z.META,Z.NAV,Z.NOEMBED,Z.NOFRAMES,Z.NOSCRIPT,Z.OBJECT,Z.OL,Z.P,Z.PARAM,Z.PLAINTEXT,Z.PRE,Z.SCRIPT,Z.SECTION,Z.SELECT,Z.SOURCE,Z.STYLE,Z.SUMMARY,Z.TABLE,Z.TBODY,Z.TD,Z.TEMPLATE,Z.TEXTAREA,Z.TFOOT,Z.TH,Z.THEAD,Z.TITLE,Z.TR,Z.TRACK,Z.UL,Z.WBR,Z.XMP]),[X.MATHML]:new Set([Z.MI,Z.MO,Z.MN,Z.MS,Z.MTEXT,Z.ANNOTATION_XML]),[X.SVG]:new Set([Z.TITLE,Z.FOREIGN_OBJECT,Z.DESC]),[X.XLINK]:new Set,[X.XML]:new Set,[X.XMLNS]:new Set},fu=new Set([Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6]),o7=new Set([z.STYLE,z.SCRIPT,z.XMP,z.IFRAME,z.NOEMBED,z.NOFRAMES,z.PLAINTEXT]);function Hk(e,t){return o7.has(e)||t&&e===z.NOSCRIPT}var k;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(k||(k={}));var Ct={DATA:k.DATA,RCDATA:k.RCDATA,RAWTEXT:k.RAWTEXT,SCRIPT_DATA:k.SCRIPT_DATA,PLAINTEXT:k.PLAINTEXT,CDATA_SECTION:k.CDATA_SECTION};function s7(e){return e>=N.DIGIT_0&&e<=N.DIGIT_9}function vf(e){return e>=N.LATIN_CAPITAL_A&&e<=N.LATIN_CAPITAL_Z}function a7(e){return e>=N.LATIN_SMALL_A&&e<=N.LATIN_SMALL_Z}function ys(e){return a7(e)||vf(e)}function zk(e){return ys(e)||s7(e)}function nm(e){return e+32}function Vk(e){return e===N.SPACE||e===N.LINE_FEED||e===N.TABULATION||e===N.FORM_FEED}function qk(e){return Vk(e)||e===N.SOLIDUS||e===N.GREATER_THAN_SIGN}function l7(e){return e===N.NULL?K.nullCharacterReference:e>1114111?K.characterReferenceOutsideUnicodeRange:Xh(e)?K.surrogateCharacterReference:Zh(e)?K.noncharacterCharacterReference:Qh(e)||e===N.CARRIAGE_RETURN?K.controlCharacterReference:null}var Cf=class{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=k.DATA,this.returnState=k.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Jh(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new tm(em,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(K.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(K.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{let i=l7(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(K.endTagWithAttributes),t.selfClosing&&this._err(K.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case He.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case He.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case He.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){let t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:He.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){let n=Vk(t)?He.WHITESPACE_CHARACTER:t===N.NULL?He.NULL_CHARACTER:He.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(He.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=k.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ti.Attribute:Ti.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===k.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===k.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===k.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case k.DATA:{this._stateData(t);break}case k.RCDATA:{this._stateRcdata(t);break}case k.RAWTEXT:{this._stateRawtext(t);break}case k.SCRIPT_DATA:{this._stateScriptData(t);break}case k.PLAINTEXT:{this._statePlaintext(t);break}case k.TAG_OPEN:{this._stateTagOpen(t);break}case k.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case k.TAG_NAME:{this._stateTagName(t);break}case k.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case k.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case k.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case k.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case k.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case k.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case k.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case k.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case k.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case k.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case k.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case k.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case k.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case k.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case k.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case k.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case k.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case k.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case k.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case k.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case k.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case k.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case k.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case k.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case k.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case k.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case k.BOGUS_COMMENT:{this._stateBogusComment(t);break}case k.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case k.COMMENT_START:{this._stateCommentStart(t);break}case k.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case k.COMMENT:{this._stateComment(t);break}case k.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case k.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case k.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case k.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case k.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case k.COMMENT_END:{this._stateCommentEnd(t);break}case k.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case k.DOCTYPE:{this._stateDoctype(t);break}case k.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case k.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case k.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case k.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case k.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case k.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case k.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case k.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case k.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case k.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case k.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case k.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case k.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case k.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case k.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case k.CDATA_SECTION:{this._stateCdataSection(t);break}case k.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case k.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case k.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case k.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case N.LESS_THAN_SIGN:{this.state=k.TAG_OPEN;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(K.unexpectedNullCharacter),this._emitCodePoint(t);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case N.AMPERSAND:{this._startCharacterReference();break}case N.LESS_THAN_SIGN:{this.state=k.RCDATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(K.unexpectedNullCharacter),this._emitChars(dt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case N.LESS_THAN_SIGN:{this.state=k.RAWTEXT_LESS_THAN_SIGN;break}case N.NULL:{this._err(K.unexpectedNullCharacter),this._emitChars(dt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case N.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(K.unexpectedNullCharacter),this._emitChars(dt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case N.NULL:{this._err(K.unexpectedNullCharacter),this._emitChars(dt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ys(t))this._createStartTagToken(),this.state=k.TAG_NAME,this._stateTagName(t);else switch(t){case N.EXCLAMATION_MARK:{this.state=k.MARKUP_DECLARATION_OPEN;break}case N.SOLIDUS:{this.state=k.END_TAG_OPEN;break}case N.QUESTION_MARK:{this._err(K.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=k.BOGUS_COMMENT,this._stateBogusComment(t);break}case N.EOF:{this._err(K.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(K.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=k.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ys(t))this._createEndTagToken(),this.state=k.TAG_NAME,this._stateTagName(t);else switch(t){case N.GREATER_THAN_SIGN:{this._err(K.missingEndTagName),this.state=k.DATA;break}case N.EOF:{this._err(K.eofBeforeTagName),this._emitChars("");break}case N.NULL:{this._err(K.unexpectedNullCharacter),this.state=k.SCRIPT_DATA_ESCAPED,this._emitChars(dt);break}case N.EOF:{this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=k.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===N.SOLIDUS?this.state=k.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ys(t)?(this._emitChars("<"),this.state=k.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=k.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ys(t)?(this.state=k.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case N.NULL:{this._err(K.unexpectedNullCharacter),this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(dt);break}case N.EOF:{this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===N.SOLIDUS?(this.state=k.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Fn.SCRIPT,!1)&&qk(this.preprocessor.peek(Fn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){let r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){let i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==X.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){let n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){let r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(p7,X.HTML)}clearBackToTableBodyContext(){this.clearBackTo(d7,X.HTML)}clearBackToTableRowContext(){this.clearBackTo(f7,X.HTML)}remove(t){let n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===m.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){let n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===m.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){let i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case X.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case X.SVG:{if(Yk.has(i))return!1;break}case X.MATHML:{if(Kk.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,rm)}hasInListItemScope(t){return this.hasInDynamicScope(t,u7)}hasInButtonScope(t){return this.hasInDynamicScope(t,c7)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){let n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case X.HTML:{if(fu.has(n))return!0;if(rm.has(n))return!1;break}case X.SVG:{if(Yk.has(n))return!1;break}case X.MATHML:{if(Kk.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===X.HTML)switch(this.tagIDs[n]){case t:return!0;case m.TABLE:case m.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===X.HTML)switch(this.tagIDs[t]){case m.TBODY:case m.THEAD:case m.TFOOT:return!0;case m.TABLE:case m.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===X.HTML)switch(this.tagIDs[n]){case t:return!0;case m.OPTION:case m.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&$k.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Gk.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Gk.has(this.currentTagId);)this.pop()}};var ii;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(ii||(ii={}));var Wk={type:ii.Marker},om=class{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){let r=[],i=n.length,o=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let a=0;a[s.name,s.value])),o=0;for(let s=0;si.get(l.name)===l.value)&&(o+=1,o>=3&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(Wk)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:ii.Element,element:t,token:n})}insertElementAfterBookmark(t,n){let r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ii.Element,element:t,token:n})}removeEntry(t){let n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){let t=this.entries.indexOf(Wk);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){let n=this.entries.find(r=>r.type===ii.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===ii.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===ii.Element&&n.element===t)}};var oi={createDocument(){return{nodeName:"#document",mode:Nn.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(o=>o.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{let o={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};oi.appendChild(e,o)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(oi.isTextNode(n)){n.value+=t;return}}oi.appendChild(e,oi.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&oi.isTextNode(r)?r.value+=t:oi.insertBefore(e,oi.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function Jk(e){return e.name===Xk&&e.publicId===null&&(e.systemId===null||e.systemId===m7)}function eM(e){if(e.name!==Xk)return Nn.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===g7)return Nn.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),y7.has(n))return Nn.QUIRKS;let r=t===null?b7:Qk;if(jk(n,r))return Nn.QUIRKS;if(r=t===null?Zk:E7,jk(n,r))return Nn.LIMITED_QUIRKS}return Nn.NO_QUIRKS}var tM={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},S7="definitionurl",x7="definitionURL",_7=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),v7=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:X.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:X.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:X.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:X.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:X.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:X.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:X.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:X.XML}],["xml:space",{prefix:"xml",name:"space",namespace:X.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:X.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:X.XMLNS}]]),C7=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),A7=new Set([m.B,m.BIG,m.BLOCKQUOTE,m.BODY,m.BR,m.CENTER,m.CODE,m.DD,m.DIV,m.DL,m.DT,m.EM,m.EMBED,m.H1,m.H2,m.H3,m.H4,m.H5,m.H6,m.HEAD,m.HR,m.I,m.IMG,m.LI,m.LISTING,m.MENU,m.META,m.NOBR,m.OL,m.P,m.PRE,m.RUBY,m.S,m.SMALL,m.SPAN,m.STRONG,m.STRIKE,m.SUB,m.SUP,m.TABLE,m.TT,m.U,m.UL,m.VAR]);function nM(e){let t=e.tagID;return t===m.FONT&&e.attrs.some(({name:r})=>r===Si.COLOR||r===Si.SIZE||r===Si.FACE)||A7.has(t)}function O1(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let o,s;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,s=this.fragmentContextID):{current:o,currentTagId:s}=this.openElements,this._setContextModes(o,s)}}_setContextModes(t,n){let r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===X.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,X.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=M.TEXT}switchToPlaintextParsing(){this.insertionMode=M.TEXT,this.originalInsertionMode=M.IN_BODY,this.tokenizer.state=Ct.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===z.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==X.HTML))switch(this.fragmentContextID){case m.TITLE:case m.TEXTAREA:{this.tokenizer.state=Ct.RCDATA;break}case m.STYLE:case m.XMP:case m.IFRAME:case m.NOEMBED:case m.NOFRAMES:case m.NOSCRIPT:{this.tokenizer.state=Ct.RAWTEXT;break}case m.SCRIPT:{this.tokenizer.state=Ct.SCRIPT_DATA;break}case m.PLAINTEXT:{this.tokenizer.state=Ct.PLAINTEXT;break}default:}}_setDocumentType(t){let n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){let s=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));s&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){let r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{let r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){let r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){let r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){let r=this.treeAdapter.createElement(t,X.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){let n=this.treeAdapter.createElement(t.tagName,X.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){let t=this.treeAdapter.createElement(z.HTML,X.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,m.HTML)}_appendCommentNode(t,n){let r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;let i=this.treeAdapter.getChildNodes(n),o=r?i.lastIndexOf(r):i.length,s=i[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){let{endLine:l,endCol:u,endOffset:c}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:l,endCol:u,endOffset:c})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){let r=n.location,i=this.treeAdapter.getTagName(t),o=n.type===He.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,o)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===m.SVG&&this.treeAdapter.getTagName(n)===z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===X.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===m.MGLYPH||t.tagID===m.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,X.HTML)}_processToken(t){switch(t.type){case He.CHARACTER:{this.onCharacter(t);break}case He.NULL_CHARACTER:{this.onNullCharacter(t);break}case He.COMMENT:{this.onComment(t);break}case He.DOCTYPE:{this.onDoctype(t);break}case He.START_TAG:{this._processStartTag(t);break}case He.END_TAG:{this.onEndTag(t);break}case He.EOF:{this.onEof(t);break}case He.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){let i=this.treeAdapter.getNamespaceURI(n),o=this.treeAdapter.getAttrList(n);return iM(t,i,o,r)}_reconstructActiveFormattingElements(){let t=this.activeFormattingElements.entries.length;if(t){let n=this.activeFormattingElements.entries.findIndex(i=>i.type===ii.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){let o=this.activeFormattingElements.entries[i];this._insertElement(o.token,this.treeAdapter.getNamespaceURI(o.element)),o.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=M.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(m.P),this.openElements.popUntilTagNamePopped(m.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case m.TR:{this.insertionMode=M.IN_ROW;return}case m.TBODY:case m.THEAD:case m.TFOOT:{this.insertionMode=M.IN_TABLE_BODY;return}case m.CAPTION:{this.insertionMode=M.IN_CAPTION;return}case m.COLGROUP:{this.insertionMode=M.IN_COLUMN_GROUP;return}case m.TABLE:{this.insertionMode=M.IN_TABLE;return}case m.BODY:{this.insertionMode=M.IN_BODY;return}case m.FRAMESET:{this.insertionMode=M.IN_FRAMESET;return}case m.SELECT:{this._resetInsertionModeForSelect(t);return}case m.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case m.HTML:{this.insertionMode=this.headElement?M.AFTER_HEAD:M.BEFORE_HEAD;return}case m.TD:case m.TH:{if(t>0){this.insertionMode=M.IN_CELL;return}break}case m.HEAD:{if(t>0){this.insertionMode=M.IN_HEAD;return}break}}this.insertionMode=M.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){let r=this.openElements.tagIDs[n];if(r===m.TEMPLATE)break;if(r===m.TABLE){this.insertionMode=M.IN_SELECT_IN_TABLE;return}}this.insertionMode=M.IN_SELECT}_isElementCausesFosterParenting(t){return uM.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){let n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case m.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===X.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case m.TABLE:{let r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){let n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){let r=this.treeAdapter.getNamespaceURI(t);return M1[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){lV(this,t);return}switch(this.insertionMode){case M.INITIAL:{Af(this,t);break}case M.BEFORE_HTML:{wf(this,t);break}case M.BEFORE_HEAD:{Rf(this,t);break}case M.IN_HEAD:{kf(this,t);break}case M.IN_HEAD_NO_SCRIPT:{Mf(this,t);break}case M.AFTER_HEAD:{Of(this,t);break}case M.IN_BODY:case M.IN_CAPTION:case M.IN_CELL:case M.IN_TEMPLATE:{fM(this,t);break}case M.TEXT:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{I1(this,t);break}case M.IN_TABLE_TEXT:{bM(this,t);break}case M.IN_COLUMN_GROUP:{lm(this,t);break}case M.AFTER_BODY:{um(this,t);break}case M.AFTER_AFTER_BODY:{am(this,t);break}default:}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){aV(this,t);return}switch(this.insertionMode){case M.INITIAL:{Af(this,t);break}case M.BEFORE_HTML:{wf(this,t);break}case M.BEFORE_HEAD:{Rf(this,t);break}case M.IN_HEAD:{kf(this,t);break}case M.IN_HEAD_NO_SCRIPT:{Mf(this,t);break}case M.AFTER_HEAD:{Of(this,t);break}case M.TEXT:{this._insertCharacters(t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{I1(this,t);break}case M.IN_COLUMN_GROUP:{lm(this,t);break}case M.AFTER_BODY:{um(this,t);break}case M.AFTER_AFTER_BODY:{am(this,t);break}default:}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){L1(this,t);return}switch(this.insertionMode){case M.INITIAL:case M.BEFORE_HTML:case M.BEFORE_HEAD:case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:case M.IN_BODY:case M.IN_TABLE:case M.IN_CAPTION:case M.IN_COLUMN_GROUP:case M.IN_TABLE_BODY:case M.IN_ROW:case M.IN_CELL:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:case M.IN_TEMPLATE:case M.IN_FRAMESET:case M.AFTER_FRAMESET:{L1(this,t);break}case M.IN_TABLE_TEXT:{Nf(this,t);break}case M.AFTER_BODY:{F7(this,t);break}case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{H7(this,t);break}default:}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case M.INITIAL:{z7(this,t);break}case M.BEFORE_HEAD:case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:{this._err(t,K.misplacedDoctype);break}case M.IN_TABLE_TEXT:{Nf(this,t);break}default:}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,K.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?uV(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case M.INITIAL:{Af(this,t);break}case M.BEFORE_HTML:{q7(this,t);break}case M.BEFORE_HEAD:{G7(this,t);break}case M.IN_HEAD:{si(this,t);break}case M.IN_HEAD_NO_SCRIPT:{$7(this,t);break}case M.AFTER_HEAD:{j7(this,t);break}case M.IN_BODY:{wn(this,t);break}case M.IN_TABLE:{du(this,t);break}case M.IN_TABLE_TEXT:{Nf(this,t);break}case M.IN_CAPTION:{Kq(this,t);break}case M.IN_COLUMN_GROUP:{F1(this,t);break}case M.IN_TABLE_BODY:{dm(this,t);break}case M.IN_ROW:{pm(this,t);break}case M.IN_CELL:{Wq(this,t);break}case M.IN_SELECT:{TM(this,t);break}case M.IN_SELECT_IN_TABLE:{Xq(this,t);break}case M.IN_TEMPLATE:{Zq(this,t);break}case M.AFTER_BODY:{eV(this,t);break}case M.IN_FRAMESET:{tV(this,t);break}case M.AFTER_FRAMESET:{rV(this,t);break}case M.AFTER_AFTER_BODY:{oV(this,t);break}case M.AFTER_AFTER_FRAMESET:{sV(this,t);break}default:}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?cV(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case M.INITIAL:{Af(this,t);break}case M.BEFORE_HTML:{V7(this,t);break}case M.BEFORE_HEAD:{K7(this,t);break}case M.IN_HEAD:{Y7(this,t);break}case M.IN_HEAD_NO_SCRIPT:{W7(this,t);break}case M.AFTER_HEAD:{X7(this,t);break}case M.IN_BODY:{fm(this,t);break}case M.TEXT:{Lq(this,t);break}case M.IN_TABLE:{Df(this,t);break}case M.IN_TABLE_TEXT:{Nf(this,t);break}case M.IN_CAPTION:{Yq(this,t);break}case M.IN_COLUMN_GROUP:{$q(this,t);break}case M.IN_TABLE_BODY:{P1(this,t);break}case M.IN_ROW:{EM(this,t);break}case M.IN_CELL:{jq(this,t);break}case M.IN_SELECT:{SM(this,t);break}case M.IN_SELECT_IN_TABLE:{Qq(this,t);break}case M.IN_TEMPLATE:{Jq(this,t);break}case M.AFTER_BODY:{_M(this,t);break}case M.IN_FRAMESET:{nV(this,t);break}case M.AFTER_FRAMESET:{iV(this,t);break}case M.AFTER_AFTER_BODY:{am(this,t);break}default:}}onEof(t){switch(this.insertionMode){case M.INITIAL:{Af(this,t);break}case M.BEFORE_HTML:{wf(this,t);break}case M.BEFORE_HEAD:{Rf(this,t);break}case M.IN_HEAD:{kf(this,t);break}case M.IN_HEAD_NO_SCRIPT:{Mf(this,t);break}case M.AFTER_HEAD:{Of(this,t);break}case M.IN_BODY:case M.IN_TABLE:case M.IN_CAPTION:case M.IN_COLUMN_GROUP:case M.IN_TABLE_BODY:case M.IN_ROW:case M.IN_CELL:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:{mM(this,t);break}case M.TEXT:{Pq(this,t);break}case M.IN_TABLE_TEXT:{Nf(this,t);break}case M.IN_TEMPLATE:{xM(this,t);break}case M.AFTER_BODY:case M.IN_FRAMESET:case M.AFTER_FRAMESET:case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{U1(this,t);break}default:}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===N.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:case M.TEXT:case M.IN_COLUMN_GROUP:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:case M.IN_FRAMESET:case M.AFTER_FRAMESET:{this._insertCharacters(t);break}case M.IN_BODY:case M.IN_CAPTION:case M.IN_CELL:case M.IN_TEMPLATE:case M.AFTER_BODY:case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{cM(this,t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{I1(this,t);break}case M.IN_TABLE_TEXT:{gM(this,t);break}default:}}};function D7(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):hM(e,t),n}function I7(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function L7(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let o=0,s=i;s!==n;o++,s=i){i=e.openElements.getCommonAncestor(s);let a=e.activeFormattingElements.getElementEntry(s),l=a&&o>=M7;!a||l?(l&&e.activeFormattingElements.removeEntry(a),e.openElements.remove(s)):(s=P7(e,a),r===t&&(e.activeFormattingElements.bookmark=a),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function P7(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function B7(e,t,n){let r=e.treeAdapter.getTagName(t),i=bs(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{let o=e.treeAdapter.getNamespaceURI(t);i===m.TEMPLATE&&o===X.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function U7(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,o=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,o),e.treeAdapter.appendChild(t,o),e.activeFormattingElements.insertElementAfterBookmark(o,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,o,i.tagID)}function B1(e,t){for(let n=0;n=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){let o=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(o);s&&!s.endTag&&e._setEndLocation(o,t)}}}}function z7(e,t){e._setDocumentType(t);let n=t.forceQuirks?Nn.QUIRKS:eM(t);Jk(t)||e._err(t,K.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=M.BEFORE_HTML}function Af(e,t){e._err(t,K.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Nn.QUIRKS),e.insertionMode=M.BEFORE_HTML,e._processToken(t)}function q7(e,t){t.tagID===m.HTML?(e._insertElement(t,X.HTML),e.insertionMode=M.BEFORE_HEAD):wf(e,t)}function V7(e,t){let n=t.tagID;(n===m.HTML||n===m.HEAD||n===m.BODY||n===m.BR)&&wf(e,t)}function wf(e,t){e._insertFakeRootElement(),e.insertionMode=M.BEFORE_HEAD,e._processToken(t)}function G7(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.HEAD:{e._insertElement(t,X.HTML),e.headElement=e.openElements.current,e.insertionMode=M.IN_HEAD;break}default:Rf(e,t)}}function K7(e,t){let n=t.tagID;n===m.HEAD||n===m.BODY||n===m.HTML||n===m.BR?Rf(e,t):e._err(t,K.endTagWithoutMatchingOpenElement)}function Rf(e,t){e._insertFakeElement(z.HEAD,m.HEAD),e.headElement=e.openElements.current,e.insertionMode=M.IN_HEAD,e._processToken(t)}function si(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.BASE:case m.BASEFONT:case m.BGSOUND:case m.LINK:case m.META:{e._appendElement(t,X.HTML),t.ackSelfClosing=!0;break}case m.TITLE:{e._switchToTextParsing(t,Ct.RCDATA);break}case m.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ct.RAWTEXT):(e._insertElement(t,X.HTML),e.insertionMode=M.IN_HEAD_NO_SCRIPT);break}case m.NOFRAMES:case m.STYLE:{e._switchToTextParsing(t,Ct.RAWTEXT);break}case m.SCRIPT:{e._switchToTextParsing(t,Ct.SCRIPT_DATA);break}case m.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=M.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(M.IN_TEMPLATE);break}case m.HEAD:{e._err(t,K.misplacedStartTagForHeadElement);break}default:kf(e,t)}}function Y7(e,t){switch(t.tagID){case m.HEAD:{e.openElements.pop(),e.insertionMode=M.AFTER_HEAD;break}case m.BODY:case m.BR:case m.HTML:{kf(e,t);break}case m.TEMPLATE:{ha(e,t);break}default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function ha(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==m.TEMPLATE&&e._err(t,K.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(m.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,K.endTagWithoutMatchingOpenElement)}function kf(e,t){e.openElements.pop(),e.insertionMode=M.AFTER_HEAD,e._processToken(t)}function $7(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.BASEFONT:case m.BGSOUND:case m.HEAD:case m.LINK:case m.META:case m.NOFRAMES:case m.STYLE:{si(e,t);break}case m.NOSCRIPT:{e._err(t,K.nestedNoscriptInHead);break}default:Mf(e,t)}}function W7(e,t){switch(t.tagID){case m.NOSCRIPT:{e.openElements.pop(),e.insertionMode=M.IN_HEAD;break}case m.BR:{Mf(e,t);break}default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function Mf(e,t){let n=t.type===He.EOF?K.openElementsLeftAfterEof:K.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=M.IN_HEAD,e._processToken(t)}function j7(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.BODY:{e._insertElement(t,X.HTML),e.framesetOk=!1,e.insertionMode=M.IN_BODY;break}case m.FRAMESET:{e._insertElement(t,X.HTML),e.insertionMode=M.IN_FRAMESET;break}case m.BASE:case m.BASEFONT:case m.BGSOUND:case m.LINK:case m.META:case m.NOFRAMES:case m.SCRIPT:case m.STYLE:case m.TEMPLATE:case m.TITLE:{e._err(t,K.abandonedHeadElementChild),e.openElements.push(e.headElement,m.HEAD),si(e,t),e.openElements.remove(e.headElement);break}case m.HEAD:{e._err(t,K.misplacedStartTagForHeadElement);break}default:Of(e,t)}}function X7(e,t){switch(t.tagID){case m.BODY:case m.HTML:case m.BR:{Of(e,t);break}case m.TEMPLATE:{ha(e,t);break}default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function Of(e,t){e._insertFakeElement(z.BODY,m.BODY),e.insertionMode=M.IN_BODY,cm(e,t)}function cm(e,t){switch(t.type){case He.CHARACTER:{fM(e,t);break}case He.WHITESPACE_CHARACTER:{cM(e,t);break}case He.COMMENT:{L1(e,t);break}case He.START_TAG:{wn(e,t);break}case He.END_TAG:{fm(e,t);break}case He.EOF:{mM(e,t);break}default:}}function cM(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function fM(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Q7(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Z7(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function J7(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,X.HTML),e.insertionMode=M.IN_FRAMESET)}function eq(e,t){e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._insertElement(t,X.HTML)}function tq(e,t){e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&fu.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,X.HTML)}function nq(e,t){e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._insertElement(t,X.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function rq(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._insertElement(t,X.HTML),n||(e.formElement=e.openElements.current))}function iq(e,t){e.framesetOk=!1;let n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){let i=e.openElements.tagIDs[r];if(n===m.LI&&i===m.LI||(n===m.DD||n===m.DT)&&(i===m.DD||i===m.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==m.ADDRESS&&i!==m.DIV&&i!==m.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._insertElement(t,X.HTML)}function oq(e,t){e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._insertElement(t,X.HTML),e.tokenizer.state=Ct.PLAINTEXT}function sq(e,t){e.openElements.hasInScope(m.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(m.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML),e.framesetOk=!1}function aq(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(z.A);n&&(B1(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function lq(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function uq(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(m.NOBR)&&(B1(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,X.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function cq(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function fq(e,t){e.treeAdapter.getDocumentMode(e.document)!==Nn.QUIRKS&&e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._insertElement(t,X.HTML),e.framesetOk=!1,e.insertionMode=M.IN_TABLE}function dM(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,X.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function pM(e){let t=xf(e,Si.TYPE);return t!=null&&t.toLowerCase()===R7}function dq(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,X.HTML),pM(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function pq(e,t){e._appendElement(t,X.HTML),t.ackSelfClosing=!0}function hq(e,t){e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._appendElement(t,X.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function mq(e,t){t.tagName=z.IMG,t.tagID=m.IMG,dM(e,t)}function gq(e,t){e._insertElement(t,X.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ct.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=M.TEXT}function bq(e,t){e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ct.RAWTEXT)}function yq(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ct.RAWTEXT)}function aM(e,t){e._switchToTextParsing(t,Ct.RAWTEXT)}function Eq(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===M.IN_TABLE||e.insertionMode===M.IN_CAPTION||e.insertionMode===M.IN_TABLE_BODY||e.insertionMode===M.IN_ROW||e.insertionMode===M.IN_CELL?M.IN_SELECT_IN_TABLE:M.IN_SELECT}function Tq(e,t){e.openElements.currentTagId===m.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML)}function Sq(e,t){e.openElements.hasInScope(m.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,X.HTML)}function xq(e,t){e.openElements.hasInScope(m.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(m.RTC),e._insertElement(t,X.HTML)}function _q(e,t){e._reconstructActiveFormattingElements(),O1(t),sm(t),t.selfClosing?e._appendElement(t,X.MATHML):e._insertElement(t,X.MATHML),t.ackSelfClosing=!0}function vq(e,t){e._reconstructActiveFormattingElements(),D1(t),sm(t),t.selfClosing?e._appendElement(t,X.SVG):e._insertElement(t,X.SVG),t.ackSelfClosing=!0}function lM(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML)}function wn(e,t){switch(t.tagID){case m.I:case m.S:case m.B:case m.U:case m.EM:case m.TT:case m.BIG:case m.CODE:case m.FONT:case m.SMALL:case m.STRIKE:case m.STRONG:{lq(e,t);break}case m.A:{aq(e,t);break}case m.H1:case m.H2:case m.H3:case m.H4:case m.H5:case m.H6:{tq(e,t);break}case m.P:case m.DL:case m.OL:case m.UL:case m.DIV:case m.DIR:case m.NAV:case m.MAIN:case m.MENU:case m.ASIDE:case m.CENTER:case m.FIGURE:case m.FOOTER:case m.HEADER:case m.HGROUP:case m.DIALOG:case m.DETAILS:case m.ADDRESS:case m.ARTICLE:case m.SEARCH:case m.SECTION:case m.SUMMARY:case m.FIELDSET:case m.BLOCKQUOTE:case m.FIGCAPTION:{eq(e,t);break}case m.LI:case m.DD:case m.DT:{iq(e,t);break}case m.BR:case m.IMG:case m.WBR:case m.AREA:case m.EMBED:case m.KEYGEN:{dM(e,t);break}case m.HR:{hq(e,t);break}case m.RB:case m.RTC:{Sq(e,t);break}case m.RT:case m.RP:{xq(e,t);break}case m.PRE:case m.LISTING:{nq(e,t);break}case m.XMP:{bq(e,t);break}case m.SVG:{vq(e,t);break}case m.HTML:{Q7(e,t);break}case m.BASE:case m.LINK:case m.META:case m.STYLE:case m.TITLE:case m.SCRIPT:case m.BGSOUND:case m.BASEFONT:case m.TEMPLATE:{si(e,t);break}case m.BODY:{Z7(e,t);break}case m.FORM:{rq(e,t);break}case m.NOBR:{uq(e,t);break}case m.MATH:{_q(e,t);break}case m.TABLE:{fq(e,t);break}case m.INPUT:{dq(e,t);break}case m.PARAM:case m.TRACK:case m.SOURCE:{pq(e,t);break}case m.IMAGE:{mq(e,t);break}case m.BUTTON:{sq(e,t);break}case m.APPLET:case m.OBJECT:case m.MARQUEE:{cq(e,t);break}case m.IFRAME:{yq(e,t);break}case m.SELECT:{Eq(e,t);break}case m.OPTION:case m.OPTGROUP:{Tq(e,t);break}case m.NOEMBED:case m.NOFRAMES:{aM(e,t);break}case m.FRAMESET:{J7(e,t);break}case m.TEXTAREA:{gq(e,t);break}case m.NOSCRIPT:{e.options.scriptingEnabled?aM(e,t):lM(e,t);break}case m.PLAINTEXT:{oq(e,t);break}case m.COL:case m.TH:case m.TD:case m.TR:case m.HEAD:case m.FRAME:case m.TBODY:case m.TFOOT:case m.THEAD:case m.CAPTION:case m.COLGROUP:break;default:lM(e,t)}}function Cq(e,t){if(e.openElements.hasInScope(m.BODY)&&(e.insertionMode=M.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Aq(e,t){e.openElements.hasInScope(m.BODY)&&(e.insertionMode=M.AFTER_BODY,_M(e,t))}function Nq(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function wq(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(m.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(m.FORM):n&&e.openElements.remove(n))}function Rq(e){e.openElements.hasInButtonScope(m.P)||e._insertFakeElement(z.P,m.P),e._closePElement()}function kq(e){e.openElements.hasInListItemScope(m.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(m.LI),e.openElements.popUntilTagNamePopped(m.LI))}function Mq(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Oq(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Dq(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Iq(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(z.BR,m.BR),e.openElements.pop(),e.framesetOk=!1}function hM(e,t){let n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){let o=e.openElements.items[i],s=e.openElements.tagIDs[i];if(r===s&&(r!==m.UNKNOWN||e.treeAdapter.getTagName(o)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(o,s))break}}function fm(e,t){switch(t.tagID){case m.A:case m.B:case m.I:case m.S:case m.U:case m.EM:case m.TT:case m.BIG:case m.CODE:case m.FONT:case m.NOBR:case m.SMALL:case m.STRIKE:case m.STRONG:{B1(e,t);break}case m.P:{Rq(e);break}case m.DL:case m.UL:case m.OL:case m.DIR:case m.DIV:case m.NAV:case m.PRE:case m.MAIN:case m.MENU:case m.ASIDE:case m.BUTTON:case m.CENTER:case m.FIGURE:case m.FOOTER:case m.HEADER:case m.HGROUP:case m.DIALOG:case m.ADDRESS:case m.ARTICLE:case m.DETAILS:case m.SEARCH:case m.SECTION:case m.SUMMARY:case m.LISTING:case m.FIELDSET:case m.BLOCKQUOTE:case m.FIGCAPTION:{Nq(e,t);break}case m.LI:{kq(e);break}case m.DD:case m.DT:{Mq(e,t);break}case m.H1:case m.H2:case m.H3:case m.H4:case m.H5:case m.H6:{Oq(e);break}case m.BR:{Iq(e);break}case m.BODY:{Cq(e,t);break}case m.HTML:{Aq(e,t);break}case m.FORM:{wq(e);break}case m.APPLET:case m.OBJECT:case m.MARQUEE:{Dq(e,t);break}case m.TEMPLATE:{ha(e,t);break}default:hM(e,t)}}function mM(e,t){e.tmplInsertionModeStack.length>0?xM(e,t):U1(e,t)}function Lq(e,t){var n;t.tagID===m.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Pq(e,t){e._err(t,K.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function I1(e,t){if(e.openElements.currentTagId!==void 0&&uM.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=M.IN_TABLE_TEXT,t.type){case He.CHARACTER:{bM(e,t);break}case He.WHITESPACE_CHARACTER:{gM(e,t);break}}else If(e,t)}function Bq(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,X.HTML),e.insertionMode=M.IN_CAPTION}function Uq(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,X.HTML),e.insertionMode=M.IN_COLUMN_GROUP}function Fq(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.COLGROUP,m.COLGROUP),e.insertionMode=M.IN_COLUMN_GROUP,F1(e,t)}function Hq(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,X.HTML),e.insertionMode=M.IN_TABLE_BODY}function zq(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.TBODY,m.TBODY),e.insertionMode=M.IN_TABLE_BODY,dm(e,t)}function qq(e,t){e.openElements.hasInTableScope(m.TABLE)&&(e.openElements.popUntilTagNamePopped(m.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Vq(e,t){pM(t)?e._appendElement(t,X.HTML):If(e,t),t.ackSelfClosing=!0}function Gq(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,X.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function du(e,t){switch(t.tagID){case m.TD:case m.TH:case m.TR:{zq(e,t);break}case m.STYLE:case m.SCRIPT:case m.TEMPLATE:{si(e,t);break}case m.COL:{Fq(e,t);break}case m.FORM:{Gq(e,t);break}case m.TABLE:{qq(e,t);break}case m.TBODY:case m.TFOOT:case m.THEAD:{Hq(e,t);break}case m.INPUT:{Vq(e,t);break}case m.CAPTION:{Bq(e,t);break}case m.COLGROUP:{Uq(e,t);break}default:If(e,t)}}function Df(e,t){switch(t.tagID){case m.TABLE:{e.openElements.hasInTableScope(m.TABLE)&&(e.openElements.popUntilTagNamePopped(m.TABLE),e._resetInsertionMode());break}case m.TEMPLATE:{ha(e,t);break}case m.BODY:case m.CAPTION:case m.COL:case m.COLGROUP:case m.HTML:case m.TBODY:case m.TD:case m.TFOOT:case m.TH:case m.THEAD:case m.TR:break;default:If(e,t)}}function If(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,cm(e,t),e.fosterParentingEnabled=n}function gM(e,t){e.pendingCharacterTokens.push(t)}function bM(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Nf(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===m.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===m.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===m.OPTGROUP&&e.openElements.pop();break}case m.OPTION:{e.openElements.currentTagId===m.OPTION&&e.openElements.pop();break}case m.SELECT:{e.openElements.hasInSelectScope(m.SELECT)&&(e.openElements.popUntilTagNamePopped(m.SELECT),e._resetInsertionMode());break}case m.TEMPLATE:{ha(e,t);break}default:}}function Xq(e,t){let n=t.tagID;n===m.CAPTION||n===m.TABLE||n===m.TBODY||n===m.TFOOT||n===m.THEAD||n===m.TR||n===m.TD||n===m.TH?(e.openElements.popUntilTagNamePopped(m.SELECT),e._resetInsertionMode(),e._processStartTag(t)):TM(e,t)}function Qq(e,t){let n=t.tagID;n===m.CAPTION||n===m.TABLE||n===m.TBODY||n===m.TFOOT||n===m.THEAD||n===m.TR||n===m.TD||n===m.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(m.SELECT),e._resetInsertionMode(),e.onEndTag(t)):SM(e,t)}function Zq(e,t){switch(t.tagID){case m.BASE:case m.BASEFONT:case m.BGSOUND:case m.LINK:case m.META:case m.NOFRAMES:case m.SCRIPT:case m.STYLE:case m.TEMPLATE:case m.TITLE:{si(e,t);break}case m.CAPTION:case m.COLGROUP:case m.TBODY:case m.TFOOT:case m.THEAD:{e.tmplInsertionModeStack[0]=M.IN_TABLE,e.insertionMode=M.IN_TABLE,du(e,t);break}case m.COL:{e.tmplInsertionModeStack[0]=M.IN_COLUMN_GROUP,e.insertionMode=M.IN_COLUMN_GROUP,F1(e,t);break}case m.TR:{e.tmplInsertionModeStack[0]=M.IN_TABLE_BODY,e.insertionMode=M.IN_TABLE_BODY,dm(e,t);break}case m.TD:case m.TH:{e.tmplInsertionModeStack[0]=M.IN_ROW,e.insertionMode=M.IN_ROW,pm(e,t);break}default:e.tmplInsertionModeStack[0]=M.IN_BODY,e.insertionMode=M.IN_BODY,wn(e,t)}}function Jq(e,t){t.tagID===m.TEMPLATE&&ha(e,t)}function xM(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(m.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):U1(e,t)}function eV(e,t){t.tagID===m.HTML?wn(e,t):um(e,t)}function _M(e,t){var n;if(t.tagID===m.HTML){if(e.fragmentContext||(e.insertionMode=M.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===m.HTML){e._setEndLocation(e.openElements.items[0],t);let r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else um(e,t)}function um(e,t){e.insertionMode=M.IN_BODY,cm(e,t)}function tV(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.FRAMESET:{e._insertElement(t,X.HTML);break}case m.FRAME:{e._appendElement(t,X.HTML),t.ackSelfClosing=!0;break}case m.NOFRAMES:{si(e,t);break}default:}}function nV(e,t){t.tagID===m.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==m.FRAMESET&&(e.insertionMode=M.AFTER_FRAMESET))}function rV(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.NOFRAMES:{si(e,t);break}default:}}function iV(e,t){t.tagID===m.HTML&&(e.insertionMode=M.AFTER_AFTER_FRAMESET)}function oV(e,t){t.tagID===m.HTML?wn(e,t):am(e,t)}function am(e,t){e.insertionMode=M.IN_BODY,cm(e,t)}function sV(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.NOFRAMES:{si(e,t);break}default:}}function aV(e,t){t.chars=dt,e._insertCharacters(t)}function lV(e,t){e._insertCharacters(t),e.framesetOk=!1}function vM(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==X.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function uV(e,t){if(nM(t))vM(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===X.MATHML?O1(t):r===X.SVG&&(rM(t),D1(t)),sm(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function cV(e,t){if(t.tagID===m.P||t.tagID===m.BR){vM(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===X.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}var vue=String.prototype.codePointAt==null?(e,t)=>(e.charCodeAt(t)&64512)===55296?(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t):(e,t)=>e.codePointAt(t);var Mue=new Set([z.AREA,z.BASE,z.BASEFONT,z.BGSOUND,z.BR,z.COL,z.EMBED,z.FRAME,z.HR,z.IMG,z.INPUT,z.KEYGEN,z.LINK,z.META,z.PARAM,z.SOURCE,z.TRACK,z.WBR]);function CM(e,t,n){typeof e=="string"&&(n=t,t=e,e=null);let r=Es.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}var ai={basename:fV,dirname:dV,extname:pV,join:hV,sep:"/"};function fV(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Lf(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function dV(e){if(Lf(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function pV(e){Lf(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){let a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function hV(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function gV(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Lf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var AM={cwd:bV};function bV(){return"/"}function pu(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function NM(e){if(typeof e=="string")e=new URL(e);else if(!pu(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return yV(e)}function yV(e){if(e.hostname!==""){let r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}let t=e.pathname,n=-1;for(;++n":""))+")"})}return d;function d(){let p=RM,h,g,y;if((!t||o(l,u,c[c.length-1]||void 0))&&(p=CV(n(l,c)),p[0]===ga))return p;if("children"in l&&l.children){let b=l;if(b.children&&p[0]!==Hn)for(g=(r?b.children.length:-1)+s,y=c.concat(b);g>-1&&gi||n!==-1&&t>n||r!==-1&&t>r||NV.test(e.slice(0,t)))}function V1(e){Le(e,"element",t=>{for(let[n,r]of Object.entries(AV)){if(r!==null&&!r.includes(t.tagName))continue;let i=t.properties?.[n];typeof i=="string"&&!gm(i)&&(t.properties[n]="")}})}var hu="dataPending";function bm(e){return typeof e=="string"?e.split(/\s+/).includes("suggestion"):Array.isArray(e)?e.includes("suggestion"):!1}function Bf(e){return e?e.map(t=>t.type==="text"?t.value:t.type==="element"?Bf(t.children):"").join("").trim():""}function mu(e){if(e.type!=="element")return!1;let t=e.properties;return t?bm(t.className)||"dataSuggestion"in t:!1}var wV="markdown-stream-dot";function RV(){return{type:"element",tagName:"svg",properties:{width:12,height:12,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",className:[wV],style:"margin-left:.25em;margin-top:-.25em",ariaHidden:"true"},children:[{type:"element",tagName:"circle",properties:{cx:6,cy:6,r:6},children:[]}]}}var kV=new Set(["p","div","pre","ul","ol"]),MV=new Set(["p","h1","h2","h3","h4","h5","h6","li","code"]);function OV(e){return e.type==="text"?/\S/.test(e.value):!1}function DV(e){return e.tagName!=="ul"&&e.tagName!=="ol"?!1:e.properties!=null&&hu in e.properties}function kM(e){if(e.children.length===0)return e;let t=IV(e),n={...e,children:[...e.children]},r=n.children;for(let i=0;i=0;l--){let u=i[l];if(u.type!=="doctype"&&(u.type==="element"||OV(u))){o=l,s=u;break}}if(!s||s.type!=="element")return t;let a=s.tagName;if(kV.has(a)){if(t.push({index:o}),DV(s))return t;n=s;continue}return MV.has(a)&&t.push({index:o}),t}return t}function MM(e){return e.type==="text"&&e.value.trim()!==""}function ym(e){return e.filter(t=>t.type==="element"||t.type==="text"&&t.value.trim()!=="")}function OM(e){let t=e.children;if(t.some(MM))return!1;let n=t.filter(r=>r.type==="element");if(n.length===0)return!1;for(let r of n){if(r.tagName!=="li")return!1;let i=r.children;if(i.some(MM))return!1;let o=ym(i).filter(a=>a.type==="element");if(o.length!==1)return!1;let s=o[0];if(!s||!mu(s))return!1}return!0}function G1(e,...t){let n;Array.isArray(e)?n=[...e]:typeof e=="string"&&e.trim()!==""?n=e.split(/\s+/).filter(Boolean):n=[];for(let r of t)n.includes(r)||n.push(r);return n}function LV(e,...t){let n;return Array.isArray(e)?n=[...e]:typeof e=="string"&&e.trim()!==""?n=e.split(/\s+/).filter(Boolean):n=[],n.filter(r=>!t.includes(String(r)))}function DM(e,t){return{type:"element",tagName:"div",properties:{className:[e]},children:t}}function PV(e,t){return DM(e,[{type:"text",value:t}])}function IM(e,t){let n=["shiny-chat-suggestion-list"];t&&n.push("shiny-chat-suggestion-list--ordered"),e.properties.className=G1(e.properties.className,...n),e.properties.role="list";let r=0;for(let i of e.children){if(i.type!=="element"||i.tagName!=="li")continue;let o=i.children,s=ym(o).find(mu),a=Bf(s.children),l=s.properties.title,u=typeof l=="string"&&l.trim()!==""?l.trim():null,c=u?PV("shiny-chat-suggestion-list-item-title",u):null,f=DM("shiny-chat-suggestion-list-item-body",s.children);s.children=c?[c,f]:[f],s.properties.className=G1(s.properties.className,"shiny-chat-suggestion-list-item");let d=s.properties.dataSuggestion;if(typeof d=="string"&&d!==""||(s.properties.dataSuggestion=a),t){let g=r+1;s.properties.ariaLabel=u?`Use chat suggestion #${g}: ${u} \u2014 ${a}`:`Use chat suggestion #${g}: ${a}`}else s.properties.ariaLabel=u?`Use chat suggestion: ${u} \u2014 ${a}`:`Use chat suggestion: ${a}`;let p=s.properties.style,h=`--_card-index:${r}`;s.properties.style=typeof p=="string"&&p!==""?`${h};${p}`:h,delete s.properties.title,i.properties.role="listitem",r++}}var BV=/^\s*<(s(p(a(n(\s[^>]*)?)?)?)?)?$/i;function UV(e){let n=e.children.filter(a=>a.type==="element");if(n.length===0)return!1;let r=n[n.length-1];if(r.tagName!=="li")return!1;let i=n.slice(0,-1),o=!1;for(let a of i){if(a.tagName!=="li")return!1;let l=a.children,u=ym(l);if(u.length!==0){if(u.length===1&&mu(u[0])){o=!0;continue}return!1}}let s=ym(r.children);if(s.length!==0){if(s.length===1&&mu(s[0]))o=!0;else if(!(s.length===1&&s[0].type==="text"&&BV.test(s[0].value)))return!1}return o||n.length===1}function FV(e,t){let n=["shiny-chat-suggestion-list"];t&&n.push("shiny-chat-suggestion-list--ordered"),e.properties.className=G1(e.properties.className,...n),e.properties[hu]=""}function HV(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.type==="element")return n}return null}var K1=()=>e=>{let t=HV(e.children);for(let n of e.children){if(n.type!=="element")continue;let r=n;if(!(r.tagName!=="ul"&&r.tagName!=="ol")){if(r===t){UV(r)&&FV(r,r.tagName==="ol");continue}OM(r)&&IM(r,r.tagName==="ol")}}};function zV(e){return{...e,properties:{...e.properties},children:e.children.map(n=>{if(n.type!=="element"||n.tagName!=="li")return n;let r=n;return{...r,properties:{...r.properties},children:r.children.map(o=>{if(!mu(o))return o;let s=o;return{...s,properties:{...s.properties},children:[...s.children]}})}})}}function LM(e){let t=[];for(let r=0;r=0;n--){let r=t[n];if(r&&r.type==="element")return r}return null}function GV(e){for(let t of e.children)t.type==="element"&&t.tagName===Y1&&(t.properties={...t.properties,[Uf]:""})}var $1=()=>e=>{let t=e;for(;;){let n=VV(t);if(!n)return;if(n.tagName===Y1){GV(t);return}t=n}};function PM(e){let t=BM(e.children);return t?{...e,children:t}:e}function BM(e){let t=!1,n=e.map(r=>{if(r.type!=="element")return r;let i=KV(r);return i!==r&&(t=!0),i});return t?n:null}function KV(e){let t=qV(e),n=BM(e.children);if(!t&&!n)return e;let r={...e.properties};return t&&delete r[Uf],{...e,properties:r,children:n??e.children}}function YV(e){return e?.type==="raw"}function $V(e){return e.type!=="doctype"}function W1(e){return e.replace(/])((?:"[^"]*"|'[^']*'|[^"'>])*?)\/>/g,"").replace(/])/g,"")}var UM=()=>e=>{Le(e,t=>{YV(t)&&(t.value=W1(t.value))})};function j1(e){Le(e,"element",t=>{t.tagName==="template"&&(!t.properties||!("dataShinyAside"in t.properties)||(t.tagName="shiny-aside",t.children=(t.content?.children??[]).filter($V),delete t.content,delete t.properties.dataShinyAside))})}var FM=()=>j1;var WV={className:"class",htmlFor:"for",tabIndex:"tabindex",readOnly:"readonly",contentEditable:"contenteditable",colSpan:"colspan",rowSpan:"rowspan",autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",crossOrigin:"crossorigin",encType:"enctype",formAction:"formaction",formNoValidate:"formnovalidate",inputMode:"inputmode",maxLength:"maxlength",minLength:"minlength",noValidate:"novalidate",spellCheck:"spellcheck",srcDoc:"srcdoc",srcLang:"srclang",srcSet:"srcset"};function HM(e,t){if(!e.includes("-"))return t;let n;for(let[r,i]of Object.entries(WV))r in t&&(n||(n={...t}),n[i]=n[r],delete n[r]);return n??t}var jV=(e,t,n)=>(0,gu.jsx)(e,typeof e=="string"?HM(e,t):t,n),XV=(e,t,n)=>(0,gu.jsxs)(e,typeof e=="string"?HM(e,t):t,n);function zM(e,t){let n=new ma(e),r=t.runSync(t.parse(n),n);return V1(r),r}function qM(e,t){let n=Sf(CM(W1(e)));return j1(n),t.runSync(n),V1(n),n}function VM(e,t){let{tagToComponentMap:n,streaming:r}=t,i=r?e:PM(LM(e)),o=r?kM(i):i;return y1(o,{Fragment:gu.Fragment,jsx:jV,jsxs:XV,components:n,passKeys:!0,passNode:!0,ignoreInvalidStyle:!0})}var QV=/<(s(h(i(n(y(-(a(s(i(d(e(\s[^<>]*)?)?)?)?)?)?)?)?)?)?)?)?$/;function GM(e){let t=e.match(QV);return!t||t[0]===""?e:e.slice(0,e.length-t[0].length)}function X1(e){if(e)throw e}var Sm=G(JM(),1);function Ff(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Q1(){let e=[],t={run:n,use:r};return t;function n(...i){let o=-1,s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...u){let c=e[++o],f=-1;if(l){s(l);return}for(;++fs.length,l;a&&s.push(i);try{l=e.apply(this,s)}catch(u){let c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}var tO=function(e){let r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o};var ZV={}.hasOwnProperty,tT=class e extends tO{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Q1()}copy(){let t=new e,n=-1;for(;++n0){let[p,...h]=c,g=r[d][1];Ff(g)&&Ff(p)&&(p=(0,Sm.default)(!0,g,p)),r[d]=[u,p,...h]}}}},ba=new tT().freeze();function Z1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function J1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function eT(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function nO(e){if(!Ff(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function rO(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Tm(e){return JV(e)?e:new ma(e)}function JV(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function eG(e){return typeof e=="string"||tG(e)}function tG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var nG={};function ya(e,t){let n=t||nG,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return oO(e,r,i)}function oO(e,t,n){if(rG(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return iO(e.children,t,n)}return Array.isArray(e)?iO(e,t,n):""}function iO(e,t,n){let r=[],i=-1;for(;++ii?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(Bt(e,e.length,0,t),e):t}var aO={}.hasOwnProperty;function xm(e){let t={},n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function Rn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Qt=Ts(/[A-Za-z]/),Ot=Ts(/[\dA-Za-z]/),lO=Ts(/[#-'*+\--9=?A-Z^-~]/);function Ea(e){return e!==null&&(e<32||e===127)}var Hf=Ts(/\d/),uO=Ts(/[\dA-Fa-f]/),cO=Ts(/[!-/:-@[-`{-~]/);function ae(e){return e!==null&&e<-2}function Pe(e){return e!==null&&(e<0||e===32)}function Ee(e){return e===-2||e===-1||e===32}var Ta=Ts(/\p{P}|\p{S}/u),_i=Ts(/\s/);function Ts(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wr(e){let t=[],n=-1,r=0,i=0;for(;++n55295&&o<57344){let a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="\uFFFD"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ye(e,t,n,r){let i=r?r-1:Number.POSITIVE_INFINITY,o=0;return s;function s(l){return Ee(l)?(e.enter(n),a(l)):t(l)}function a(l){return Ee(l)&&o++s))return;let R=t.events.length,O=R,B,C;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(B){C=t.events[O][1].end;break}B=!0}for(b(r),x=R;xT;){let v=n[S];t.containerState=v[1],v[0].exit.call(t,e)}n.length=T}function E(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function lG(e,t,n){return ye(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function mo(e){if(e===null||Pe(e)||_i(e))return 1;if(Ta(e))return 2}function Ss(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let f={...e[r][1].end},d={...e[n][1].start};hO(f,-l),hO(d,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:d},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=zn(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=zn(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=zn(u,Ss(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=zn(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=zn(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Bt(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&Ee(x)?ye(e,E,"linePrefix",o+1)(x):E(x)}function E(x){return x===null||ae(x)?e.check(mO,g,S)(x):(e.enter("codeFlowValue"),T(x))}function T(x){return x===null||ae(x)?(e.exit("codeFlowValue"),E(x)):(e.consume(x),T)}function S(x){return e.exit("codeFenced"),t(x)}function v(x,R,O){let B=0;return C;function C(H){return x.enter("lineEnding"),x.consume(H),x.exit("lineEnding"),V}function V(H){return x.enter("codeFencedFence"),Ee(H)?ye(x,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):Y(H)}function Y(H){return H===a?(x.enter("codeFencedFenceSequence"),q(H)):O(H)}function q(H){return H===a?(B++,x.consume(H),q):B>=s?(x.exit("codeFencedFenceSequence"),Ee(H)?ye(x,L,"whitespace")(H):L(H)):O(H)}function L(H){return H===null||ae(H)?(x.exit("codeFencedFence"),R(H)):O(H)}}}function EG(e,t,n){let r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}var qf={name:"codeIndented",tokenize:SG},TG={partial:!0,tokenize:xG};function SG(e,t,n){let r=this;return i;function i(u){return e.enter("codeIndented"),ye(e,o,"linePrefix",5)(u)}function o(u){let c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ae(u)?e.attempt(TG,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ae(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function xG(e,t,n){let r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ae(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ye(e,o,"linePrefix",5)(s)}function o(s){let a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ae(s)?i(s):n(s)}}var rT={name:"codeText",previous:vG,resolve:_G,tokenize:CG};function _G(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){let i=n||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Vf(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Vf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function km(e,t,n,r,i,o,s,a,l){let u=l||Number.POSITIVE_INFINITY,c=0;return f;function f(b){return b===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(b),e.exit(o),d):b===null||b===32||b===41||Ea(b)?n(b):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(b))}function d(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(e.exit("chunkString"),e.exit(a),d(b)):b===null||b===60||ae(b)?n(b):(e.consume(b),b===92?h:p)}function h(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function g(b){return!c&&(b===null||b===41||Pe(b))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(b)):c999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):ae(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||ae(p)||a++>999?(e.exit("chunkString"),c(p)):(e.consume(p),l||(l=!Ee(p)),p===92?d:f)}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function Om(e,t,n,r,i,o){let s;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),s=d===40?41:d,l):n(d)}function l(d){return d===s?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(e.enter(o),u(d))}function u(d){return d===s?(e.exit(o),l(s)):d===null?n(d):ae(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ye(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===s||d===null||ae(d)?(e.exit("chunkString"),u(d)):(e.consume(d),d===92?f:c)}function f(d){return d===s||d===92?(e.consume(d),c):c(d)}}function Sa(e,t){let n;return r;function r(i){return ae(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ee(i)?ye(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var oT={name:"definition",tokenize:OG},MG={partial:!0,tokenize:DG};function OG(e,t,n){let r=this,i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return Mm.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Rn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return Pe(p)?Sa(e,u)(p):u(p)}function u(p){return km(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(MG,f,f)(p)}function f(p){return Ee(p)?ye(e,d,"whitespace")(p):d(p)}function d(p){return p===null||ae(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function DG(e,t,n){return r;function r(a){return Pe(a)?Sa(e,i)(a):n(a)}function i(a){return Om(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Ee(a)?ye(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ae(a)?t(a):n(a)}}var sT={name:"hardBreakEscape",tokenize:IG};function IG(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ae(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}var aT={name:"headingAtx",resolve:LG,tokenize:PG};function LG(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Bt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function PG(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||Pe(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||ae(c)?(e.exit("atxHeading"),t(c)):Ee(c)?ye(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Pe(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}var gO=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],lT=["pre","script","style","textarea"];var uT={concrete:!0,name:"htmlFlow",resolveTo:FG,tokenize:HG},BG={partial:!0,tokenize:qG},UG={partial:!0,tokenize:zG};function FG(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function HG(e,t,n){let r=this,i,o,s,a,l;return u;function u(A){return c(A)}function c(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),o=!0,g):A===63?(e.consume(A),i=3,r.interrupt?t:_):Qt(A)?(e.consume(A),s=String.fromCharCode(A),y):n(A)}function d(A){return A===45?(e.consume(A),i=2,p):A===91?(e.consume(A),i=5,a=0,h):Qt(A)?(e.consume(A),i=4,r.interrupt?t:_):n(A)}function p(A){return A===45?(e.consume(A),r.interrupt?t:_):n(A)}function h(A){let re="CDATA[";return A===re.charCodeAt(a++)?(e.consume(A),a===re.length?r.interrupt?t:Y:h):n(A)}function g(A){return Qt(A)?(e.consume(A),s=String.fromCharCode(A),y):n(A)}function y(A){if(A===null||A===47||A===62||Pe(A)){let re=A===47,se=s.toLowerCase();return!re&&!o&&lT.includes(se)?(i=1,r.interrupt?t(A):Y(A)):gO.includes(s.toLowerCase())?(i=6,re?(e.consume(A),b):r.interrupt?t(A):Y(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):o?E(A):T(A))}return A===45||Ot(A)?(e.consume(A),s+=String.fromCharCode(A),y):n(A)}function b(A){return A===62?(e.consume(A),r.interrupt?t:Y):n(A)}function E(A){return Ee(A)?(e.consume(A),E):C(A)}function T(A){return A===47?(e.consume(A),C):A===58||A===95||Qt(A)?(e.consume(A),S):Ee(A)?(e.consume(A),T):C(A)}function S(A){return A===45||A===46||A===58||A===95||Ot(A)?(e.consume(A),S):v(A)}function v(A){return A===61?(e.consume(A),x):Ee(A)?(e.consume(A),v):T(A)}function x(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,R):Ee(A)?(e.consume(A),x):O(A)}function R(A){return A===l?(e.consume(A),l=null,B):A===null||ae(A)?n(A):(e.consume(A),R)}function O(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Pe(A)?v(A):(e.consume(A),O)}function B(A){return A===47||A===62||Ee(A)?T(A):n(A)}function C(A){return A===62?(e.consume(A),V):n(A)}function V(A){return A===null||ae(A)?Y(A):Ee(A)?(e.consume(A),V):n(A)}function Y(A){return A===45&&i===2?(e.consume(A),I):A===60&&i===1?(e.consume(A),P):A===62&&i===4?(e.consume(A),te):A===63&&i===3?(e.consume(A),_):A===93&&i===5?(e.consume(A),U):ae(A)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(BG,ne,q)(A)):A===null||ae(A)?(e.exit("htmlFlowData"),q(A)):(e.consume(A),Y)}function q(A){return e.check(UG,L,ne)(A)}function L(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),H}function H(A){return A===null||ae(A)?q(A):(e.enter("htmlFlowData"),Y(A))}function I(A){return A===45?(e.consume(A),_):Y(A)}function P(A){return A===47?(e.consume(A),s="",D):Y(A)}function D(A){if(A===62){let re=s.toLowerCase();return lT.includes(re)?(e.consume(A),te):Y(A)}return Qt(A)&&s.length<8?(e.consume(A),s+=String.fromCharCode(A),D):Y(A)}function U(A){return A===93?(e.consume(A),_):Y(A)}function _(A){return A===62?(e.consume(A),te):A===45&&i===2?(e.consume(A),_):Y(A)}function te(A){return A===null||ae(A)?(e.exit("htmlFlowData"),ne(A)):(e.consume(A),te)}function ne(A){return e.exit("htmlFlow"),t(A)}}function zG(e,t,n){let r=this;return i;function i(s){return ae(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function qG(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(vi,t,n)}}var cT={name:"htmlText",tokenize:VG};function VG(e,t,n){let r=this,i,o,s;return a;function a(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),l}function l(_){return _===33?(e.consume(_),u):_===47?(e.consume(_),v):_===63?(e.consume(_),T):Qt(_)?(e.consume(_),O):n(_)}function u(_){return _===45?(e.consume(_),c):_===91?(e.consume(_),o=0,h):Qt(_)?(e.consume(_),E):n(_)}function c(_){return _===45?(e.consume(_),p):n(_)}function f(_){return _===null?n(_):_===45?(e.consume(_),d):ae(_)?(s=f,P(_)):(e.consume(_),f)}function d(_){return _===45?(e.consume(_),p):f(_)}function p(_){return _===62?I(_):_===45?d(_):f(_)}function h(_){let te="CDATA[";return _===te.charCodeAt(o++)?(e.consume(_),o===te.length?g:h):n(_)}function g(_){return _===null?n(_):_===93?(e.consume(_),y):ae(_)?(s=g,P(_)):(e.consume(_),g)}function y(_){return _===93?(e.consume(_),b):g(_)}function b(_){return _===62?I(_):_===93?(e.consume(_),b):g(_)}function E(_){return _===null||_===62?I(_):ae(_)?(s=E,P(_)):(e.consume(_),E)}function T(_){return _===null?n(_):_===63?(e.consume(_),S):ae(_)?(s=T,P(_)):(e.consume(_),T)}function S(_){return _===62?I(_):T(_)}function v(_){return Qt(_)?(e.consume(_),x):n(_)}function x(_){return _===45||Ot(_)?(e.consume(_),x):R(_)}function R(_){return ae(_)?(s=R,P(_)):Ee(_)?(e.consume(_),R):I(_)}function O(_){return _===45||Ot(_)?(e.consume(_),O):_===47||_===62||Pe(_)?B(_):n(_)}function B(_){return _===47?(e.consume(_),I):_===58||_===95||Qt(_)?(e.consume(_),C):ae(_)?(s=B,P(_)):Ee(_)?(e.consume(_),B):I(_)}function C(_){return _===45||_===46||_===58||_===95||Ot(_)?(e.consume(_),C):V(_)}function V(_){return _===61?(e.consume(_),Y):ae(_)?(s=V,P(_)):Ee(_)?(e.consume(_),V):B(_)}function Y(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),i=_,q):ae(_)?(s=Y,P(_)):Ee(_)?(e.consume(_),Y):(e.consume(_),L)}function q(_){return _===i?(e.consume(_),i=void 0,H):_===null?n(_):ae(_)?(s=q,P(_)):(e.consume(_),q)}function L(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||Pe(_)?B(_):(e.consume(_),L)}function H(_){return _===47||_===62||Pe(_)?B(_):n(_)}function I(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function P(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),D}function D(_){return Ee(_)?ye(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):U(_)}function U(_){return e.enter("htmlTextData"),s(_)}}var xa={name:"labelEnd",resolveAll:$G,resolveTo:WG,tokenize:jG},GG={tokenize:XG},KG={tokenize:QG},YG={tokenize:ZG};function $G(e){let t=-1,n=[];for(;++t=3&&(u===null||ae(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Ee(u)?ye(e,a,"whitespace")(u):a(u))}}var kn={continuation:{tokenize:sK},exit:lK,name:"list",tokenize:oK},rK={partial:!0,tokenize:uK},iK={partial:!0,tokenize:aK};function oK(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){let h=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Hf(p)){if(r.containerState.type||(r.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(_a,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Hf(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(vi,r.interrupt?n:c,e.attempt(rK,d,f))}function c(p){return r.containerState.initialBlankLine=!0,o++,d(p)}function f(p){return Ee(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),d):n(p)}function d(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function sK(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(vi,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ye(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Ee(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(iK,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ye(e,e.attempt(kn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function aK(e,t,n){let r=this;return ye(e,i,"listItemIndent",r.containerState.size+1);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function lK(e){e.exit(this.containerState.type)}function uK(e,t,n){let r=this;return ye(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=r.events[r.events.length-1];return!Ee(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}var Dm={name:"setextUnderline",resolveTo:cK,tokenize:fK};function cK(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);let s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function fK(e,t,n){let r=this,i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),Ee(u)?ye(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ae(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}var bO={tokenize:dK};function dK(e){let t=this,n=e.attempt(vi,r,e.attempt(this.parser.constructs.flowInitial,i,ye(e,e.attempt(this.parser.constructs.flow,i,e.attempt(iT,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var yO={resolveAll:xO()},EO=SO("string"),TO=SO("text");function SO(e){return{resolveAll:xO(e==="text"?pK:void 0),tokenize:t};function t(n){let r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(c){return u(c)?o(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;let f=i[c],d=-1;if(f)for(;++dSK,contentInitial:()=>mK,disable:()=>xK,document:()=>hK,flow:()=>bK,flowInitial:()=>gK,insideSpan:()=>TK,string:()=>yK,text:()=>EK});var hK={42:kn,43:kn,45:kn,48:kn,49:kn,50:kn,51:kn,52:kn,53:kn,54:kn,55:kn,56:kn,57:kn,62:vm},mK={91:oT},gK={[-2]:qf,[-1]:qf,32:qf},bK={35:aT,42:_a,45:[Dm,_a],60:uT,61:Dm,95:_a,96:Nm,126:Nm},yK={38:Am,92:Cm},EK={[-5]:Gf,[-4]:Gf,[-3]:Gf,33:fT,38:Am,42:zf,60:[nT,cT],91:dT,92:[sT,Cm],93:xa,95:zf,96:rT},TK={null:[zf,yO]},SK={null:[42,95]},xK={null:[]};function _O(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},o=[],s=[],a=[],l=!0,u={attempt:B(R),check:B(O),consume:S,enter:v,exit:x,interrupt:B(O,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:y,parser:e,previous:null,sliceSerialize:h,sliceStream:g,write:p},f=t.tokenize.call(c,u),d;return t.resolveAll&&o.push(t),c;function p(q){return s=zn(s,q),E(),s[s.length-1]!==null?[]:(C(t,0),c.events=Ss(o,c.events,c),c.events)}function h(q,L){return vK(g(q),L)}function g(q){return _K(s,q)}function y(){let{_bufferIndex:q,_index:L,line:H,column:I,offset:P}=r;return{_bufferIndex:q,_index:L,line:H,column:I,offset:P}}function b(q){i[q.line]=q.column,Y()}function E(){let q;for(;r._index-1){let a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function vK(e,t){let n=-1,r=[],i;for(;++n\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function ik(e,t,n,r){let i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags,s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),a=[],l;i.space==="html"&&e.tagName==="svg"&&(r.schema=An);let u=BH(r,e.properties),c=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,c&&(s=!1),(u||!o||!rk(e,t,n))&&(a.push("<",e.tagName,u?" "+u:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!s&&(!o||!gf(e,t,n))&&a.push(""),a.join("")}function BH(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let o=UH(e,i,t[i]);o&&n.push(o)}}for(;++rau(n,e.alternative)&&(s=e.alternative),a=s+po(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Gh.single:Gh.double)[i][o],attribute:!0}))+s),l+(a&&"="+a))}var FH=["<","&"];function Kh(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:po(e.value,Object.assign({},r.settings.characterReferences,{subset:FH}))}function ok(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Kh(e,t,n,r)}function sk(e,t,n,r){return r.all(e)}var ak=su("type",{invalid:HH,unknown:zH,handlers:{comment:QR,doctype:ZR,element:ik,raw:ok,root:sk,text:Kh}});function HH(e){throw new Error("Expected node, not `"+e+"`")}function zH(e){let t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}var qH={},VH={},GH=[];function bf(e,t){let n=t||qH,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:KH,all:YH,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Bh,characterReferences:n.characterReferences||VH,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?An:ri,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function KH(e,t,n){return ak(e,t,n,this)}function YH(e){let t=[],n=e&&e.children||GH,r=-1;for(;++r0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Ef(e){let t=or(e),n=pa(e);if(t&&n)return{start:t,end:n}}function hs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Tk(e.position):"start"in e||"end"in e?Tk(e):"line"in e||"column"in e?g1(e):""}function g1(e){return Sk(e&&e.line)+":"+Sk(e&&e.column)}function Tk(e){return g1(e&&e.start)+"-"+g1(e&&e.end)}function Sk(e){return e&&typeof e=="number"?e:1}var Pt=class extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){let l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){let l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}let a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=hs(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Pt.prototype.file="";Pt.prototype.name="";Pt.prototype.reason="";Pt.prototype.message="";Pt.prototype.stack="";Pt.prototype.column=void 0;Pt.prototype.line=void 0;Pt.prototype.ancestors=void 0;Pt.prototype.cause=void 0;Pt.prototype.fatal=void 0;Pt.prototype.place=void 0;Pt.prototype.ruleId=void 0;Pt.prototype.source=void 0;var b1={}.hasOwnProperty,Sz=new Map,xz=/[A-Z]/g,_z=new Set(["table","tbody","thead","tfoot","tr"]),vz=new Set(["td","th"]),_k="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function y1(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Oz(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Mz(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?An:ri,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=vk(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function vk(e,t,n){if(t.type==="element")return Cz(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Az(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return wz(e,t,n);if(t.type==="mdxjsEsm")return Nz(e,t);if(t.type==="root")return Rz(e,t,n);if(t.type==="text")return kz(e,t)}function Cz(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=An,e.schema=i),e.ancestors.push(t);let o=Ak(e,t.tagName,!1),s=Dz(e,t),a=T1(e,t);return _z.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!ho(l):!0})),Ck(e,s,o,t),E1(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Az(e,t){if(t.data&&t.data.estree&&e.evaluater){let r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Tf(e,t.position)}function Nz(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Tf(e,t.position)}function wz(e,t,n){let r=e.schema,i=r;t.name==="svg"&&r.space==="html"&&(i=An,e.schema=i),e.ancestors.push(t);let o=t.name===null?e.Fragment:Ak(e,t.name,!0),s=Iz(e,t),a=T1(e,t);return Ck(e,s,o,t),E1(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Rz(e,t,n){let r={};return E1(r,T1(e,t)),e.create(t,e.Fragment,r,n)}function kz(e,t){return t.value}function Ck(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function E1(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Mz(e,t,n){return r;function r(i,o,s,a){let u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function Oz(e,t){return n;function n(r,i,o,s){let a=Array.isArray(o.children),l=or(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Dz(e,t){let n={},r,i;for(i in t.properties)if(i!=="children"&&b1.call(t.properties,i)){let o=Lz(e,i,t.properties[i]);if(o){let[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&vz.has(t.tagName)?r=a:n[s]=a}}if(r){let o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Iz(e,t){let n={};for(let r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){let o=r.data.estree.body[0];o.type;let s=o.expression;s.type;let a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Tf(e,t.position);else{let i=r.name,o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){let a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else Tf(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function T1(e,t){let n=[],r=-1,i=e.passKeys?new Map:Sz;for(;++r-1&&o<=t.length){let s=0;for(;;){let a=n[s];if(a===void 0){let l=kk(t,n[s-1]);a=l===-1?t.length+1:l+1,n[s]=a}if(a>o)return{line:s+1,column:o-(s>0?n[s-1]:0)+1,offset:o};s++}}}function i(o){if(o&&typeof o.line=="number"&&typeof o.column=="number"&&!Number.isNaN(o.line)&&!Number.isNaN(o.column)){for(;n.length1?n[o.line-2]:0)+o.column-1;if(s=55296&&e<=57343}function Bk(e){return e>=56320&&e<=57343}function Uk(e,t){return(e-55296)*1024+9216+t}function Qh(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Zh(e){return e>=64976&&e<=65007||jz.has(e)}var K;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(K||(K={}));var Qz=65536,Jh=class{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Qz,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){let{line:r,col:i,offset:o}=this,s=i+n,a=o+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:a,endOffset:a}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){let n=this.html.charCodeAt(this.pos+1);if(Bk(n))return this.pos++,this._addGap(),Uk(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,N.EOF;return this._err(K.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,N.EOF;let r=this.html.charCodeAt(n);return r===N.CARRIAGE_RETURN?N.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,N.EOF;let t=this.html.charCodeAt(this.pos);return t===N.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,N.LINE_FEED):t===N.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Xh(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===N.LINE_FEED||t===N.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Qh(t)?this._err(K.controlCharacterInInputStream):Zh(t)&&this._err(K.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.posHe,getTokenAttr:()=>xf});var He;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(He||(He={}));function xf(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var em=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(e=>e.charCodeAt(0)));var w1,Zz=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Fk=(w1=String.fromCodePoint)!==null&&w1!==void 0?w1:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function R1(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Zz.get(e))!==null&&t!==void 0?t:e}var rn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(rn||(rn={}));var e7=32,gs;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(gs||(gs={}));function k1(e){return e>=rn.ZERO&&e<=rn.NINE}function t7(e){return e>=rn.UPPER_A&&e<=rn.UPPER_F||e>=rn.LOWER_A&&e<=rn.LOWER_F}function n7(e){return e>=rn.UPPER_A&&e<=rn.UPPER_Z||e>=rn.LOWER_A&&e<=rn.LOWER_Z||k1(e)}function r7(e){return e===rn.EQUALS||n7(e)}var nn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(nn||(nn={}));var Ti;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ti||(Ti={}));var tm=class{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=nn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ti.Strict}startEntity(t){this.decodeMode=t,this.state=nn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case nn.EntityStart:return t.charCodeAt(n)===rn.NUM?(this.state=nn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=nn.NamedEntity,this.stateNamedEntity(t,n));case nn.NumericStart:return this.stateNumericStart(t,n);case nn.NumericDecimal:return this.stateNumericDecimal(t,n);case nn.NumericHex:return this.stateNumericHex(t,n);case nn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|e7)===rn.LOWER_X?(this.state=nn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=nn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){let o=r-n;this.result=this.result*Math.pow(i,o)+Number.parseInt(t.substr(n,o),i),this.consumed+=o}}stateNumericHex(t,n){let r=n;for(;n>14;for(;n>14,o!==0){if(s===rn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Ti.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;let{result:n,decodeTree:r}=this,i=(r[n]&gs.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){let{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~gs.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case nn.NamedEntity:return this.result!==0&&(this.decodeMode!==Ti.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case nn.NumericDecimal:return this.emitNumericEntity(0,2);case nn.NumericHex:return this.emitNumericEntity(0,3);case nn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case nn.EntityStart:return 0}}};function i7(e,t,n,r){let i=(t&gs.BRANCH_LENGTH)>>7,o=t&gs.JUMP_TABLE;if(i===0)return o!==0&&r===o?n:-1;if(o){let l=r-o;return l<0||l>=i?-1:e[n+l]-1}let s=n,a=s+i-1;for(;s<=a;){let l=s+a>>>1,u=e[l];if(ur)a=l-1;else return e[l+i]}return-1}var _f={};Wd(_f,{ATTRS:()=>Si,DOCUMENT_MODE:()=>Nn,NS:()=>X,NUMBERED_HEADERS:()=>fu,SPECIAL_ELEMENTS:()=>M1,TAG_ID:()=>m,TAG_NAMES:()=>z,getTagID:()=>bs,hasUnescapedText:()=>Hk});var X;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(X||(X={}));var Si;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Si||(Si={}));var Nn;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Nn||(Nn={}));var z;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(z||(z={}));var m;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(m||(m={}));var o7=new Map([[z.A,m.A],[z.ADDRESS,m.ADDRESS],[z.ANNOTATION_XML,m.ANNOTATION_XML],[z.APPLET,m.APPLET],[z.AREA,m.AREA],[z.ARTICLE,m.ARTICLE],[z.ASIDE,m.ASIDE],[z.B,m.B],[z.BASE,m.BASE],[z.BASEFONT,m.BASEFONT],[z.BGSOUND,m.BGSOUND],[z.BIG,m.BIG],[z.BLOCKQUOTE,m.BLOCKQUOTE],[z.BODY,m.BODY],[z.BR,m.BR],[z.BUTTON,m.BUTTON],[z.CAPTION,m.CAPTION],[z.CENTER,m.CENTER],[z.CODE,m.CODE],[z.COL,m.COL],[z.COLGROUP,m.COLGROUP],[z.DD,m.DD],[z.DESC,m.DESC],[z.DETAILS,m.DETAILS],[z.DIALOG,m.DIALOG],[z.DIR,m.DIR],[z.DIV,m.DIV],[z.DL,m.DL],[z.DT,m.DT],[z.EM,m.EM],[z.EMBED,m.EMBED],[z.FIELDSET,m.FIELDSET],[z.FIGCAPTION,m.FIGCAPTION],[z.FIGURE,m.FIGURE],[z.FONT,m.FONT],[z.FOOTER,m.FOOTER],[z.FOREIGN_OBJECT,m.FOREIGN_OBJECT],[z.FORM,m.FORM],[z.FRAME,m.FRAME],[z.FRAMESET,m.FRAMESET],[z.H1,m.H1],[z.H2,m.H2],[z.H3,m.H3],[z.H4,m.H4],[z.H5,m.H5],[z.H6,m.H6],[z.HEAD,m.HEAD],[z.HEADER,m.HEADER],[z.HGROUP,m.HGROUP],[z.HR,m.HR],[z.HTML,m.HTML],[z.I,m.I],[z.IMG,m.IMG],[z.IMAGE,m.IMAGE],[z.INPUT,m.INPUT],[z.IFRAME,m.IFRAME],[z.KEYGEN,m.KEYGEN],[z.LABEL,m.LABEL],[z.LI,m.LI],[z.LINK,m.LINK],[z.LISTING,m.LISTING],[z.MAIN,m.MAIN],[z.MALIGNMARK,m.MALIGNMARK],[z.MARQUEE,m.MARQUEE],[z.MATH,m.MATH],[z.MENU,m.MENU],[z.META,m.META],[z.MGLYPH,m.MGLYPH],[z.MI,m.MI],[z.MO,m.MO],[z.MN,m.MN],[z.MS,m.MS],[z.MTEXT,m.MTEXT],[z.NAV,m.NAV],[z.NOBR,m.NOBR],[z.NOFRAMES,m.NOFRAMES],[z.NOEMBED,m.NOEMBED],[z.NOSCRIPT,m.NOSCRIPT],[z.OBJECT,m.OBJECT],[z.OL,m.OL],[z.OPTGROUP,m.OPTGROUP],[z.OPTION,m.OPTION],[z.P,m.P],[z.PARAM,m.PARAM],[z.PLAINTEXT,m.PLAINTEXT],[z.PRE,m.PRE],[z.RB,m.RB],[z.RP,m.RP],[z.RT,m.RT],[z.RTC,m.RTC],[z.RUBY,m.RUBY],[z.S,m.S],[z.SCRIPT,m.SCRIPT],[z.SEARCH,m.SEARCH],[z.SECTION,m.SECTION],[z.SELECT,m.SELECT],[z.SOURCE,m.SOURCE],[z.SMALL,m.SMALL],[z.SPAN,m.SPAN],[z.STRIKE,m.STRIKE],[z.STRONG,m.STRONG],[z.STYLE,m.STYLE],[z.SUB,m.SUB],[z.SUMMARY,m.SUMMARY],[z.SUP,m.SUP],[z.TABLE,m.TABLE],[z.TBODY,m.TBODY],[z.TEMPLATE,m.TEMPLATE],[z.TEXTAREA,m.TEXTAREA],[z.TFOOT,m.TFOOT],[z.TD,m.TD],[z.TH,m.TH],[z.THEAD,m.THEAD],[z.TITLE,m.TITLE],[z.TR,m.TR],[z.TRACK,m.TRACK],[z.TT,m.TT],[z.U,m.U],[z.UL,m.UL],[z.SVG,m.SVG],[z.VAR,m.VAR],[z.WBR,m.WBR],[z.XMP,m.XMP]]);function bs(e){var t;return(t=o7.get(e))!==null&&t!==void 0?t:m.UNKNOWN}var Z=m,M1={[X.HTML]:new Set([Z.ADDRESS,Z.APPLET,Z.AREA,Z.ARTICLE,Z.ASIDE,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BLOCKQUOTE,Z.BODY,Z.BR,Z.BUTTON,Z.CAPTION,Z.CENTER,Z.COL,Z.COLGROUP,Z.DD,Z.DETAILS,Z.DIR,Z.DIV,Z.DL,Z.DT,Z.EMBED,Z.FIELDSET,Z.FIGCAPTION,Z.FIGURE,Z.FOOTER,Z.FORM,Z.FRAME,Z.FRAMESET,Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6,Z.HEAD,Z.HEADER,Z.HGROUP,Z.HR,Z.HTML,Z.IFRAME,Z.IMG,Z.INPUT,Z.LI,Z.LINK,Z.LISTING,Z.MAIN,Z.MARQUEE,Z.MENU,Z.META,Z.NAV,Z.NOEMBED,Z.NOFRAMES,Z.NOSCRIPT,Z.OBJECT,Z.OL,Z.P,Z.PARAM,Z.PLAINTEXT,Z.PRE,Z.SCRIPT,Z.SECTION,Z.SELECT,Z.SOURCE,Z.STYLE,Z.SUMMARY,Z.TABLE,Z.TBODY,Z.TD,Z.TEMPLATE,Z.TEXTAREA,Z.TFOOT,Z.TH,Z.THEAD,Z.TITLE,Z.TR,Z.TRACK,Z.UL,Z.WBR,Z.XMP]),[X.MATHML]:new Set([Z.MI,Z.MO,Z.MN,Z.MS,Z.MTEXT,Z.ANNOTATION_XML]),[X.SVG]:new Set([Z.TITLE,Z.FOREIGN_OBJECT,Z.DESC]),[X.XLINK]:new Set,[X.XML]:new Set,[X.XMLNS]:new Set},fu=new Set([Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6]),s7=new Set([z.STYLE,z.SCRIPT,z.XMP,z.IFRAME,z.NOEMBED,z.NOFRAMES,z.PLAINTEXT]);function Hk(e,t){return s7.has(e)||t&&e===z.NOSCRIPT}var k;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(k||(k={}));var Ct={DATA:k.DATA,RCDATA:k.RCDATA,RAWTEXT:k.RAWTEXT,SCRIPT_DATA:k.SCRIPT_DATA,PLAINTEXT:k.PLAINTEXT,CDATA_SECTION:k.CDATA_SECTION};function a7(e){return e>=N.DIGIT_0&&e<=N.DIGIT_9}function vf(e){return e>=N.LATIN_CAPITAL_A&&e<=N.LATIN_CAPITAL_Z}function l7(e){return e>=N.LATIN_SMALL_A&&e<=N.LATIN_SMALL_Z}function ys(e){return l7(e)||vf(e)}function zk(e){return ys(e)||a7(e)}function nm(e){return e+32}function Vk(e){return e===N.SPACE||e===N.LINE_FEED||e===N.TABULATION||e===N.FORM_FEED}function qk(e){return Vk(e)||e===N.SOLIDUS||e===N.GREATER_THAN_SIGN}function u7(e){return e===N.NULL?K.nullCharacterReference:e>1114111?K.characterReferenceOutsideUnicodeRange:Xh(e)?K.surrogateCharacterReference:Zh(e)?K.noncharacterCharacterReference:Qh(e)||e===N.CARRIAGE_RETURN?K.controlCharacterReference:null}var Cf=class{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=k.DATA,this.returnState=k.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Jh(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new tm(em,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(K.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(K.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{let i=u7(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(K.endTagWithAttributes),t.selfClosing&&this._err(K.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case He.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case He.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case He.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){let t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:He.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){let n=Vk(t)?He.WHITESPACE_CHARACTER:t===N.NULL?He.NULL_CHARACTER:He.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(He.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=k.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ti.Attribute:Ti.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===k.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===k.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===k.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case k.DATA:{this._stateData(t);break}case k.RCDATA:{this._stateRcdata(t);break}case k.RAWTEXT:{this._stateRawtext(t);break}case k.SCRIPT_DATA:{this._stateScriptData(t);break}case k.PLAINTEXT:{this._statePlaintext(t);break}case k.TAG_OPEN:{this._stateTagOpen(t);break}case k.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case k.TAG_NAME:{this._stateTagName(t);break}case k.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case k.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case k.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case k.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case k.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case k.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case k.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case k.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case k.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case k.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case k.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case k.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case k.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case k.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case k.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case k.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case k.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case k.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case k.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case k.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case k.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case k.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case k.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case k.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case k.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case k.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case k.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case k.BOGUS_COMMENT:{this._stateBogusComment(t);break}case k.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case k.COMMENT_START:{this._stateCommentStart(t);break}case k.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case k.COMMENT:{this._stateComment(t);break}case k.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case k.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case k.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case k.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case k.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case k.COMMENT_END:{this._stateCommentEnd(t);break}case k.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case k.DOCTYPE:{this._stateDoctype(t);break}case k.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case k.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case k.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case k.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case k.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case k.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case k.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case k.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case k.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case k.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case k.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case k.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case k.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case k.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case k.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case k.CDATA_SECTION:{this._stateCdataSection(t);break}case k.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case k.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case k.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case k.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case N.LESS_THAN_SIGN:{this.state=k.TAG_OPEN;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(K.unexpectedNullCharacter),this._emitCodePoint(t);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case N.AMPERSAND:{this._startCharacterReference();break}case N.LESS_THAN_SIGN:{this.state=k.RCDATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(K.unexpectedNullCharacter),this._emitChars(dt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case N.LESS_THAN_SIGN:{this.state=k.RAWTEXT_LESS_THAN_SIGN;break}case N.NULL:{this._err(K.unexpectedNullCharacter),this._emitChars(dt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case N.LESS_THAN_SIGN:{this.state=k.SCRIPT_DATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(K.unexpectedNullCharacter),this._emitChars(dt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case N.NULL:{this._err(K.unexpectedNullCharacter),this._emitChars(dt);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ys(t))this._createStartTagToken(),this.state=k.TAG_NAME,this._stateTagName(t);else switch(t){case N.EXCLAMATION_MARK:{this.state=k.MARKUP_DECLARATION_OPEN;break}case N.SOLIDUS:{this.state=k.END_TAG_OPEN;break}case N.QUESTION_MARK:{this._err(K.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=k.BOGUS_COMMENT,this._stateBogusComment(t);break}case N.EOF:{this._err(K.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(K.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=k.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ys(t))this._createEndTagToken(),this.state=k.TAG_NAME,this._stateTagName(t);else switch(t){case N.GREATER_THAN_SIGN:{this._err(K.missingEndTagName),this.state=k.DATA;break}case N.EOF:{this._err(K.eofBeforeTagName),this._emitChars("");break}case N.NULL:{this._err(K.unexpectedNullCharacter),this.state=k.SCRIPT_DATA_ESCAPED,this._emitChars(dt);break}case N.EOF:{this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=k.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===N.SOLIDUS?this.state=k.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ys(t)?(this._emitChars("<"),this.state=k.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=k.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ys(t)?(this.state=k.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case N.NULL:{this._err(K.unexpectedNullCharacter),this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(dt);break}case N.EOF:{this._err(K.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===N.SOLIDUS?(this.state=k.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=k.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Fn.SCRIPT,!1)&&qk(this.preprocessor.peek(Fn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){let r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){let i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==X.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){let n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){let r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(h7,X.HTML)}clearBackToTableBodyContext(){this.clearBackTo(p7,X.HTML)}clearBackToTableRowContext(){this.clearBackTo(d7,X.HTML)}remove(t){let n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===m.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){let n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===m.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){let i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case X.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case X.SVG:{if(Yk.has(i))return!1;break}case X.MATHML:{if(Kk.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,rm)}hasInListItemScope(t){return this.hasInDynamicScope(t,c7)}hasInButtonScope(t){return this.hasInDynamicScope(t,f7)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){let n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case X.HTML:{if(fu.has(n))return!0;if(rm.has(n))return!1;break}case X.SVG:{if(Yk.has(n))return!1;break}case X.MATHML:{if(Kk.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===X.HTML)switch(this.tagIDs[n]){case t:return!0;case m.TABLE:case m.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===X.HTML)switch(this.tagIDs[t]){case m.TBODY:case m.THEAD:case m.TFOOT:return!0;case m.TABLE:case m.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===X.HTML)switch(this.tagIDs[n]){case t:return!0;case m.OPTION:case m.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&$k.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Gk.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Gk.has(this.currentTagId);)this.pop()}};var ii;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(ii||(ii={}));var Wk={type:ii.Marker},om=class{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){let r=[],i=n.length,o=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let a=0;a[s.name,s.value])),o=0;for(let s=0;si.get(l.name)===l.value)&&(o+=1,o>=3&&this.entries.splice(a.idx,1))}}insertMarker(){this.entries.unshift(Wk)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:ii.Element,element:t,token:n})}insertElementAfterBookmark(t,n){let r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:ii.Element,element:t,token:n})}removeEntry(t){let n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){let t=this.entries.indexOf(Wk);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){let n=this.entries.find(r=>r.type===ii.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===ii.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===ii.Element&&n.element===t)}};var oi={createDocument(){return{nodeName:"#document",mode:Nn.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(o=>o.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{let o={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};oi.appendChild(e,o)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(oi.isTextNode(n)){n.value+=t;return}}oi.appendChild(e,oi.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&oi.isTextNode(r)?r.value+=t:oi.insertBefore(e,oi.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function Jk(e){return e.name===Xk&&e.publicId===null&&(e.systemId===null||e.systemId===g7)}function eM(e){if(e.name!==Xk)return Nn.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===b7)return Nn.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),E7.has(n))return Nn.QUIRKS;let r=t===null?y7:Qk;if(jk(n,r))return Nn.QUIRKS;if(r=t===null?Zk:T7,jk(n,r))return Nn.LIMITED_QUIRKS}return Nn.NO_QUIRKS}var tM={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},x7="definitionurl",_7="definitionURL",v7=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),C7=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:X.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:X.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:X.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:X.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:X.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:X.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:X.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:X.XML}],["xml:space",{prefix:"xml",name:"space",namespace:X.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:X.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:X.XMLNS}]]),A7=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),N7=new Set([m.B,m.BIG,m.BLOCKQUOTE,m.BODY,m.BR,m.CENTER,m.CODE,m.DD,m.DIV,m.DL,m.DT,m.EM,m.EMBED,m.H1,m.H2,m.H3,m.H4,m.H5,m.H6,m.HEAD,m.HR,m.I,m.IMG,m.LI,m.LISTING,m.MENU,m.META,m.NOBR,m.OL,m.P,m.PRE,m.RUBY,m.S,m.SMALL,m.SPAN,m.STRONG,m.STRIKE,m.SUB,m.SUP,m.TABLE,m.TT,m.U,m.UL,m.VAR]);function nM(e){let t=e.tagID;return t===m.FONT&&e.attrs.some(({name:r})=>r===Si.COLOR||r===Si.SIZE||r===Si.FACE)||N7.has(t)}function O1(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let o,s;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,s=this.fragmentContextID):{current:o,currentTagId:s}=this.openElements,this._setContextModes(o,s)}}_setContextModes(t,n){let r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===X.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,X.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=M.TEXT}switchToPlaintextParsing(){this.insertionMode=M.TEXT,this.originalInsertionMode=M.IN_BODY,this.tokenizer.state=Ct.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===z.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==X.HTML))switch(this.fragmentContextID){case m.TITLE:case m.TEXTAREA:{this.tokenizer.state=Ct.RCDATA;break}case m.STYLE:case m.XMP:case m.IFRAME:case m.NOEMBED:case m.NOFRAMES:case m.NOSCRIPT:{this.tokenizer.state=Ct.RAWTEXT;break}case m.SCRIPT:{this.tokenizer.state=Ct.SCRIPT_DATA;break}case m.PLAINTEXT:{this.tokenizer.state=Ct.PLAINTEXT;break}default:}}_setDocumentType(t){let n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){let s=this.treeAdapter.getChildNodes(this.document).find(a=>this.treeAdapter.isDocumentTypeNode(a));s&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){let r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{let r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){let r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){let r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){let r=this.treeAdapter.createElement(t,X.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){let n=this.treeAdapter.createElement(t.tagName,X.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){let t=this.treeAdapter.createElement(z.HTML,X.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,m.HTML)}_appendCommentNode(t,n){let r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;let i=this.treeAdapter.getChildNodes(n),o=r?i.lastIndexOf(r):i.length,s=i[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){let{endLine:l,endCol:u,endOffset:c}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:l,endCol:u,endOffset:c})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){let r=n.location,i=this.treeAdapter.getTagName(t),o=n.type===He.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,o)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===m.SVG&&this.treeAdapter.getTagName(n)===z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===X.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===m.MGLYPH||t.tagID===m.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,X.HTML)}_processToken(t){switch(t.type){case He.CHARACTER:{this.onCharacter(t);break}case He.NULL_CHARACTER:{this.onNullCharacter(t);break}case He.COMMENT:{this.onComment(t);break}case He.DOCTYPE:{this.onDoctype(t);break}case He.START_TAG:{this._processStartTag(t);break}case He.END_TAG:{this.onEndTag(t);break}case He.EOF:{this.onEof(t);break}case He.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){let i=this.treeAdapter.getNamespaceURI(n),o=this.treeAdapter.getAttrList(n);return iM(t,i,o,r)}_reconstructActiveFormattingElements(){let t=this.activeFormattingElements.entries.length;if(t){let n=this.activeFormattingElements.entries.findIndex(i=>i.type===ii.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){let o=this.activeFormattingElements.entries[i];this._insertElement(o.token,this.treeAdapter.getNamespaceURI(o.element)),o.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=M.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(m.P),this.openElements.popUntilTagNamePopped(m.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case m.TR:{this.insertionMode=M.IN_ROW;return}case m.TBODY:case m.THEAD:case m.TFOOT:{this.insertionMode=M.IN_TABLE_BODY;return}case m.CAPTION:{this.insertionMode=M.IN_CAPTION;return}case m.COLGROUP:{this.insertionMode=M.IN_COLUMN_GROUP;return}case m.TABLE:{this.insertionMode=M.IN_TABLE;return}case m.BODY:{this.insertionMode=M.IN_BODY;return}case m.FRAMESET:{this.insertionMode=M.IN_FRAMESET;return}case m.SELECT:{this._resetInsertionModeForSelect(t);return}case m.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case m.HTML:{this.insertionMode=this.headElement?M.AFTER_HEAD:M.BEFORE_HEAD;return}case m.TD:case m.TH:{if(t>0){this.insertionMode=M.IN_CELL;return}break}case m.HEAD:{if(t>0){this.insertionMode=M.IN_HEAD;return}break}}this.insertionMode=M.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){let r=this.openElements.tagIDs[n];if(r===m.TEMPLATE)break;if(r===m.TABLE){this.insertionMode=M.IN_SELECT_IN_TABLE;return}}this.insertionMode=M.IN_SELECT}_isElementCausesFosterParenting(t){return uM.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){let n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case m.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===X.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case m.TABLE:{let r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){let n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){let r=this.treeAdapter.getNamespaceURI(t);return M1[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){uV(this,t);return}switch(this.insertionMode){case M.INITIAL:{Af(this,t);break}case M.BEFORE_HTML:{wf(this,t);break}case M.BEFORE_HEAD:{Rf(this,t);break}case M.IN_HEAD:{kf(this,t);break}case M.IN_HEAD_NO_SCRIPT:{Mf(this,t);break}case M.AFTER_HEAD:{Of(this,t);break}case M.IN_BODY:case M.IN_CAPTION:case M.IN_CELL:case M.IN_TEMPLATE:{fM(this,t);break}case M.TEXT:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{I1(this,t);break}case M.IN_TABLE_TEXT:{bM(this,t);break}case M.IN_COLUMN_GROUP:{lm(this,t);break}case M.AFTER_BODY:{um(this,t);break}case M.AFTER_AFTER_BODY:{am(this,t);break}default:}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){lV(this,t);return}switch(this.insertionMode){case M.INITIAL:{Af(this,t);break}case M.BEFORE_HTML:{wf(this,t);break}case M.BEFORE_HEAD:{Rf(this,t);break}case M.IN_HEAD:{kf(this,t);break}case M.IN_HEAD_NO_SCRIPT:{Mf(this,t);break}case M.AFTER_HEAD:{Of(this,t);break}case M.TEXT:{this._insertCharacters(t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{I1(this,t);break}case M.IN_COLUMN_GROUP:{lm(this,t);break}case M.AFTER_BODY:{um(this,t);break}case M.AFTER_AFTER_BODY:{am(this,t);break}default:}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){L1(this,t);return}switch(this.insertionMode){case M.INITIAL:case M.BEFORE_HTML:case M.BEFORE_HEAD:case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:case M.IN_BODY:case M.IN_TABLE:case M.IN_CAPTION:case M.IN_COLUMN_GROUP:case M.IN_TABLE_BODY:case M.IN_ROW:case M.IN_CELL:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:case M.IN_TEMPLATE:case M.IN_FRAMESET:case M.AFTER_FRAMESET:{L1(this,t);break}case M.IN_TABLE_TEXT:{Nf(this,t);break}case M.AFTER_BODY:{H7(this,t);break}case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{z7(this,t);break}default:}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case M.INITIAL:{q7(this,t);break}case M.BEFORE_HEAD:case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:{this._err(t,K.misplacedDoctype);break}case M.IN_TABLE_TEXT:{Nf(this,t);break}default:}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,K.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?cV(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case M.INITIAL:{Af(this,t);break}case M.BEFORE_HTML:{V7(this,t);break}case M.BEFORE_HEAD:{K7(this,t);break}case M.IN_HEAD:{si(this,t);break}case M.IN_HEAD_NO_SCRIPT:{W7(this,t);break}case M.AFTER_HEAD:{X7(this,t);break}case M.IN_BODY:{wn(this,t);break}case M.IN_TABLE:{du(this,t);break}case M.IN_TABLE_TEXT:{Nf(this,t);break}case M.IN_CAPTION:{Yq(this,t);break}case M.IN_COLUMN_GROUP:{F1(this,t);break}case M.IN_TABLE_BODY:{dm(this,t);break}case M.IN_ROW:{pm(this,t);break}case M.IN_CELL:{jq(this,t);break}case M.IN_SELECT:{TM(this,t);break}case M.IN_SELECT_IN_TABLE:{Qq(this,t);break}case M.IN_TEMPLATE:{Jq(this,t);break}case M.AFTER_BODY:{tV(this,t);break}case M.IN_FRAMESET:{nV(this,t);break}case M.AFTER_FRAMESET:{iV(this,t);break}case M.AFTER_AFTER_BODY:{sV(this,t);break}case M.AFTER_AFTER_FRAMESET:{aV(this,t);break}default:}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?fV(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case M.INITIAL:{Af(this,t);break}case M.BEFORE_HTML:{G7(this,t);break}case M.BEFORE_HEAD:{Y7(this,t);break}case M.IN_HEAD:{$7(this,t);break}case M.IN_HEAD_NO_SCRIPT:{j7(this,t);break}case M.AFTER_HEAD:{Q7(this,t);break}case M.IN_BODY:{fm(this,t);break}case M.TEXT:{Pq(this,t);break}case M.IN_TABLE:{Df(this,t);break}case M.IN_TABLE_TEXT:{Nf(this,t);break}case M.IN_CAPTION:{$q(this,t);break}case M.IN_COLUMN_GROUP:{Wq(this,t);break}case M.IN_TABLE_BODY:{P1(this,t);break}case M.IN_ROW:{EM(this,t);break}case M.IN_CELL:{Xq(this,t);break}case M.IN_SELECT:{SM(this,t);break}case M.IN_SELECT_IN_TABLE:{Zq(this,t);break}case M.IN_TEMPLATE:{eV(this,t);break}case M.AFTER_BODY:{_M(this,t);break}case M.IN_FRAMESET:{rV(this,t);break}case M.AFTER_FRAMESET:{oV(this,t);break}case M.AFTER_AFTER_BODY:{am(this,t);break}default:}}onEof(t){switch(this.insertionMode){case M.INITIAL:{Af(this,t);break}case M.BEFORE_HTML:{wf(this,t);break}case M.BEFORE_HEAD:{Rf(this,t);break}case M.IN_HEAD:{kf(this,t);break}case M.IN_HEAD_NO_SCRIPT:{Mf(this,t);break}case M.AFTER_HEAD:{Of(this,t);break}case M.IN_BODY:case M.IN_TABLE:case M.IN_CAPTION:case M.IN_COLUMN_GROUP:case M.IN_TABLE_BODY:case M.IN_ROW:case M.IN_CELL:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:{mM(this,t);break}case M.TEXT:{Bq(this,t);break}case M.IN_TABLE_TEXT:{Nf(this,t);break}case M.IN_TEMPLATE:{xM(this,t);break}case M.AFTER_BODY:case M.IN_FRAMESET:case M.AFTER_FRAMESET:case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{U1(this,t);break}default:}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===N.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case M.IN_HEAD:case M.IN_HEAD_NO_SCRIPT:case M.AFTER_HEAD:case M.TEXT:case M.IN_COLUMN_GROUP:case M.IN_SELECT:case M.IN_SELECT_IN_TABLE:case M.IN_FRAMESET:case M.AFTER_FRAMESET:{this._insertCharacters(t);break}case M.IN_BODY:case M.IN_CAPTION:case M.IN_CELL:case M.IN_TEMPLATE:case M.AFTER_BODY:case M.AFTER_AFTER_BODY:case M.AFTER_AFTER_FRAMESET:{cM(this,t);break}case M.IN_TABLE:case M.IN_TABLE_BODY:case M.IN_ROW:{I1(this,t);break}case M.IN_TABLE_TEXT:{gM(this,t);break}default:}}};function I7(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):hM(e,t),n}function L7(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function P7(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let o=0,s=i;s!==n;o++,s=i){i=e.openElements.getCommonAncestor(s);let a=e.activeFormattingElements.getElementEntry(s),l=a&&o>=O7;!a||l?(l&&e.activeFormattingElements.removeEntry(a),e.openElements.remove(s)):(s=B7(e,a),r===t&&(e.activeFormattingElements.bookmark=a),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function B7(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function U7(e,t,n){let r=e.treeAdapter.getTagName(t),i=bs(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{let o=e.treeAdapter.getNamespaceURI(t);i===m.TEMPLATE&&o===X.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function F7(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,o=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,o),e.treeAdapter.appendChild(t,o),e.activeFormattingElements.insertElementAfterBookmark(o,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,o,i.tagID)}function B1(e,t){for(let n=0;n=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){let o=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(o);s&&!s.endTag&&e._setEndLocation(o,t)}}}}function q7(e,t){e._setDocumentType(t);let n=t.forceQuirks?Nn.QUIRKS:eM(t);Jk(t)||e._err(t,K.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=M.BEFORE_HTML}function Af(e,t){e._err(t,K.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Nn.QUIRKS),e.insertionMode=M.BEFORE_HTML,e._processToken(t)}function V7(e,t){t.tagID===m.HTML?(e._insertElement(t,X.HTML),e.insertionMode=M.BEFORE_HEAD):wf(e,t)}function G7(e,t){let n=t.tagID;(n===m.HTML||n===m.HEAD||n===m.BODY||n===m.BR)&&wf(e,t)}function wf(e,t){e._insertFakeRootElement(),e.insertionMode=M.BEFORE_HEAD,e._processToken(t)}function K7(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.HEAD:{e._insertElement(t,X.HTML),e.headElement=e.openElements.current,e.insertionMode=M.IN_HEAD;break}default:Rf(e,t)}}function Y7(e,t){let n=t.tagID;n===m.HEAD||n===m.BODY||n===m.HTML||n===m.BR?Rf(e,t):e._err(t,K.endTagWithoutMatchingOpenElement)}function Rf(e,t){e._insertFakeElement(z.HEAD,m.HEAD),e.headElement=e.openElements.current,e.insertionMode=M.IN_HEAD,e._processToken(t)}function si(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.BASE:case m.BASEFONT:case m.BGSOUND:case m.LINK:case m.META:{e._appendElement(t,X.HTML),t.ackSelfClosing=!0;break}case m.TITLE:{e._switchToTextParsing(t,Ct.RCDATA);break}case m.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Ct.RAWTEXT):(e._insertElement(t,X.HTML),e.insertionMode=M.IN_HEAD_NO_SCRIPT);break}case m.NOFRAMES:case m.STYLE:{e._switchToTextParsing(t,Ct.RAWTEXT);break}case m.SCRIPT:{e._switchToTextParsing(t,Ct.SCRIPT_DATA);break}case m.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=M.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(M.IN_TEMPLATE);break}case m.HEAD:{e._err(t,K.misplacedStartTagForHeadElement);break}default:kf(e,t)}}function $7(e,t){switch(t.tagID){case m.HEAD:{e.openElements.pop(),e.insertionMode=M.AFTER_HEAD;break}case m.BODY:case m.BR:case m.HTML:{kf(e,t);break}case m.TEMPLATE:{ha(e,t);break}default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function ha(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==m.TEMPLATE&&e._err(t,K.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(m.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,K.endTagWithoutMatchingOpenElement)}function kf(e,t){e.openElements.pop(),e.insertionMode=M.AFTER_HEAD,e._processToken(t)}function W7(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.BASEFONT:case m.BGSOUND:case m.HEAD:case m.LINK:case m.META:case m.NOFRAMES:case m.STYLE:{si(e,t);break}case m.NOSCRIPT:{e._err(t,K.nestedNoscriptInHead);break}default:Mf(e,t)}}function j7(e,t){switch(t.tagID){case m.NOSCRIPT:{e.openElements.pop(),e.insertionMode=M.IN_HEAD;break}case m.BR:{Mf(e,t);break}default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function Mf(e,t){let n=t.type===He.EOF?K.openElementsLeftAfterEof:K.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=M.IN_HEAD,e._processToken(t)}function X7(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.BODY:{e._insertElement(t,X.HTML),e.framesetOk=!1,e.insertionMode=M.IN_BODY;break}case m.FRAMESET:{e._insertElement(t,X.HTML),e.insertionMode=M.IN_FRAMESET;break}case m.BASE:case m.BASEFONT:case m.BGSOUND:case m.LINK:case m.META:case m.NOFRAMES:case m.SCRIPT:case m.STYLE:case m.TEMPLATE:case m.TITLE:{e._err(t,K.abandonedHeadElementChild),e.openElements.push(e.headElement,m.HEAD),si(e,t),e.openElements.remove(e.headElement);break}case m.HEAD:{e._err(t,K.misplacedStartTagForHeadElement);break}default:Of(e,t)}}function Q7(e,t){switch(t.tagID){case m.BODY:case m.HTML:case m.BR:{Of(e,t);break}case m.TEMPLATE:{ha(e,t);break}default:e._err(t,K.endTagWithoutMatchingOpenElement)}}function Of(e,t){e._insertFakeElement(z.BODY,m.BODY),e.insertionMode=M.IN_BODY,cm(e,t)}function cm(e,t){switch(t.type){case He.CHARACTER:{fM(e,t);break}case He.WHITESPACE_CHARACTER:{cM(e,t);break}case He.COMMENT:{L1(e,t);break}case He.START_TAG:{wn(e,t);break}case He.END_TAG:{fm(e,t);break}case He.EOF:{mM(e,t);break}default:}}function cM(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function fM(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Z7(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function J7(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function eq(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,X.HTML),e.insertionMode=M.IN_FRAMESET)}function tq(e,t){e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._insertElement(t,X.HTML)}function nq(e,t){e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&fu.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,X.HTML)}function rq(e,t){e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._insertElement(t,X.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function iq(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._insertElement(t,X.HTML),n||(e.formElement=e.openElements.current))}function oq(e,t){e.framesetOk=!1;let n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){let i=e.openElements.tagIDs[r];if(n===m.LI&&i===m.LI||(n===m.DD||n===m.DT)&&(i===m.DD||i===m.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==m.ADDRESS&&i!==m.DIV&&i!==m.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._insertElement(t,X.HTML)}function sq(e,t){e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._insertElement(t,X.HTML),e.tokenizer.state=Ct.PLAINTEXT}function aq(e,t){e.openElements.hasInScope(m.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(m.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML),e.framesetOk=!1}function lq(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(z.A);n&&(B1(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function uq(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function cq(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(m.NOBR)&&(B1(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,X.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function fq(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function dq(e,t){e.treeAdapter.getDocumentMode(e.document)!==Nn.QUIRKS&&e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._insertElement(t,X.HTML),e.framesetOk=!1,e.insertionMode=M.IN_TABLE}function dM(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,X.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function pM(e){let t=xf(e,Si.TYPE);return t!=null&&t.toLowerCase()===k7}function pq(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,X.HTML),pM(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function hq(e,t){e._appendElement(t,X.HTML),t.ackSelfClosing=!0}function mq(e,t){e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._appendElement(t,X.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function gq(e,t){t.tagName=z.IMG,t.tagID=m.IMG,dM(e,t)}function bq(e,t){e._insertElement(t,X.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Ct.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=M.TEXT}function yq(e,t){e.openElements.hasInButtonScope(m.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Ct.RAWTEXT)}function Eq(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Ct.RAWTEXT)}function aM(e,t){e._switchToTextParsing(t,Ct.RAWTEXT)}function Tq(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===M.IN_TABLE||e.insertionMode===M.IN_CAPTION||e.insertionMode===M.IN_TABLE_BODY||e.insertionMode===M.IN_ROW||e.insertionMode===M.IN_CELL?M.IN_SELECT_IN_TABLE:M.IN_SELECT}function Sq(e,t){e.openElements.currentTagId===m.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML)}function xq(e,t){e.openElements.hasInScope(m.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,X.HTML)}function _q(e,t){e.openElements.hasInScope(m.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(m.RTC),e._insertElement(t,X.HTML)}function vq(e,t){e._reconstructActiveFormattingElements(),O1(t),sm(t),t.selfClosing?e._appendElement(t,X.MATHML):e._insertElement(t,X.MATHML),t.ackSelfClosing=!0}function Cq(e,t){e._reconstructActiveFormattingElements(),D1(t),sm(t),t.selfClosing?e._appendElement(t,X.SVG):e._insertElement(t,X.SVG),t.ackSelfClosing=!0}function lM(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,X.HTML)}function wn(e,t){switch(t.tagID){case m.I:case m.S:case m.B:case m.U:case m.EM:case m.TT:case m.BIG:case m.CODE:case m.FONT:case m.SMALL:case m.STRIKE:case m.STRONG:{uq(e,t);break}case m.A:{lq(e,t);break}case m.H1:case m.H2:case m.H3:case m.H4:case m.H5:case m.H6:{nq(e,t);break}case m.P:case m.DL:case m.OL:case m.UL:case m.DIV:case m.DIR:case m.NAV:case m.MAIN:case m.MENU:case m.ASIDE:case m.CENTER:case m.FIGURE:case m.FOOTER:case m.HEADER:case m.HGROUP:case m.DIALOG:case m.DETAILS:case m.ADDRESS:case m.ARTICLE:case m.SEARCH:case m.SECTION:case m.SUMMARY:case m.FIELDSET:case m.BLOCKQUOTE:case m.FIGCAPTION:{tq(e,t);break}case m.LI:case m.DD:case m.DT:{oq(e,t);break}case m.BR:case m.IMG:case m.WBR:case m.AREA:case m.EMBED:case m.KEYGEN:{dM(e,t);break}case m.HR:{mq(e,t);break}case m.RB:case m.RTC:{xq(e,t);break}case m.RT:case m.RP:{_q(e,t);break}case m.PRE:case m.LISTING:{rq(e,t);break}case m.XMP:{yq(e,t);break}case m.SVG:{Cq(e,t);break}case m.HTML:{Z7(e,t);break}case m.BASE:case m.LINK:case m.META:case m.STYLE:case m.TITLE:case m.SCRIPT:case m.BGSOUND:case m.BASEFONT:case m.TEMPLATE:{si(e,t);break}case m.BODY:{J7(e,t);break}case m.FORM:{iq(e,t);break}case m.NOBR:{cq(e,t);break}case m.MATH:{vq(e,t);break}case m.TABLE:{dq(e,t);break}case m.INPUT:{pq(e,t);break}case m.PARAM:case m.TRACK:case m.SOURCE:{hq(e,t);break}case m.IMAGE:{gq(e,t);break}case m.BUTTON:{aq(e,t);break}case m.APPLET:case m.OBJECT:case m.MARQUEE:{fq(e,t);break}case m.IFRAME:{Eq(e,t);break}case m.SELECT:{Tq(e,t);break}case m.OPTION:case m.OPTGROUP:{Sq(e,t);break}case m.NOEMBED:case m.NOFRAMES:{aM(e,t);break}case m.FRAMESET:{eq(e,t);break}case m.TEXTAREA:{bq(e,t);break}case m.NOSCRIPT:{e.options.scriptingEnabled?aM(e,t):lM(e,t);break}case m.PLAINTEXT:{sq(e,t);break}case m.COL:case m.TH:case m.TD:case m.TR:case m.HEAD:case m.FRAME:case m.TBODY:case m.TFOOT:case m.THEAD:case m.CAPTION:case m.COLGROUP:break;default:lM(e,t)}}function Aq(e,t){if(e.openElements.hasInScope(m.BODY)&&(e.insertionMode=M.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Nq(e,t){e.openElements.hasInScope(m.BODY)&&(e.insertionMode=M.AFTER_BODY,_M(e,t))}function wq(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Rq(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(m.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(m.FORM):n&&e.openElements.remove(n))}function kq(e){e.openElements.hasInButtonScope(m.P)||e._insertFakeElement(z.P,m.P),e._closePElement()}function Mq(e){e.openElements.hasInListItemScope(m.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(m.LI),e.openElements.popUntilTagNamePopped(m.LI))}function Oq(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Dq(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Iq(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Lq(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(z.BR,m.BR),e.openElements.pop(),e.framesetOk=!1}function hM(e,t){let n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){let o=e.openElements.items[i],s=e.openElements.tagIDs[i];if(r===s&&(r!==m.UNKNOWN||e.treeAdapter.getTagName(o)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(o,s))break}}function fm(e,t){switch(t.tagID){case m.A:case m.B:case m.I:case m.S:case m.U:case m.EM:case m.TT:case m.BIG:case m.CODE:case m.FONT:case m.NOBR:case m.SMALL:case m.STRIKE:case m.STRONG:{B1(e,t);break}case m.P:{kq(e);break}case m.DL:case m.UL:case m.OL:case m.DIR:case m.DIV:case m.NAV:case m.PRE:case m.MAIN:case m.MENU:case m.ASIDE:case m.BUTTON:case m.CENTER:case m.FIGURE:case m.FOOTER:case m.HEADER:case m.HGROUP:case m.DIALOG:case m.ADDRESS:case m.ARTICLE:case m.DETAILS:case m.SEARCH:case m.SECTION:case m.SUMMARY:case m.LISTING:case m.FIELDSET:case m.BLOCKQUOTE:case m.FIGCAPTION:{wq(e,t);break}case m.LI:{Mq(e);break}case m.DD:case m.DT:{Oq(e,t);break}case m.H1:case m.H2:case m.H3:case m.H4:case m.H5:case m.H6:{Dq(e);break}case m.BR:{Lq(e);break}case m.BODY:{Aq(e,t);break}case m.HTML:{Nq(e,t);break}case m.FORM:{Rq(e);break}case m.APPLET:case m.OBJECT:case m.MARQUEE:{Iq(e,t);break}case m.TEMPLATE:{ha(e,t);break}default:hM(e,t)}}function mM(e,t){e.tmplInsertionModeStack.length>0?xM(e,t):U1(e,t)}function Pq(e,t){var n;t.tagID===m.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Bq(e,t){e._err(t,K.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function I1(e,t){if(e.openElements.currentTagId!==void 0&&uM.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=M.IN_TABLE_TEXT,t.type){case He.CHARACTER:{bM(e,t);break}case He.WHITESPACE_CHARACTER:{gM(e,t);break}}else If(e,t)}function Uq(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,X.HTML),e.insertionMode=M.IN_CAPTION}function Fq(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,X.HTML),e.insertionMode=M.IN_COLUMN_GROUP}function Hq(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.COLGROUP,m.COLGROUP),e.insertionMode=M.IN_COLUMN_GROUP,F1(e,t)}function zq(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,X.HTML),e.insertionMode=M.IN_TABLE_BODY}function qq(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.TBODY,m.TBODY),e.insertionMode=M.IN_TABLE_BODY,dm(e,t)}function Vq(e,t){e.openElements.hasInTableScope(m.TABLE)&&(e.openElements.popUntilTagNamePopped(m.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Gq(e,t){pM(t)?e._appendElement(t,X.HTML):If(e,t),t.ackSelfClosing=!0}function Kq(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,X.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function du(e,t){switch(t.tagID){case m.TD:case m.TH:case m.TR:{qq(e,t);break}case m.STYLE:case m.SCRIPT:case m.TEMPLATE:{si(e,t);break}case m.COL:{Hq(e,t);break}case m.FORM:{Kq(e,t);break}case m.TABLE:{Vq(e,t);break}case m.TBODY:case m.TFOOT:case m.THEAD:{zq(e,t);break}case m.INPUT:{Gq(e,t);break}case m.CAPTION:{Uq(e,t);break}case m.COLGROUP:{Fq(e,t);break}default:If(e,t)}}function Df(e,t){switch(t.tagID){case m.TABLE:{e.openElements.hasInTableScope(m.TABLE)&&(e.openElements.popUntilTagNamePopped(m.TABLE),e._resetInsertionMode());break}case m.TEMPLATE:{ha(e,t);break}case m.BODY:case m.CAPTION:case m.COL:case m.COLGROUP:case m.HTML:case m.TBODY:case m.TD:case m.TFOOT:case m.TH:case m.THEAD:case m.TR:break;default:If(e,t)}}function If(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,cm(e,t),e.fosterParentingEnabled=n}function gM(e,t){e.pendingCharacterTokens.push(t)}function bM(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Nf(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===m.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===m.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===m.OPTGROUP&&e.openElements.pop();break}case m.OPTION:{e.openElements.currentTagId===m.OPTION&&e.openElements.pop();break}case m.SELECT:{e.openElements.hasInSelectScope(m.SELECT)&&(e.openElements.popUntilTagNamePopped(m.SELECT),e._resetInsertionMode());break}case m.TEMPLATE:{ha(e,t);break}default:}}function Qq(e,t){let n=t.tagID;n===m.CAPTION||n===m.TABLE||n===m.TBODY||n===m.TFOOT||n===m.THEAD||n===m.TR||n===m.TD||n===m.TH?(e.openElements.popUntilTagNamePopped(m.SELECT),e._resetInsertionMode(),e._processStartTag(t)):TM(e,t)}function Zq(e,t){let n=t.tagID;n===m.CAPTION||n===m.TABLE||n===m.TBODY||n===m.TFOOT||n===m.THEAD||n===m.TR||n===m.TD||n===m.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(m.SELECT),e._resetInsertionMode(),e.onEndTag(t)):SM(e,t)}function Jq(e,t){switch(t.tagID){case m.BASE:case m.BASEFONT:case m.BGSOUND:case m.LINK:case m.META:case m.NOFRAMES:case m.SCRIPT:case m.STYLE:case m.TEMPLATE:case m.TITLE:{si(e,t);break}case m.CAPTION:case m.COLGROUP:case m.TBODY:case m.TFOOT:case m.THEAD:{e.tmplInsertionModeStack[0]=M.IN_TABLE,e.insertionMode=M.IN_TABLE,du(e,t);break}case m.COL:{e.tmplInsertionModeStack[0]=M.IN_COLUMN_GROUP,e.insertionMode=M.IN_COLUMN_GROUP,F1(e,t);break}case m.TR:{e.tmplInsertionModeStack[0]=M.IN_TABLE_BODY,e.insertionMode=M.IN_TABLE_BODY,dm(e,t);break}case m.TD:case m.TH:{e.tmplInsertionModeStack[0]=M.IN_ROW,e.insertionMode=M.IN_ROW,pm(e,t);break}default:e.tmplInsertionModeStack[0]=M.IN_BODY,e.insertionMode=M.IN_BODY,wn(e,t)}}function eV(e,t){t.tagID===m.TEMPLATE&&ha(e,t)}function xM(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(m.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):U1(e,t)}function tV(e,t){t.tagID===m.HTML?wn(e,t):um(e,t)}function _M(e,t){var n;if(t.tagID===m.HTML){if(e.fragmentContext||(e.insertionMode=M.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===m.HTML){e._setEndLocation(e.openElements.items[0],t);let r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else um(e,t)}function um(e,t){e.insertionMode=M.IN_BODY,cm(e,t)}function nV(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.FRAMESET:{e._insertElement(t,X.HTML);break}case m.FRAME:{e._appendElement(t,X.HTML),t.ackSelfClosing=!0;break}case m.NOFRAMES:{si(e,t);break}default:}}function rV(e,t){t.tagID===m.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==m.FRAMESET&&(e.insertionMode=M.AFTER_FRAMESET))}function iV(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.NOFRAMES:{si(e,t);break}default:}}function oV(e,t){t.tagID===m.HTML&&(e.insertionMode=M.AFTER_AFTER_FRAMESET)}function sV(e,t){t.tagID===m.HTML?wn(e,t):am(e,t)}function am(e,t){e.insertionMode=M.IN_BODY,cm(e,t)}function aV(e,t){switch(t.tagID){case m.HTML:{wn(e,t);break}case m.NOFRAMES:{si(e,t);break}default:}}function lV(e,t){t.chars=dt,e._insertCharacters(t)}function uV(e,t){e._insertCharacters(t),e.framesetOk=!1}function vM(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==X.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function cV(e,t){if(nM(t))vM(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===X.MATHML?O1(t):r===X.SVG&&(rM(t),D1(t)),sm(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function fV(e,t){if(t.tagID===m.P||t.tagID===m.BR){vM(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===X.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}var Nue=String.prototype.codePointAt==null?(e,t)=>(e.charCodeAt(t)&64512)===55296?(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t):(e,t)=>e.codePointAt(t);var Iue=new Set([z.AREA,z.BASE,z.BASEFONT,z.BGSOUND,z.BR,z.COL,z.EMBED,z.FRAME,z.HR,z.IMG,z.INPUT,z.KEYGEN,z.LINK,z.META,z.PARAM,z.SOURCE,z.TRACK,z.WBR]);function CM(e,t,n){typeof e=="string"&&(n=t,t=e,e=null);let r=Es.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}var ai={basename:dV,dirname:pV,extname:hV,join:mV,sep:"/"};function dV(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Lf(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function pV(e){if(Lf(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function hV(e){Lf(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){let a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function mV(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function bV(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function Lf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var AM={cwd:yV};function yV(){return"/"}function pu(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function NM(e){if(typeof e=="string")e=new URL(e);else if(!pu(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return EV(e)}function EV(e){if(e.hostname!==""){let r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}let t=e.pathname,n=-1;for(;++n":""))+")"})}return d;function d(){let p=RM,h,g,y;if((!t||o(l,u,c[c.length-1]||void 0))&&(p=AV(n(l,c)),p[0]===ga))return p;if("children"in l&&l.children){let b=l;if(b.children&&p[0]!==Hn)for(g=(r?b.children.length:-1)+s,y=c.concat(b);g>-1&&gi||n!==-1&&t>n||r!==-1&&t>r||wV.test(e.slice(0,t)))}function V1(e){Le(e,"element",t=>{for(let[n,r]of Object.entries(NV)){if(r!==null&&!r.includes(t.tagName))continue;let i=t.properties?.[n];typeof i=="string"&&!gm(i)&&(t.properties[n]="")}})}var hu="dataPending";function bm(e){return typeof e=="string"?e.split(/\s+/).includes("suggestion"):Array.isArray(e)?e.includes("suggestion"):!1}function Bf(e){return e?e.map(t=>t.type==="text"?t.value:t.type==="element"?Bf(t.children):"").join("").trim():""}function mu(e){if(e.type!=="element")return!1;let t=e.properties;return t?bm(t.className)||"dataSuggestion"in t:!1}var RV="markdown-stream-dot";function kV(){return{type:"element",tagName:"svg",properties:{width:12,height:12,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",className:[RV],style:"margin-left:.25em;margin-top:-.25em",ariaHidden:"true"},children:[{type:"element",tagName:"circle",properties:{cx:6,cy:6,r:6},children:[]}]}}var MV=new Set(["p","div","pre","ul","ol"]),OV=new Set(["p","h1","h2","h3","h4","h5","h6","li","code"]);function DV(e){return e.type==="text"?/\S/.test(e.value):!1}function IV(e){return e.tagName!=="ul"&&e.tagName!=="ol"?!1:e.properties!=null&&hu in e.properties}function kM(e){if(e.children.length===0)return e;let t=LV(e),n={...e,children:[...e.children]},r=n.children;for(let i=0;i=0;l--){let u=i[l];if(u.type!=="doctype"&&(u.type==="element"||DV(u))){o=l,s=u;break}}if(!s||s.type!=="element")return t;let a=s.tagName;if(MV.has(a)){if(t.push({index:o}),IV(s))return t;n=s;continue}return OV.has(a)&&t.push({index:o}),t}return t}function MM(e){return e.type==="text"&&e.value.trim()!==""}function ym(e){return e.filter(t=>t.type==="element"||t.type==="text"&&t.value.trim()!=="")}function OM(e){let t=e.children;if(t.some(MM))return!1;let n=t.filter(r=>r.type==="element");if(n.length===0)return!1;for(let r of n){if(r.tagName!=="li")return!1;let i=r.children;if(i.some(MM))return!1;let o=ym(i).filter(a=>a.type==="element");if(o.length!==1)return!1;let s=o[0];if(!s||!mu(s))return!1}return!0}function G1(e,...t){let n;Array.isArray(e)?n=[...e]:typeof e=="string"&&e.trim()!==""?n=e.split(/\s+/).filter(Boolean):n=[];for(let r of t)n.includes(r)||n.push(r);return n}function PV(e,...t){let n;return Array.isArray(e)?n=[...e]:typeof e=="string"&&e.trim()!==""?n=e.split(/\s+/).filter(Boolean):n=[],n.filter(r=>!t.includes(String(r)))}function DM(e,t){return{type:"element",tagName:"div",properties:{className:[e]},children:t}}function BV(e,t){return DM(e,[{type:"text",value:t}])}function IM(e,t){let n=["shiny-chat-suggestion-list"];t&&n.push("shiny-chat-suggestion-list--ordered"),e.properties.className=G1(e.properties.className,...n),e.properties.role="list";let r=0;for(let i of e.children){if(i.type!=="element"||i.tagName!=="li")continue;let o=i.children,s=ym(o).find(mu),a=Bf(s.children),l=s.properties.title,u=typeof l=="string"&&l.trim()!==""?l.trim():null,c=u?BV("shiny-chat-suggestion-list-item-title",u):null,f=DM("shiny-chat-suggestion-list-item-body",s.children);s.children=c?[c,f]:[f],s.properties.className=G1(s.properties.className,"shiny-chat-suggestion-list-item");let d=s.properties.dataSuggestion;if(typeof d=="string"&&d!==""||(s.properties.dataSuggestion=a),t){let g=r+1;s.properties.ariaLabel=u?`Use chat suggestion #${g}: ${u} \u2014 ${a}`:`Use chat suggestion #${g}: ${a}`}else s.properties.ariaLabel=u?`Use chat suggestion: ${u} \u2014 ${a}`:`Use chat suggestion: ${a}`;let p=s.properties.style,h=`--_card-index:${r}`;s.properties.style=typeof p=="string"&&p!==""?`${h};${p}`:h,delete s.properties.title,i.properties.role="listitem",r++}}var UV=/^\s*<(s(p(a(n(\s[^>]*)?)?)?)?)?$/i;function FV(e){let n=e.children.filter(a=>a.type==="element");if(n.length===0)return!1;let r=n[n.length-1];if(r.tagName!=="li")return!1;let i=n.slice(0,-1),o=!1;for(let a of i){if(a.tagName!=="li")return!1;let l=a.children,u=ym(l);if(u.length!==0){if(u.length===1&&mu(u[0])){o=!0;continue}return!1}}let s=ym(r.children);if(s.length!==0){if(s.length===1&&mu(s[0]))o=!0;else if(!(s.length===1&&s[0].type==="text"&&UV.test(s[0].value)))return!1}return o||n.length===1}function HV(e,t){let n=["shiny-chat-suggestion-list"];t&&n.push("shiny-chat-suggestion-list--ordered"),e.properties.className=G1(e.properties.className,...n),e.properties[hu]=""}function zV(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.type==="element")return n}return null}var K1=()=>e=>{let t=zV(e.children);for(let n of e.children){if(n.type!=="element")continue;let r=n;if(!(r.tagName!=="ul"&&r.tagName!=="ol")){if(r===t){FV(r)&&HV(r,r.tagName==="ol");continue}OM(r)&&IM(r,r.tagName==="ol")}}};function qV(e){return{...e,properties:{...e.properties},children:e.children.map(n=>{if(n.type!=="element"||n.tagName!=="li")return n;let r=n;return{...r,properties:{...r.properties},children:r.children.map(o=>{if(!mu(o))return o;let s=o;return{...s,properties:{...s.properties},children:[...s.children]}})}})}}function LM(e){let t=[];for(let r=0;r=0;n--){let r=t[n];if(r&&r.type==="element")return r}return null}function KV(e){for(let t of e.children)t.type==="element"&&t.tagName===Y1&&(t.properties={...t.properties,[Uf]:""})}var $1=()=>e=>{let t=e;for(;;){let n=GV(t);if(!n)return;if(n.tagName===Y1){KV(t);return}t=n}};function PM(e){let t=BM(e.children);return t?{...e,children:t}:e}function BM(e){let t=!1,n=e.map(r=>{if(r.type!=="element")return r;let i=YV(r);return i!==r&&(t=!0),i});return t?n:null}function YV(e){let t=VV(e),n=BM(e.children);if(!t&&!n)return e;let r={...e.properties};return t&&delete r[Uf],{...e,properties:r,children:n??e.children}}function $V(e){return e?.type==="raw"}function WV(e){return e.type!=="doctype"}function W1(e){return e.replace(/])((?:"[^"]*"|'[^']*'|[^"'>])*?)\/>/g,"").replace(/])/g,"")}var UM=()=>e=>{Le(e,t=>{$V(t)&&(t.value=W1(t.value))})};function j1(e){Le(e,"element",t=>{t.tagName==="template"&&(!t.properties||!("dataShinyAside"in t.properties)||(t.tagName="shiny-aside",t.children=(t.content?.children??[]).filter(WV),delete t.content,delete t.properties.dataShinyAside))})}var FM=()=>j1;var jV={className:"class",htmlFor:"for",tabIndex:"tabindex",readOnly:"readonly",contentEditable:"contenteditable",colSpan:"colspan",rowSpan:"rowspan",autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",crossOrigin:"crossorigin",encType:"enctype",formAction:"formaction",formNoValidate:"formnovalidate",inputMode:"inputmode",maxLength:"maxlength",minLength:"minlength",noValidate:"novalidate",spellCheck:"spellcheck",srcDoc:"srcdoc",srcLang:"srclang",srcSet:"srcset"};function HM(e,t){if(!e.includes("-"))return t;let n;for(let[r,i]of Object.entries(jV))r in t&&(n||(n={...t}),n[i]=n[r],delete n[r]);return n??t}var XV=(e,t,n)=>(0,gu.jsx)(e,typeof e=="string"?HM(e,t):t,n),QV=(e,t,n)=>(0,gu.jsxs)(e,typeof e=="string"?HM(e,t):t,n);function zM(e,t){let n=new ma(e),r=t.runSync(t.parse(n),n);return V1(r),r}function qM(e,t){let n=Sf(CM(W1(e)));return j1(n),t.runSync(n),V1(n),n}function VM(e,t){let{tagToComponentMap:n,streaming:r}=t,i=r?e:PM(LM(e)),o=r?kM(i):i;return y1(o,{Fragment:gu.Fragment,jsx:XV,jsxs:QV,components:n,passKeys:!0,passNode:!0,ignoreInvalidStyle:!0})}var ZV=/<(s(h(i(n(y(-(a(s(i(d(e(\s[^<>]*)?)?)?)?)?)?)?)?)?)?)?)?$/;function GM(e){let t=e.match(ZV);return!t||t[0]===""?e:e.slice(0,e.length-t[0].length)}function X1(e){if(e)throw e}var Sm=G(JM(),1);function Ff(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Q1(){let e=[],t={run:n,use:r};return t;function n(...i){let o=-1,s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...u){let c=e[++o],f=-1;if(l){s(l);return}for(;++fs.length,l;a&&s.push(i);try{l=e.apply(this,s)}catch(u){let c=u;if(a&&n)throw c;return i(c)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}var tO=function(e){let r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o};var JV={}.hasOwnProperty,tT=class e extends tO{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Q1()}copy(){let t=new e,n=-1;for(;++n0){let[p,...h]=c,g=r[d][1];Ff(g)&&Ff(p)&&(p=(0,Sm.default)(!0,g,p)),r[d]=[u,p,...h]}}}},ba=new tT().freeze();function Z1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function J1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function eT(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function nO(e){if(!Ff(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function rO(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Tm(e){return eG(e)?e:new ma(e)}function eG(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function tG(e){return typeof e=="string"||nG(e)}function nG(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var rG={};function ya(e,t){let n=t||rG,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return oO(e,r,i)}function oO(e,t,n){if(iG(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return iO(e.children,t,n)}return Array.isArray(e)?iO(e,t,n):""}function iO(e,t,n){let r=[],i=-1;for(;++ii?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(Bt(e,e.length,0,t),e):t}var aO={}.hasOwnProperty;function xm(e){let t={},n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function Rn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Qt=Ts(/[A-Za-z]/),Ot=Ts(/[\dA-Za-z]/),lO=Ts(/[#-'*+\--9=?A-Z^-~]/);function Ea(e){return e!==null&&(e<32||e===127)}var Hf=Ts(/\d/),uO=Ts(/[\dA-Fa-f]/),cO=Ts(/[!-/:-@[-`{-~]/);function ae(e){return e!==null&&e<-2}function Pe(e){return e!==null&&(e<0||e===32)}function Ee(e){return e===-2||e===-1||e===32}var Ta=Ts(/\p{P}|\p{S}/u),_i=Ts(/\s/);function Ts(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wr(e){let t=[],n=-1,r=0,i=0;for(;++n55295&&o<57344){let a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="\uFFFD"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ye(e,t,n,r){let i=r?r-1:Number.POSITIVE_INFINITY,o=0;return s;function s(l){return Ee(l)?(e.enter(n),a(l)):t(l)}function a(l){return Ee(l)&&o++s))return;let R=t.events.length,O=R,B,C;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(B){C=t.events[O][1].end;break}B=!0}for(b(r),x=R;xT;){let v=n[S];t.containerState=v[1],v[0].exit.call(t,e)}n.length=T}function E(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function uG(e,t,n){return ye(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function mo(e){if(e===null||Pe(e)||_i(e))return 1;if(Ta(e))return 2}function Ss(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let f={...e[r][1].end},d={...e[n][1].start};hO(f,-l),hO(d,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:d},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=zn(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=zn(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=zn(u,Ss(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=zn(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=zn(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Bt(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&Ee(x)?ye(e,E,"linePrefix",o+1)(x):E(x)}function E(x){return x===null||ae(x)?e.check(mO,g,S)(x):(e.enter("codeFlowValue"),T(x))}function T(x){return x===null||ae(x)?(e.exit("codeFlowValue"),E(x)):(e.consume(x),T)}function S(x){return e.exit("codeFenced"),t(x)}function v(x,R,O){let B=0;return C;function C(H){return x.enter("lineEnding"),x.consume(H),x.exit("lineEnding"),V}function V(H){return x.enter("codeFencedFence"),Ee(H)?ye(x,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):Y(H)}function Y(H){return H===a?(x.enter("codeFencedFenceSequence"),q(H)):O(H)}function q(H){return H===a?(B++,x.consume(H),q):B>=s?(x.exit("codeFencedFenceSequence"),Ee(H)?ye(x,L,"whitespace")(H):L(H)):O(H)}function L(H){return H===null||ae(H)?(x.exit("codeFencedFence"),R(H)):O(H)}}}function TG(e,t,n){let r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}var qf={name:"codeIndented",tokenize:xG},SG={partial:!0,tokenize:_G};function xG(e,t,n){let r=this;return i;function i(u){return e.enter("codeIndented"),ye(e,o,"linePrefix",5)(u)}function o(u){let c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ae(u)?e.attempt(SG,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ae(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function _G(e,t,n){let r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ae(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ye(e,o,"linePrefix",5)(s)}function o(s){let a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ae(s)?i(s):n(s)}}var rT={name:"codeText",previous:CG,resolve:vG,tokenize:AG};function vG(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){let i=n||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Vf(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Vf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function km(e,t,n,r,i,o,s,a,l){let u=l||Number.POSITIVE_INFINITY,c=0;return f;function f(b){return b===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(b),e.exit(o),d):b===null||b===32||b===41||Ea(b)?n(b):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(b))}function d(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(e.exit("chunkString"),e.exit(a),d(b)):b===null||b===60||ae(b)?n(b):(e.consume(b),b===92?h:p)}function h(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function g(b){return!c&&(b===null||b===41||Pe(b))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(b)):c999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):ae(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||ae(p)||a++>999?(e.exit("chunkString"),c(p)):(e.consume(p),l||(l=!Ee(p)),p===92?d:f)}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function Om(e,t,n,r,i,o){let s;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),s=d===40?41:d,l):n(d)}function l(d){return d===s?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(e.enter(o),u(d))}function u(d){return d===s?(e.exit(o),l(s)):d===null?n(d):ae(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ye(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===s||d===null||ae(d)?(e.exit("chunkString"),u(d)):(e.consume(d),d===92?f:c)}function f(d){return d===s||d===92?(e.consume(d),c):c(d)}}function Sa(e,t){let n;return r;function r(i){return ae(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ee(i)?ye(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var oT={name:"definition",tokenize:DG},OG={partial:!0,tokenize:IG};function DG(e,t,n){let r=this,i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return Mm.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Rn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return Pe(p)?Sa(e,u)(p):u(p)}function u(p){return km(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(OG,f,f)(p)}function f(p){return Ee(p)?ye(e,d,"whitespace")(p):d(p)}function d(p){return p===null||ae(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function IG(e,t,n){return r;function r(a){return Pe(a)?Sa(e,i)(a):n(a)}function i(a){return Om(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return Ee(a)?ye(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ae(a)?t(a):n(a)}}var sT={name:"hardBreakEscape",tokenize:LG};function LG(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ae(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}var aT={name:"headingAtx",resolve:PG,tokenize:BG};function PG(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Bt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function BG(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||Pe(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||ae(c)?(e.exit("atxHeading"),t(c)):Ee(c)?ye(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Pe(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}var gO=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],lT=["pre","script","style","textarea"];var uT={concrete:!0,name:"htmlFlow",resolveTo:HG,tokenize:zG},UG={partial:!0,tokenize:VG},FG={partial:!0,tokenize:qG};function HG(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function zG(e,t,n){let r=this,i,o,s,a,l;return u;function u(A){return c(A)}function c(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),o=!0,g):A===63?(e.consume(A),i=3,r.interrupt?t:_):Qt(A)?(e.consume(A),s=String.fromCharCode(A),y):n(A)}function d(A){return A===45?(e.consume(A),i=2,p):A===91?(e.consume(A),i=5,a=0,h):Qt(A)?(e.consume(A),i=4,r.interrupt?t:_):n(A)}function p(A){return A===45?(e.consume(A),r.interrupt?t:_):n(A)}function h(A){let re="CDATA[";return A===re.charCodeAt(a++)?(e.consume(A),a===re.length?r.interrupt?t:Y:h):n(A)}function g(A){return Qt(A)?(e.consume(A),s=String.fromCharCode(A),y):n(A)}function y(A){if(A===null||A===47||A===62||Pe(A)){let re=A===47,se=s.toLowerCase();return!re&&!o&&lT.includes(se)?(i=1,r.interrupt?t(A):Y(A)):gO.includes(s.toLowerCase())?(i=6,re?(e.consume(A),b):r.interrupt?t(A):Y(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):o?E(A):T(A))}return A===45||Ot(A)?(e.consume(A),s+=String.fromCharCode(A),y):n(A)}function b(A){return A===62?(e.consume(A),r.interrupt?t:Y):n(A)}function E(A){return Ee(A)?(e.consume(A),E):C(A)}function T(A){return A===47?(e.consume(A),C):A===58||A===95||Qt(A)?(e.consume(A),S):Ee(A)?(e.consume(A),T):C(A)}function S(A){return A===45||A===46||A===58||A===95||Ot(A)?(e.consume(A),S):v(A)}function v(A){return A===61?(e.consume(A),x):Ee(A)?(e.consume(A),v):T(A)}function x(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,R):Ee(A)?(e.consume(A),x):O(A)}function R(A){return A===l?(e.consume(A),l=null,B):A===null||ae(A)?n(A):(e.consume(A),R)}function O(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||Pe(A)?v(A):(e.consume(A),O)}function B(A){return A===47||A===62||Ee(A)?T(A):n(A)}function C(A){return A===62?(e.consume(A),V):n(A)}function V(A){return A===null||ae(A)?Y(A):Ee(A)?(e.consume(A),V):n(A)}function Y(A){return A===45&&i===2?(e.consume(A),I):A===60&&i===1?(e.consume(A),P):A===62&&i===4?(e.consume(A),te):A===63&&i===3?(e.consume(A),_):A===93&&i===5?(e.consume(A),U):ae(A)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(UG,ne,q)(A)):A===null||ae(A)?(e.exit("htmlFlowData"),q(A)):(e.consume(A),Y)}function q(A){return e.check(FG,L,ne)(A)}function L(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),H}function H(A){return A===null||ae(A)?q(A):(e.enter("htmlFlowData"),Y(A))}function I(A){return A===45?(e.consume(A),_):Y(A)}function P(A){return A===47?(e.consume(A),s="",D):Y(A)}function D(A){if(A===62){let re=s.toLowerCase();return lT.includes(re)?(e.consume(A),te):Y(A)}return Qt(A)&&s.length<8?(e.consume(A),s+=String.fromCharCode(A),D):Y(A)}function U(A){return A===93?(e.consume(A),_):Y(A)}function _(A){return A===62?(e.consume(A),te):A===45&&i===2?(e.consume(A),_):Y(A)}function te(A){return A===null||ae(A)?(e.exit("htmlFlowData"),ne(A)):(e.consume(A),te)}function ne(A){return e.exit("htmlFlow"),t(A)}}function qG(e,t,n){let r=this;return i;function i(s){return ae(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function VG(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(vi,t,n)}}var cT={name:"htmlText",tokenize:GG};function GG(e,t,n){let r=this,i,o,s;return a;function a(_){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(_),l}function l(_){return _===33?(e.consume(_),u):_===47?(e.consume(_),v):_===63?(e.consume(_),T):Qt(_)?(e.consume(_),O):n(_)}function u(_){return _===45?(e.consume(_),c):_===91?(e.consume(_),o=0,h):Qt(_)?(e.consume(_),E):n(_)}function c(_){return _===45?(e.consume(_),p):n(_)}function f(_){return _===null?n(_):_===45?(e.consume(_),d):ae(_)?(s=f,P(_)):(e.consume(_),f)}function d(_){return _===45?(e.consume(_),p):f(_)}function p(_){return _===62?I(_):_===45?d(_):f(_)}function h(_){let te="CDATA[";return _===te.charCodeAt(o++)?(e.consume(_),o===te.length?g:h):n(_)}function g(_){return _===null?n(_):_===93?(e.consume(_),y):ae(_)?(s=g,P(_)):(e.consume(_),g)}function y(_){return _===93?(e.consume(_),b):g(_)}function b(_){return _===62?I(_):_===93?(e.consume(_),b):g(_)}function E(_){return _===null||_===62?I(_):ae(_)?(s=E,P(_)):(e.consume(_),E)}function T(_){return _===null?n(_):_===63?(e.consume(_),S):ae(_)?(s=T,P(_)):(e.consume(_),T)}function S(_){return _===62?I(_):T(_)}function v(_){return Qt(_)?(e.consume(_),x):n(_)}function x(_){return _===45||Ot(_)?(e.consume(_),x):R(_)}function R(_){return ae(_)?(s=R,P(_)):Ee(_)?(e.consume(_),R):I(_)}function O(_){return _===45||Ot(_)?(e.consume(_),O):_===47||_===62||Pe(_)?B(_):n(_)}function B(_){return _===47?(e.consume(_),I):_===58||_===95||Qt(_)?(e.consume(_),C):ae(_)?(s=B,P(_)):Ee(_)?(e.consume(_),B):I(_)}function C(_){return _===45||_===46||_===58||_===95||Ot(_)?(e.consume(_),C):V(_)}function V(_){return _===61?(e.consume(_),Y):ae(_)?(s=V,P(_)):Ee(_)?(e.consume(_),V):B(_)}function Y(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),i=_,q):ae(_)?(s=Y,P(_)):Ee(_)?(e.consume(_),Y):(e.consume(_),L)}function q(_){return _===i?(e.consume(_),i=void 0,H):_===null?n(_):ae(_)?(s=q,P(_)):(e.consume(_),q)}function L(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||Pe(_)?B(_):(e.consume(_),L)}function H(_){return _===47||_===62||Pe(_)?B(_):n(_)}function I(_){return _===62?(e.consume(_),e.exit("htmlTextData"),e.exit("htmlText"),t):n(_)}function P(_){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),D}function D(_){return Ee(_)?ye(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):U(_)}function U(_){return e.enter("htmlTextData"),s(_)}}var xa={name:"labelEnd",resolveAll:WG,resolveTo:jG,tokenize:XG},KG={tokenize:QG},YG={tokenize:ZG},$G={tokenize:JG};function WG(e){let t=-1,n=[];for(;++t=3&&(u===null||ae(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Ee(u)?ye(e,a,"whitespace")(u):a(u))}}var kn={continuation:{tokenize:aK},exit:uK,name:"list",tokenize:sK},iK={partial:!0,tokenize:cK},oK={partial:!0,tokenize:lK};function sK(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){let h=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Hf(p)){if(r.containerState.type||(r.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(_a,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Hf(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(vi,r.interrupt?n:c,e.attempt(iK,d,f))}function c(p){return r.containerState.initialBlankLine=!0,o++,d(p)}function f(p){return Ee(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),d):n(p)}function d(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function aK(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(vi,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ye(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!Ee(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(oK,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ye(e,e.attempt(kn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function lK(e,t,n){let r=this;return ye(e,i,"listItemIndent",r.containerState.size+1);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function uK(e){e.exit(this.containerState.type)}function cK(e,t,n){let r=this;return ye(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=r.events[r.events.length-1];return!Ee(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}var Dm={name:"setextUnderline",resolveTo:fK,tokenize:dK};function fK(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);let s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function dK(e,t,n){let r=this,i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),Ee(u)?ye(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ae(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}var bO={tokenize:pK};function pK(e){let t=this,n=e.attempt(vi,r,e.attempt(this.parser.constructs.flowInitial,i,ye(e,e.attempt(this.parser.constructs.flow,i,e.attempt(iT,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var yO={resolveAll:xO()},EO=SO("string"),TO=SO("text");function SO(e){return{resolveAll:xO(e==="text"?hK:void 0),tokenize:t};function t(n){let r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(c){return u(c)?o(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;let f=i[c],d=-1;if(f)for(;++dxK,contentInitial:()=>gK,disable:()=>_K,document:()=>mK,flow:()=>yK,flowInitial:()=>bK,insideSpan:()=>SK,string:()=>EK,text:()=>TK});var mK={42:kn,43:kn,45:kn,48:kn,49:kn,50:kn,51:kn,52:kn,53:kn,54:kn,55:kn,56:kn,57:kn,62:vm},gK={91:oT},bK={[-2]:qf,[-1]:qf,32:qf},yK={35:aT,42:_a,45:[Dm,_a],60:uT,61:Dm,95:_a,96:Nm,126:Nm},EK={38:Am,92:Cm},TK={[-5]:Gf,[-4]:Gf,[-3]:Gf,33:fT,38:Am,42:zf,60:[nT,cT],91:dT,92:[sT,Cm],93:xa,95:zf,96:rT},SK={null:[zf,yO]},xK={null:[42,95]},_K={null:[]};function _O(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},o=[],s=[],a=[],l=!0,u={attempt:B(R),check:B(O),consume:S,enter:v,exit:x,interrupt:B(O,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:y,parser:e,previous:null,sliceSerialize:h,sliceStream:g,write:p},f=t.tokenize.call(c,u),d;return t.resolveAll&&o.push(t),c;function p(q){return s=zn(s,q),E(),s[s.length-1]!==null?[]:(C(t,0),c.events=Ss(o,c.events,c),c.events)}function h(q,L){return CK(g(q),L)}function g(q){return vK(s,q)}function y(){let{_bufferIndex:q,_index:L,line:H,column:I,offset:P}=r;return{_bufferIndex:q,_index:L,line:H,column:I,offset:P}}function b(q){i[q.line]=q.column,Y()}function E(){let q;for(;r._index-1){let a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function CK(e,t){let n=-1,r=[],i;for(;++n0){let Ke=$.tokenStack[$.tokenStack.length-1];(Ke[1]||AO).call($,void 0,Ke[0])}for(F.position={start:xs(w.length>0?w[0][1].start:{line:1,column:1,offset:0}),end:xs(w.length>0?w[w.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be0?{type:"text",value:x}:void 0),x===!1?d.lastIndex=S+1:(h!==S&&E.push({type:"text",value:u.value.slice(h,S)}),Array.isArray(x)?E.push(...x):x&&E.push(x),h=S+T[0].length,b=!0),!d.global)break;T=d.exec(u.value)}return b?(h?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=au(e,"("),o=au(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function RO(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||_i(n)||Ta(n))&&(!t||n!==47)}kO.peek=XK;function qK(){this.buffer()}function VK(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function GK(){this.buffer()}function KK(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function YK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Rn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $K(e){this.exit(e)}function WK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Rn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jK(e){this.exit(e)}function XK(){return"["}function kO(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function CT(){return{enter:{gfmFootnoteCallString:qK,gfmFootnoteCall:VK,gfmFootnoteDefinitionLabelString:GK,gfmFootnoteDefinition:KK},exit:{gfmFootnoteCallString:YK,gfmFootnoteCall:$K,gfmFootnoteDefinitionLabelString:WK,gfmFootnoteDefinition:jK}}}function AT(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:kO},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){let a=o.createTracker(s),l=a.move("[^"),u=o.enter("footnoteDefinition"),c=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),c(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?` -`:" ")+o.indentLines(o.containerFlow(r,a.current()),t?MO:QK))),u(),l}}function QK(e,t,n){return t===0?e:MO(e,t,n)}function MO(e,t,n){return(n?"":" ")+e}var ZK=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];OO.peek=tY;function NT(){return{canContainEols:["delete"],enter:{strikethrough:JK},exit:{strikethrough:eY}}}function wT(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ZK}],handlers:{delete:OO}}}function JK(e){this.enter({type:"delete",children:[]},e)}function eY(e){this.exit(e)}function OO(e,t,n,r){let i=n.createTracker(r),o=n.enter("strikethrough"),s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function tY(){return"~"}function nY(e){return e.length}function IO(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||nY,o=[],s=[],a=[],l=[],u=0,c=-1;for(;++cu&&(u=e[c].length);++bl[b])&&(l[b]=T)}g.push(E)}s[c]=g,a[c]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fl[f]&&(l[f]=E),p[f]=E),d[f]=T}s.splice(1,0,d),a.splice(1,0,p),c=-1;let h=[];for(;++c "),o.shift(2);let s=n.indentLines(n.containerFlow(e,o.current()),iY);return i(),s}function iY(e,t,n){return">"+(n?"":" ")+e}function BO(e,t){return PO(e,t.inConstruct,!0)&&!PO(e,t.notInConstruct,!1)}function PO(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r0){let Ke=$.tokenStack[$.tokenStack.length-1];(Ke[1]||AO).call($,void 0,Ke[0])}for(F.position={start:xs(w.length>0?w[0][1].start:{line:1,column:1,offset:0}),end:xs(w.length>0?w[w.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be0?{type:"text",value:x}:void 0),x===!1?d.lastIndex=S+1:(h!==S&&E.push({type:"text",value:u.value.slice(h,S)}),Array.isArray(x)?E.push(...x):x&&E.push(x),h=S+T[0].length,b=!0),!d.global)break;T=d.exec(u.value)}return b?(h?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=au(e,"("),o=au(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function RO(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||_i(n)||Ta(n))&&(!t||n!==47)}kO.peek=QK;function VK(){this.buffer()}function GK(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function KK(){this.buffer()}function YK(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function $K(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Rn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function WK(e){this.exit(e)}function jK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Rn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function XK(e){this.exit(e)}function QK(){return"["}function kO(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function CT(){return{enter:{gfmFootnoteCallString:VK,gfmFootnoteCall:GK,gfmFootnoteDefinitionLabelString:KK,gfmFootnoteDefinition:YK},exit:{gfmFootnoteCallString:$K,gfmFootnoteCall:WK,gfmFootnoteDefinitionLabelString:jK,gfmFootnoteDefinition:XK}}}function AT(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:kO},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){let a=o.createTracker(s),l=a.move("[^"),u=o.enter("footnoteDefinition"),c=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),c(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?` +`:" ")+o.indentLines(o.containerFlow(r,a.current()),t?MO:ZK))),u(),l}}function ZK(e,t,n){return t===0?e:MO(e,t,n)}function MO(e,t,n){return(n?"":" ")+e}var JK=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];OO.peek=nY;function NT(){return{canContainEols:["delete"],enter:{strikethrough:eY},exit:{strikethrough:tY}}}function wT(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:JK}],handlers:{delete:OO}}}function eY(e){this.enter({type:"delete",children:[]},e)}function tY(e){this.exit(e)}function OO(e,t,n,r){let i=n.createTracker(r),o=n.enter("strikethrough"),s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function nY(){return"~"}function rY(e){return e.length}function IO(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||rY,o=[],s=[],a=[],l=[],u=0,c=-1;for(;++cu&&(u=e[c].length);++bl[b])&&(l[b]=T)}g.push(E)}s[c]=g,a[c]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fl[f]&&(l[f]=E),p[f]=E),d[f]=T}s.splice(1,0,d),a.splice(1,0,p),c=-1;let h=[];for(;++c "),o.shift(2);let s=n.indentLines(n.containerFlow(e,o.current()),oY);return i(),s}function oY(e,t,n){return">"+(n?"":" ")+e}function BO(e,t){return PO(e,t.inConstruct,!0)&&!PO(e,t.notInConstruct,!1)}function PO(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++rs&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function FO(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function HO(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function zO(e,t,n,r){let i=HO(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(FO(e,n)){let f=n.enter("codeIndented"),d=n.indentLines(o,oY);return f(),d}let a=n.createTracker(r),l=i.repeat(Math.max(UO(o,i)+1,3)),u=n.enter("codeFenced"),c=a.move(l);if(e.lang){let f=n.enter(`codeFencedLang${s}`);c+=a.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){let f=n.enter(`codeFencedMeta${s}`);c+=a.move(" "),c+=a.move(n.safe(e.meta,{before:c,after:` +`}function UO(e,t){let n=String(e),r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function FO(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function HO(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function zO(e,t,n,r){let i=HO(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(FO(e,n)){let f=n.enter("codeIndented"),d=n.indentLines(o,sY);return f(),d}let a=n.createTracker(r),l=i.repeat(Math.max(UO(o,i)+1,3)),u=n.enter("codeFenced"),c=a.move(l);if(e.lang){let f=n.enter(`codeFencedLang${s}`);c+=a.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){let f=n.enter(`codeFencedMeta${s}`);c+=a.move(" "),c+=a.move(n.safe(e.meta,{before:c,after:` `,encode:["`"],...a.current()})),f()}return c+=a.move(` `),o&&(c+=a.move(o+` -`)),c+=a.move(l),u(),c}function oY(e,t,n){return(n?"":" ")+e}function yu(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function qO(e,t,n,r){let i=yu(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition"),a=n.enter("label"),l=n.createTracker(r),u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),s(),u}function VO(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function _s(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Eu(e,t,n){let r=mo(e),i=mo(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}kT.peek=sY;function kT(e,t,n,r){let i=VO(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i),l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()})),u=l.charCodeAt(0),c=Eu(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=_s(u)+l.slice(1));let f=l.charCodeAt(l.length-1),d=Eu(r.after.charCodeAt(0),f,i);d.inside&&(l=l.slice(0,-1)+_s(f));let p=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},a+l+p}function sY(e,t,n){return n.options.emphasis||"*"}function GO(e,t){let n=!1;return Le(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ga}),!!((!e.depth||e.depth<3)&&ya(e)&&(t.options.setext||n))}function KO(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(GO(e,n)){let c=n.enter("headingSetext"),f=n.enter("phrasing"),d=n.containerPhrasing(e,{...o.current(),before:` +`)),c+=a.move(l),u(),c}function sY(e,t,n){return(n?"":" ")+e}function yu(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function qO(e,t,n,r){let i=yu(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition"),a=n.enter("label"),l=n.createTracker(r),u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":` +`,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),s(),u}function VO(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function _s(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Eu(e,t,n){let r=mo(e),i=mo(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}kT.peek=aY;function kT(e,t,n,r){let i=VO(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i),l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()})),u=l.charCodeAt(0),c=Eu(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=_s(u)+l.slice(1));let f=l.charCodeAt(l.length-1),d=Eu(r.after.charCodeAt(0),f,i);d.inside&&(l=l.slice(0,-1)+_s(f));let p=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},a+l+p}function aY(e,t,n){return n.options.emphasis||"*"}function GO(e,t){let n=!1;return Le(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ga}),!!((!e.depth||e.depth<3)&&ya(e)&&(t.options.setext||n))}function KO(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(GO(e,n)){let c=n.enter("headingSetext"),f=n.enter("phrasing"),d=n.containerPhrasing(e,{...o.current(),before:` `,after:` `});return f(),c(),d+` `+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(` `))+1))}let s="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");o.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...o.current()});return/^[\t ]/.test(u)&&(u=_s(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}MT.peek=aY;function MT(e){return e.value||""}function aY(){return"<"}OT.peek=lY;function OT(e,t,n,r){let i=yu(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image"),a=n.enter("label"),l=n.createTracker(r),u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),s(),u}function lY(){return"!"}DT.peek=uY;function DT(e,t,n,r){let i=e.referenceType,o=n.enter("imageReference"),s=n.enter("label"),a=n.createTracker(r),l=a.move("!["),u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();let c=n.stack;n.stack=[],s=n.enter("reference");let f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=c,o(),i==="full"||!u||u!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function uY(){return"!"}IT.peek=cY;function IT(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}PT.peek=fY;function PT(e,t,n,r){let i=yu(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r),a,l;if(LT(e,n)){let c=n.stack;n.stack=[],a=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),a(),n.stack=c,f}a=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),l()),u+=s.move(")"),a(),u}function fY(e,t,n){return LT(e,n)?"<":"["}BT.peek=dY;function BT(e,t,n,r){let i=e.referenceType,o=n.enter("linkReference"),s=n.enter("label"),a=n.createTracker(r),l=a.move("["),u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();let c=n.stack;n.stack=[],s=n.enter("reference");let f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=c,o(),i==="full"||!u||u!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function dY(){return"["}function Tu(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function YO(e){let t=Tu(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function $O(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Im(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function WO(e,t,n,r){let i=n.enter("list"),o=n.bulletCurrent,s=e.ordered?$O(n):Tu(n),a=e.ordered?s==="."?")":".":YO(n),l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Im(n)===s&&c){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);let a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);let l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),c);return l(),u;function c(f,d,p){return d?(p?"":" ".repeat(s))+f:(p?o:o+" ".repeat(s-o.length))+f}}function QO(e,t,n,r){let i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}var UT=xi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ZO(e,t,n,r){return(e.children.some(function(s){return UT(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function JO(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}FT.peek=pY;function FT(e,t,n,r){let i=JO(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i),l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()})),u=l.charCodeAt(0),c=Eu(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=_s(u)+l.slice(1));let f=l.charCodeAt(l.length-1),d=Eu(r.after.charCodeAt(0),f,i);d.inside&&(l=l.slice(0,-1)+_s(f));let p=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},a+l+p}function pY(e,t,n){return n.options.strong||"*"}function e2(e,t,n,r){return n.safe(e.value,r)}function t2(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function n2(e,t,n){let r=(Im(n)+(n.options.ruleSpaces?" ":"")).repeat(t2(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Kf={blockquote:LO,break:RT,code:zO,definition:qO,emphasis:kT,hardBreak:RT,heading:KO,html:MT,image:OT,imageReference:DT,inlineCode:IT,link:PT,linkReference:BT,list:WO,listItem:XO,paragraph:QO,root:ZO,strong:FT,text:e2,thematicBreak:n2};function zT(){return{enter:{table:hY,tableData:r2,tableHeader:r2,tableRow:gY},exit:{codeText:bY,table:mY,tableData:HT,tableHeader:HT,tableRow:HT}}}function hY(e){let t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function mY(e){this.exit(e),this.data.inTable=void 0}function gY(e){this.enter({type:"tableRow",children:[]},e)}function HT(e){this.exit(e)}function r2(e){this.enter({type:"tableCell",children:[]},e)}function bY(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,yY));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function yY(e,t){return t==="|"?t:e}function qT(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...o.current()});return/^[\t ]/.test(u)&&(u=_s(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}MT.peek=lY;function MT(e){return e.value||""}function lY(){return"<"}OT.peek=uY;function OT(e,t,n,r){let i=yu(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image"),a=n.enter("label"),l=n.createTracker(r),u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),s(),u}function uY(){return"!"}DT.peek=cY;function DT(e,t,n,r){let i=e.referenceType,o=n.enter("imageReference"),s=n.enter("label"),a=n.createTracker(r),l=a.move("!["),u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();let c=n.stack;n.stack=[],s=n.enter("reference");let f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=c,o(),i==="full"||!u||u!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function cY(){return"!"}IT.peek=fY;function IT(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}PT.peek=dY;function PT(e,t,n,r){let i=yu(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r),a,l;if(LT(e,n)){let c=n.stack;n.stack=[],a=n.enter("autolink");let f=s.move("<");return f+=s.move(n.containerPhrasing(e,{before:f,after:">",...s.current()})),f+=s.move(">"),a(),n.stack=c,f}a=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),l()),u+=s.move(")"),a(),u}function dY(e,t,n){return LT(e,n)?"<":"["}BT.peek=pY;function BT(e,t,n,r){let i=e.referenceType,o=n.enter("linkReference"),s=n.enter("label"),a=n.createTracker(r),l=a.move("["),u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();let c=n.stack;n.stack=[],s=n.enter("reference");let f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=c,o(),i==="full"||!u||u!==f?l+=a.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function pY(){return"["}function Tu(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function YO(e){let t=Tu(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function $O(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Im(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function WO(e,t,n,r){let i=n.enter("list"),o=n.bulletCurrent,s=e.ordered?$O(n):Tu(n),a=e.ordered?s==="."?")":".":YO(n),l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Im(n)===s&&c){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);let a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);let l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),c);return l(),u;function c(f,d,p){return d?(p?"":" ".repeat(s))+f:(p?o:o+" ".repeat(s-o.length))+f}}function QO(e,t,n,r){let i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}var UT=xi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ZO(e,t,n,r){return(e.children.some(function(s){return UT(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function JO(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}FT.peek=hY;function FT(e,t,n,r){let i=JO(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i),l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()})),u=l.charCodeAt(0),c=Eu(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=_s(u)+l.slice(1));let f=l.charCodeAt(l.length-1),d=Eu(r.after.charCodeAt(0),f,i);d.inside&&(l=l.slice(0,-1)+_s(f));let p=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},a+l+p}function hY(e,t,n){return n.options.strong||"*"}function e2(e,t,n,r){return n.safe(e.value,r)}function t2(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function n2(e,t,n){let r=(Im(n)+(n.options.ruleSpaces?" ":"")).repeat(t2(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Kf={blockquote:LO,break:RT,code:zO,definition:qO,emphasis:kT,hardBreak:RT,heading:KO,html:MT,image:OT,imageReference:DT,inlineCode:IT,link:PT,linkReference:BT,list:WO,listItem:XO,paragraph:QO,root:ZO,strong:FT,text:e2,thematicBreak:n2};function zT(){return{enter:{table:mY,tableData:r2,tableHeader:r2,tableRow:bY},exit:{codeText:yY,table:gY,tableData:HT,tableHeader:HT,tableRow:HT}}}function mY(e){let t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function gY(e){this.exit(e),this.data.inTable=void 0}function bY(e){this.enter({type:"tableRow",children:[]},e)}function HT(e){this.exit(e)}function r2(e){this.enter({type:"tableCell",children:[]},e)}function yY(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,EY));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function EY(e,t){return t==="|"?t:e}function qT(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:s,tableCell:l,tableRow:a}};function s(p,h,g,y){return u(c(p,g,y),p.align)}function a(p,h,g,y){let b=f(p,g,y),E=u([b]);return E.slice(0,E.indexOf(` -`))}function l(p,h,g,y){let b=g.enter("tableCell"),E=g.enter("phrasing"),T=g.containerPhrasing(p,{...y,before:o,after:o});return E(),b(),T}function u(p,h){return IO(p,{align:h,alignDelimiters:r,padding:n,stringLength:i})}function c(p,h,g){let y=p.children,b=-1,E=[],T=h.enter("table");for(;++b0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var MY={tokenize:UY,partial:!0};function XT(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:LY,continuation:{tokenize:PY},exit:BY}},text:{91:{name:"gfmFootnoteCall",tokenize:IY},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:OY,resolveTo:DY}}}}function OY(e,t,n){let r=this,i=r.events.length,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),s;for(;i--;){let l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);let u=Rn(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function DY(e,t){let n=e.length,r;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){r=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function IY(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0,s;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(o>999||f===93&&!s||f===null||f===91||Pe(f))return n(f);if(f===93){e.exit("chunkString");let d=e.exit("gfmFootnoteCallString");return i.includes(Rn(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Pe(f)||(s=!0),o++,e.consume(f),f===92?c:u}function c(f){return f===91||f===92||f===93?(e.consume(f),o++,u):u(f)}}function LY(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o,s=0,a;return l;function l(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(h)}function c(h){if(s>999||h===93&&!a||h===null||h===91||Pe(h))return n(h);if(h===93){e.exit("chunkString");let g=e.exit("gfmFootnoteDefinitionLabelString");return o=Rn(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return Pe(h)||(a=!0),s++,e.consume(h),h===92?f:c}function f(h){return h===91||h===92||h===93?(e.consume(h),s++,c):c(h)}function d(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),i.includes(o)||i.push(o),ye(e,p,"gfmFootnoteDefinitionWhitespace")):n(h)}function p(h){return t(h)}}function PY(e,t,n){return e.check(vi,t,e.attempt(MY,t,n))}function BY(e){e.exit("gfmFootnoteDefinition")}function UY(e,t,n){let r=this;return ye(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function QT(e){let n=(e||{}).singleTilde,r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l1?l(h):(s.consume(h),f++,p);if(f<2&&!n)return l(h);let y=s.exit("strikethroughSequenceTemporary"),b=mo(h);return y._open=!b||b===2&&!!g,y._close=!g||g===2&&!!b,a(h)}}}var Lm=class{constructor(){this.map=[]}add(t,n,r){FY(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length,r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(let o of i)t.push(o);i=r.pop()}this.map.length=0}};function FY(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){let L=r.events[V][1].type;if(L==="lineEnding"||L==="linePrefix")V--;else break}let Y=V>-1?r.events[V][1].type:null,q=Y==="tableHead"||Y==="tableRow"?x:l;return q===x&&r.parser.lazy[r.now().line]?n(C):q(C)}function l(C){return e.enter("tableHead"),e.enter("tableRow"),u(C)}function u(C){return C===124||(s=!0,o+=1),c(C)}function c(C){return C===null?n(C):ae(C)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),p):n(C):Ee(C)?ye(e,c,"whitespace")(C):(o+=1,s&&(s=!1,i+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),s=!0,c):(e.enter("data"),f(C)))}function f(C){return C===null||C===124||Pe(C)?(e.exit("data"),c(C)):(e.consume(C),C===92?d:f)}function d(C){return C===92||C===124?(e.consume(C),f):f(C)}function p(C){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(C):(e.enter("tableDelimiterRow"),s=!1,Ee(C)?ye(e,h,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):h(C))}function h(C){return C===45||C===58?y(C):C===124?(s=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),g):v(C)}function g(C){return Ee(C)?ye(e,y,"whitespace")(C):y(C)}function y(C){return C===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),b):C===45?(o+=1,b(C)):C===null||ae(C)?S(C):v(C)}function b(C){return C===45?(e.enter("tableDelimiterFiller"),E(C)):v(C)}function E(C){return C===45?(e.consume(C),E):C===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(C))}function T(C){return Ee(C)?ye(e,S,"whitespace")(C):S(C)}function S(C){return C===124?h(C):C===null||ae(C)?!s||i!==o?v(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):v(C)}function v(C){return n(C)}function x(C){return e.enter("tableRow"),R(C)}function R(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),R):C===null||ae(C)?(e.exit("tableRow"),t(C)):Ee(C)?ye(e,R,"whitespace")(C):(e.enter("data"),O(C))}function O(C){return C===null||C===124||Pe(C)?(e.exit("data"),R(C)):(e.consume(C),C===92?B:O)}function B(C){return C===92||C===124?(e.consume(C),O):O(C)}}function zY(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,c,f,d=new Lm;for(;++nn[2]+1){let h=n[2]+1,g=n[3]-n[2]-1;e.add(h,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(o.end=Object.assign({},Su(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function h2(e,t,n,r,i){let o=[],s=Su(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Su(e,t){let n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}var qY={name:"tasklistCheck",tokenize:VY};function JT(){return{text:{91:qY}}}function VY(e,t,n){let r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Pe(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ae(l)?t(l):Ee(l)?e.check({tokenize:GY},t,n)(l):n(l)}}function GY(e,t,n){return ye(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function m2(e){return xm([WT(),XT(),QT(e),ZT(),JT()])}var KY={};function Aa(e){let t=this,n=e||KY,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(m2(n)),o.push(KT()),s.push(YT(n))}function g2(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function b2(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` +`))}function l(p,h,g,y){let b=g.enter("tableCell"),E=g.enter("phrasing"),T=g.containerPhrasing(p,{...y,before:o,after:o});return E(),b(),T}function u(p,h){return IO(p,{align:h,alignDelimiters:r,padding:n,stringLength:i})}function c(p,h,g){let y=p.children,b=-1,E=[],T=h.enter("table");for(;++b0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var OY={tokenize:FY,partial:!0};function XT(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:PY,continuation:{tokenize:BY},exit:UY}},text:{91:{name:"gfmFootnoteCall",tokenize:LY},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:DY,resolveTo:IY}}}}function DY(e,t,n){let r=this,i=r.events.length,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),s;for(;i--;){let l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!s||!s._balanced)return n(l);let u=Rn(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function IY(e,t){let n=e.length,r;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){r=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...l),e}function LY(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0,s;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(o>999||f===93&&!s||f===null||f===91||Pe(f))return n(f);if(f===93){e.exit("chunkString");let d=e.exit("gfmFootnoteCallString");return i.includes(Rn(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Pe(f)||(s=!0),o++,e.consume(f),f===92?c:u}function c(f){return f===91||f===92||f===93?(e.consume(f),o++,u):u(f)}}function PY(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o,s=0,a;return l;function l(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(h)}function c(h){if(s>999||h===93&&!a||h===null||h===91||Pe(h))return n(h);if(h===93){e.exit("chunkString");let g=e.exit("gfmFootnoteDefinitionLabelString");return o=Rn(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return Pe(h)||(a=!0),s++,e.consume(h),h===92?f:c}function f(h){return h===91||h===92||h===93?(e.consume(h),s++,c):c(h)}function d(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),i.includes(o)||i.push(o),ye(e,p,"gfmFootnoteDefinitionWhitespace")):n(h)}function p(h){return t(h)}}function BY(e,t,n){return e.check(vi,t,e.attempt(OY,t,n))}function UY(e){e.exit("gfmFootnoteDefinition")}function FY(e,t,n){let r=this;return ye(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function QT(e){let n=(e||{}).singleTilde,r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l1?l(h):(s.consume(h),f++,p);if(f<2&&!n)return l(h);let y=s.exit("strikethroughSequenceTemporary"),b=mo(h);return y._open=!b||b===2&&!!g,y._close=!g||g===2&&!!b,a(h)}}}var Lm=class{constructor(){this.map=[]}add(t,n,r){HY(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length,r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(let o of i)t.push(o);i=r.pop()}this.map.length=0}};function HY(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){let L=r.events[V][1].type;if(L==="lineEnding"||L==="linePrefix")V--;else break}let Y=V>-1?r.events[V][1].type:null,q=Y==="tableHead"||Y==="tableRow"?x:l;return q===x&&r.parser.lazy[r.now().line]?n(C):q(C)}function l(C){return e.enter("tableHead"),e.enter("tableRow"),u(C)}function u(C){return C===124||(s=!0,o+=1),c(C)}function c(C){return C===null?n(C):ae(C)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),p):n(C):Ee(C)?ye(e,c,"whitespace")(C):(o+=1,s&&(s=!1,i+=1),C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),s=!0,c):(e.enter("data"),f(C)))}function f(C){return C===null||C===124||Pe(C)?(e.exit("data"),c(C)):(e.consume(C),C===92?d:f)}function d(C){return C===92||C===124?(e.consume(C),f):f(C)}function p(C){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(C):(e.enter("tableDelimiterRow"),s=!1,Ee(C)?ye(e,h,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):h(C))}function h(C){return C===45||C===58?y(C):C===124?(s=!0,e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),g):v(C)}function g(C){return Ee(C)?ye(e,y,"whitespace")(C):y(C)}function y(C){return C===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),b):C===45?(o+=1,b(C)):C===null||ae(C)?S(C):v(C)}function b(C){return C===45?(e.enter("tableDelimiterFiller"),E(C)):v(C)}function E(C){return C===45?(e.consume(C),E):C===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(C),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(C))}function T(C){return Ee(C)?ye(e,S,"whitespace")(C):S(C)}function S(C){return C===124?h(C):C===null||ae(C)?!s||i!==o?v(C):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(C)):v(C)}function v(C){return n(C)}function x(C){return e.enter("tableRow"),R(C)}function R(C){return C===124?(e.enter("tableCellDivider"),e.consume(C),e.exit("tableCellDivider"),R):C===null||ae(C)?(e.exit("tableRow"),t(C)):Ee(C)?ye(e,R,"whitespace")(C):(e.enter("data"),O(C))}function O(C){return C===null||C===124||Pe(C)?(e.exit("data"),R(C)):(e.consume(C),C===92?B:O)}function B(C){return C===92||C===124?(e.consume(C),O):O(C)}}function qY(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,c,f,d=new Lm;for(;++nn[2]+1){let h=n[2]+1,g=n[3]-n[2]-1;e.add(h,g,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(o.end=Object.assign({},Su(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function h2(e,t,n,r,i){let o=[],s=Su(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Su(e,t){let n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}var VY={name:"tasklistCheck",tokenize:GY};function JT(){return{text:{91:VY}}}function GY(e,t,n){let r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),o)}function o(l){return Pe(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ae(l)?t(l):Ee(l)?e.check({tokenize:KY},t,n)(l):n(l)}}function KY(e,t,n){return ye(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function m2(e){return xm([WT(),XT(),QT(e),ZT(),JT()])}var YY={};function Aa(e){let t=this,n=e||YY,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(m2(n)),o.push(KT()),s.push(YT(n))}function g2(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function b2(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` `}]}function y2(e,t){let n=t.value?t.value+` -`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function E2(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T2(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function S2(e,t){let n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Wr(r.toLowerCase()),o=e.footnoteOrder.indexOf(r),s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);let l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);let u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function x2(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _2(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Bm(e,t){let n=t.referenceType,r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});let s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function v2(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Bm(e,t);let i={src:Wr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function C2(e,t){let n={src:Wr(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function A2(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function N2(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Bm(e,t);let i={href:Wr(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);let o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function w2(e,t){let n={href:Wr(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function R2(e,t,n){let r=e.all(t),i=n?YY(n):k2(t),o={},s=[];if(typeof t.checked=="boolean"){let c=r[0],f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function E2(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T2(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function S2(e,t){let n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Wr(r.toLowerCase()),o=e.footnoteOrder.indexOf(r),s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+1,a+=1,e.footnoteCounts.set(r,a);let l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);let u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function x2(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _2(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Bm(e,t){let n=t.referenceType,r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});let s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function v2(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Bm(e,t);let i={src:Wr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function C2(e,t){let n={src:Wr(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function A2(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function N2(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Bm(e,t);let i={href:Wr(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);let o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function w2(e,t){let n={href:Wr(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function R2(e,t,n){let r=e.all(t),i=n?$Y(n):k2(t),o={},s=[];if(typeof t.checked=="boolean"){let c=r[0],f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a1}function M2(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){let s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=or(t.children[1]),l=pa(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function P2(e,t,n){let r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length,l=-1,u=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(U2(t.slice(i),i>0,!1)),o.join("")}function U2(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===9||o===32;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===9||o===32;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function H2(e,t){let n={type:"text",value:F2(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function z2(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var q2={blockquote:g2,break:b2,code:y2,delete:E2,emphasis:T2,footnoteReference:S2,heading:x2,html:_2,imageReference:v2,image:C2,inlineCode:A2,linkReference:N2,link:w2,listItem:R2,list:M2,paragraph:O2,root:D2,strong:I2,table:L2,tableCell:B2,tableRow:P2,text:H2,thematicBreak:z2,toml:Um,yaml:Um,definition:Um,footnoteDefinition:Um};function Um(){}var V2=typeof self=="object"?self:globalThis,XY=(e,t)=>{let n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);let[o,s]=t[i];switch(o){case 0:case-1:return n(s,i);case 1:{let a=n([],i);for(let l of s)a.push(r(l));return a}case 2:{let a=n({},i);for(let[l,u]of s)a[r(l)]=r(u);return a}case 3:return n(new Date(s),i);case 4:{let{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case 5:{let a=n(new Map,i);for(let[l,u]of s)a.set(r(l),r(u));return a}case 6:{let a=n(new Set,i);for(let l of s)a.add(r(l));return a}case 7:{let{name:a,message:l}=s;return n(new V2[a](l),i)}case 8:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new V2[o](s),i)};return r},nS=e=>XY(new Map,e)(0);var xu="",{toString:QY}={},{keys:ZY}=Object,Yf=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let n=QY.call(e).slice(8,-1);switch(n){case"Array":return[1,xu];case"Object":return[2,xu];case"Date":return[3,xu];case"RegExp":return[4,xu];case"Map":return[5,xu];case"Set":return[6,xu];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Hm=([e,t])=>e===0&&(t==="function"||t==="symbol"),JY=(e,t,n,r)=>{let i=(s,a)=>{let l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=Yf(s);switch(a){case 0:{let c=s;switch(l){case"bigint":a=8,c=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([-1],s)}return i([a,c],s)}case 1:{if(l){let d=s;return l==="DataView"?d=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(d=new Uint8Array(s)),i([l,[...d]],s)}let c=[],f=i([a,c],s);for(let d of s)c.push(o(d));return f}case 2:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());let c=[],f=i([a,c],s);for(let d of ZY(s))(e||!Hm(Yf(s[d])))&&c.push([o(d),o(s[d])]);return f}case 3:return i([a,s.toISOString()],s);case 4:{let{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case 5:{let c=[],f=i([a,c],s);for(let[d,p]of s)(e||!(Hm(Yf(d))||Hm(Yf(p))))&&c.push([o(d),o(p)]);return f}case 6:{let c=[],f=i([a,c],s);for(let d of s)(e||!Hm(Yf(d)))&&c.push(o(d));return f}}let{message:u}=s;return i([a,{name:l,message:u}],s)};return o},rS=(e,{json:t,lossy:n}={})=>{let r=[];return JY(!(t||n),!!t,new Map,r)(e),r};var li=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?nS(rS(e,t)):structuredClone(e):(e,t)=>nS(rS(e,t));function e$(e,t){let n=[{type:"text",value:"\u21A9"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function t$(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function W2(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||e$,r=e.options.footnoteBackLabel||t$,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[],l=-1;for(;++l0&&h.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,p);typeof E=="string"&&(E={type:"text",value:E}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}let y=c[c.length-1];if(y&&y.type==="element"&&y.tagName==="p"){let E=y.children[y.children.length-1];E&&E.type==="text"?E.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...h)}else c.push(...h);let b={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(c,!0)};e.patch(u,b),a.push(b)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...li(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`});let u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function $Y(e){let t=!1;if(e.type==="list"){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r1}function M2(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){let s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=or(t.children[1]),l=pa(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function P2(e,t,n){let r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length,l=-1,u=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(U2(t.slice(i),i>0,!1)),o.join("")}function U2(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===9||o===32;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===9||o===32;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function H2(e,t){let n={type:"text",value:F2(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function z2(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var q2={blockquote:g2,break:b2,code:y2,delete:E2,emphasis:T2,footnoteReference:S2,heading:x2,html:_2,imageReference:v2,image:C2,inlineCode:A2,linkReference:N2,link:w2,listItem:R2,list:M2,paragraph:O2,root:D2,strong:I2,table:L2,tableCell:B2,tableRow:P2,text:H2,thematicBreak:z2,toml:Um,yaml:Um,definition:Um,footnoteDefinition:Um};function Um(){}var V2=typeof self=="object"?self:globalThis,QY=(e,t)=>{let n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);let[o,s]=t[i];switch(o){case 0:case-1:return n(s,i);case 1:{let a=n([],i);for(let l of s)a.push(r(l));return a}case 2:{let a=n({},i);for(let[l,u]of s)a[r(l)]=r(u);return a}case 3:return n(new Date(s),i);case 4:{let{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case 5:{let a=n(new Map,i);for(let[l,u]of s)a.set(r(l),r(u));return a}case 6:{let a=n(new Set,i);for(let l of s)a.add(r(l));return a}case 7:{let{name:a,message:l}=s;return n(new V2[a](l),i)}case 8:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new V2[o](s),i)};return r},nS=e=>QY(new Map,e)(0);var xu="",{toString:ZY}={},{keys:JY}=Object,Yf=e=>{let t=typeof e;if(t!=="object"||!e)return[0,t];let n=ZY.call(e).slice(8,-1);switch(n){case"Array":return[1,xu];case"Object":return[2,xu];case"Date":return[3,xu];case"RegExp":return[4,xu];case"Map":return[5,xu];case"Set":return[6,xu];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Hm=([e,t])=>e===0&&(t==="function"||t==="symbol"),e$=(e,t,n,r)=>{let i=(s,a)=>{let l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=Yf(s);switch(a){case 0:{let c=s;switch(l){case"bigint":a=8,c=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([-1],s)}return i([a,c],s)}case 1:{if(l){let d=s;return l==="DataView"?d=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(d=new Uint8Array(s)),i([l,[...d]],s)}let c=[],f=i([a,c],s);for(let d of s)c.push(o(d));return f}case 2:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());let c=[],f=i([a,c],s);for(let d of JY(s))(e||!Hm(Yf(s[d])))&&c.push([o(d),o(s[d])]);return f}case 3:return i([a,s.toISOString()],s);case 4:{let{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case 5:{let c=[],f=i([a,c],s);for(let[d,p]of s)(e||!(Hm(Yf(d))||Hm(Yf(p))))&&c.push([o(d),o(p)]);return f}case 6:{let c=[],f=i([a,c],s);for(let d of s)(e||!Hm(Yf(d)))&&c.push(o(d));return f}}let{message:u}=s;return i([a,{name:l,message:u}],s)};return o},rS=(e,{json:t,lossy:n}={})=>{let r=[];return e$(!(t||n),!!t,new Map,r)(e),r};var li=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?nS(rS(e,t)):structuredClone(e):(e,t)=>nS(rS(e,t));function t$(e,t){let n=[{type:"text",value:"\u21A9"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function n$(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function W2(e){let t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||t$,r=e.options.footnoteBackLabel||n$,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[],l=-1;for(;++l0&&h.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,p);typeof E=="string"&&(E={type:"text",value:E}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}let y=c[c.length-1];if(y&&y.type==="element"&&y.tagName==="p"){let E=y.children[y.children.length-1];E&&E.type==="text"?E.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...h)}else c.push(...h);let b={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(c,!0)};e.patch(u,b),a.push(b)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...li(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:` -`}]}}var iS={}.hasOwnProperty,n$={};function X2(e,t){let n=t||n$,r=new Map,i=new Map,o=new Map,s={...q2,...n.handlers},a={all:u,applyData:i$,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:r$,wrap:s$};return Le(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){let f=c.type==="definition"?r:i,d=String(c.identifier).toUpperCase();f.has(d)||f.set(d,c)}}),a;function l(c,f){let d=c.type,p=a.handlers[d];if(iS.call(a.handlers,d)&&p)return p(a,c,f);if(a.options.passThrough&&a.options.passThrough.includes(d)){if("children"in c){let{children:g,...y}=c,b=li(y);return b.children=a.all(c),b}return li(c)}return(a.options.unknownHandler||o$)(a,c,f)}function u(c){let f=[];if("children"in c){let d=c.children,p=-1;for(;++p0&&n.push({type:"text",value:` `}),n}function j2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function zm(e,t){let n=X2(e,t),r=n.one(e,void 0),i=W2(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&("children"in o,o.children.push({type:"text",value:` -`},i)),o}function Na(e,t){return e&&"run"in e?async function(n,r){let i=zm(n,{file:r,...t});await e.run(i,r)}:function(n,r){return zm(n,{file:r,...e||t})}}var a$={},l$={}.hasOwnProperty,Q2=su("type",{handlers:{root:u$,element:h$,text:d$,comment:p$,doctype:f$}});function oS(e,t){let r=(t||a$).space;return Q2(e,r==="svg"?An:ri)}function u$(e,t){let n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=sS(e.children,n,t),_u(e,n),n}function c$(e,t){let n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=sS(e.children,n,t),_u(e,n),n}function f$(e){let t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return _u(e,t),t}function d$(e){let t={nodeName:"#text",value:e.value,parentNode:null};return _u(e,t),t}function p$(e){let t={nodeName:"#comment",data:e.value,parentNode:null};return _u(e,t),t}function h$(e,t){let n=t,r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=An);let i=[],o;if(e.properties){for(o in e.properties)if(o!=="children"&&l$.call(e.properties,o)){let l=m$(r,o,e.properties[o]);l&&i.push(l)}}let s=r.space;let a={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Ei[s],childNodes:[],parentNode:null};return a.childNodes=sS(e.children,a,r),_u(e,a),e.tagName==="template"&&e.content&&(a.content=c$(e.content,r)),a}function m$(e,t,n){let r=ni(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?lu(n):uu(n));let i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){let o=i.name.indexOf(":");o<0?i.prefix="":(i.name=i.name.slice(o+1),i.prefix=r.attribute.slice(0,o)),i.namespace=Ei[r.space]}return i}function sS(e,t,n){let r=-1,i=[];if(e)for(;++r])/gi,b$=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Z2={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function qm(e,t){let n=N$(e),r=su("type",{handlers:{root:y$,element:E$,text:T$,comment:eD,doctype:S$,raw:_$},unknown:v$}),i={parser:n?new Es(Z2):Es.getFragmentParser(void 0,Z2),handle(a){r(a,i)},stitches:!1,options:t||{}};r(e,i),vu(i,or());let o=n?i.parser.document:i.parser.getFragment(),s=Sf(o,{file:i.options.file});return i.stitches&&Le(s,"comment",function(a,l,u){let c=a;if(c.value.stitch&&u&&l!==void 0){let f=u.children;return f[l]=c.value.stitch,l}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function J2(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);let n={type:ms.TokenType.CHARACTER,chars:e.value,location:$f(e)};vu(t,or(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function S$(e,t){let n={type:ms.TokenType.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:$f(e)};vu(t,or(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function x$(e,t){t.stitches=!0;let n=w$(e);if("children"in e&&"children"in n){let r=qm({type:"root",children:e.children},t.options);n.children=r.children}eD({type:"comment",value:{stitch:n}},t)}function eD(e,t){let n=e.value,r={type:ms.TokenType.COMMENT,data:n,location:$f(e)};vu(t,or(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function _$(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,tD(t,or(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(g$,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function v$(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))x$(n,t);else{let r="";throw b$.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function vu(e,t){tD(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ct.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function tD(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function C$(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ct.PLAINTEXT)return;vu(t,or(e));let r=t.parser.openElements.current,i="namespaceURI"in r?r.namespaceURI:Ei.html;i===Ei.html&&n==="svg"&&(i=Ei.svg);let o=oS({...e,children:[]},{space:i===Ei.svg?"svg":"html"}),s={type:ms.TokenType.START_TAG,tagName:n,tagID:_f.getTagID(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:$f(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function A$(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Bh.includes(n)||t.parser.tokenizer.state===Ct.PLAINTEXT)return;vu(t,pa(e));let r={type:ms.TokenType.END_TAG,tagName:n,tagID:_f.getTagID(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:$f(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ct.RCDATA||t.parser.tokenizer.state===Ct.RAWTEXT||t.parser.tokenizer.state===Ct.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ct.DATA)}function N$(e){let t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function $f(e){let t=or(e)||{line:void 0,column:void 0,offset:void 0},n=pa(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function w$(e){return"children"in e?li({...e,children:[]}):li(e)}function Wf(e){return function(t,n){return qm(t,{...e,file:n})}}var wa=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],aS={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...wa,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...wa],h2:[["className","sr-only"]],img:[...wa,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...wa,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...wa],table:[...wa],ul:[...wa,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]};var vs={}.hasOwnProperty;function lS(e,t){let n={type:"root",children:[]},r={schema:t?{...aS,...t}:aS,stack:[]},i=iD(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function iD(e,t){if(t&&typeof t=="object"){let n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return R$(e,n);case"doctype":return k$(e,n);case"element":return M$(e,n);case"root":return O$(e,n);case"text":return D$(e,n);default:}}}function R$(e,t){if(e.schema.allowComments){let n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),o={type:"comment",value:r<0?n:n.slice(0,r)};return jf(o,t),o}}function k$(e,t){if(e.schema.allowDoctypes){let n={type:"doctype"};return jf(n,t),n}}function M$(e,t){let n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);let r=oD(e,t.children),i=I$(e,t.properties);e.stack.pop();let o=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(o=!0,e.schema.ancestors&&vs.call(e.schema.ancestors,n))){let a=e.schema.ancestors[n],l=-1;for(o=!1;++l1){let i=!1,o=0;for(;++o-1&&o>l||s>-1&&o>s||a>-1&&o>a)return!0;let u=-1;for(;++u4&&t.slice(0,4).toLowerCase()==="data")return n}function Vm(e){return function(t){return lS(t,e)}}var Gm=function(e,t,n){let r=xi(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=c):c&&(u!==void 0&&u>-1&&l.push(` -`.repeat(u)||" "),u=-1,l.push(c))}return l.join("")}function dD(e,t,n){return e.type==="element"?V$(e,t,n):e.type==="text"?n.whitespace==="normal"?pD(e,n):G$(e):[]}function V$(e,t,n){let r=hD(e,n),i=e.children||[],o=-1,s=[];if(q$(e))return s;let a,l;for(cS(e)||cD(e)&&Gm(t,e,cD)?l=` -`:z$(e)?(a=2,l=2):fD(e)&&(a=1,l=1);++o]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],S={type:g,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},v={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},x=[v,f,a,n,e.C_BLOCK_COMMENT_MODE,c,u],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:x.concat([{begin:/\(/,end:/\)/,keywords:S,contains:x.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:p,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:S,illegal:"",keywords:S,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:S},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function mD(e){let t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=j$(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function gD(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(a);let l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},c={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},d=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${d.join("|")})`,relevance:10}),h={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],b={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],T=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],S=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],v=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:y,built_in:[...E,...T,"set","shopt",...S,...v]},contains:[p,e.SHEBANG(),h,f,o,s,b,a,l,u,c,n]}}function bD(e){let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",y={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},b=[f,a,n,e.C_BLOCK_COMMENT_MODE,c,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:b.concat([{begin:/\(/,end:/\)/,keywords:y,contains:b.concat(["self"]),relevance:0}]),relevance:0},T={begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(d,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:y,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:y}}}function yD(e){let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],S={type:g,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},v={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},x=[v,f,a,n,e.C_BLOCK_COMMENT_MODE,c,u],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:x.concat([{begin:/\(/,end:/\)/,keywords:S,contains:x.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:p,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:S,illegal:"",keywords:S,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:S},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function ED(e){let t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:t,literal:r},a=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},c={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(c,{illegal:/\n/}),d={className:"subst",begin:/\{/,end:/\}/,keywords:s},p=e.inherit(d,{illegal:/\n/}),h={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]},y=e.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});d.contains=[g,h,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],p.contains=[y,h,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let b={variants:[u,g,h,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},T=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",S={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},b,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+T+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,E],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[b,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},S]}}var X$=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Q$=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Z$=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],J$=[...Q$,...Z$],eW=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),tW=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),nW=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rW=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function TD(e){let t=e.regex,n=X$(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+tW.join("|")+")"},{begin:":(:)?("+nW.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rW.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:eW.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+J$.join("|")+")\\b"}]}}function SD(e){let t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function xD(e){let o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"AD(e,t,n-1))}function ND(e){let t=e.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+AD("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},c={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[c,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,CD,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},CD,u]}}var wD="[A-Za-z$_][0-9A-Za-z$_]*",iW=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],oW=["true","false","null","undefined","NaN","Infinity"],RD=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],kD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],MD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],sW=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],aW=[].concat(MD,RD,kD);function OD(e){let t=e.regex,n=(D,{after:U})=>{let _="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,U)=>{let _=D[0].length+D.index,te=D.input[_];if(te==="<"||te===","){U.ignoreMatch();return}te===">"&&(n(D,{after:_})||U.ignoreMatch());let ne,A=D.input.substring(_);if(ne=A.match(/^\s*=/)){U.ignoreMatch();return}if((ne=A.match(/^\s+extends\s+/))&&ne.index===0){U.ignoreMatch();return}}},a={$pattern:wD,keyword:iW,literal:oW,built_in:aW,"variable.language":sW},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,g,y,{match:/\$\d+/},f];d.contains=T.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(T)});let S=[].concat(E,d.contains),v=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(S)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:v},R={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...RD,...kD]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},V={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(D){return t.concat("(?!",D.join("|"),")")}let q={match:t.concat(/\b/,Y([...MD,"super","import"].map(D=>`${D}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,g,y,E,{match:/\$\d+/},f,O,{scope:"attr",match:r+t.lookahead(":"),relevance:0},P,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},q,V,R,H,{match:/\$[(.]/}]}}function DD(e){let t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Au="[0-9](_*[0-9])*",$m=`\\.(${Au})`,Wm="[0-9a-fA-F](_*[0-9a-fA-F])*",lW={className:"number",variants:[{begin:`(\\b(${Au})((${$m})|\\.)?|(${$m}))[eE][+-]?(${Au})[fFdD]?\\b`},{begin:`\\b(${Au})((${$m})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${$m})[fFdD]?\\b`},{begin:`\\b(${Au})[fFdD]\\b`},{begin:`\\b0[xX]((${Wm})\\.?|(${Wm})?\\.(${Wm}))[pP][+-]?(${Au})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Wm})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function ID(e){let t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);let a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(s,{className:"string"}),"self"]}]},u=lW,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=f;return d.variants[1].contains=[f],f.variants[1].contains=[d],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,n,r,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,a,l,s,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}var uW=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),cW=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],fW=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],dW=[...cW,...fW],pW=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),LD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),PD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),hW=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),mW=LD.concat(PD).sort().reverse();function BD(e){let t=uW(e),n=mW,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],a=[],l=function(T){return{className:"string",begin:"~?"+T+".*?"+T}},u=function(T,S,v){return{className:T,begin:S,relevance:v}},c={$pattern:/[a-z-]+/,keyword:r,attribute:pW.join(" ")},f={begin:"\\(",end:"\\)",contains:a,keywords:c,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);let d=a.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},h={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+hW.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:a,relevance:0}},y={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:d}},b={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+dW.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",o,0),u("selector-id","#"+o),u("selector-class","\\."+o,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+LD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+PD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},t.FUNCTION_DISPATCH]},E={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[b]};return s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,y,E,h,b,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function UD(e){let t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function FD(e){let t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},c={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),d=e.inherit(c,{contains:[]});u.contains.push(d),c.contains.push(f);let p=[n,l];return[u,c,f,d].forEach(b=>{b.contains=b.contains.concat(p)}),p=p.concat(u,c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,o,u,c,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,l,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function zD(e){let t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function qD(e){let t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},c=[e.BACKSLASH_ESCAPE,o,l],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],d=(g,y,b="\\1")=>{let E=b==="\\1"?b:t.concat(b,y);return t.concat(t.concat("(?:",g,")"),y,/(?:\\.|[^\\\/])*?/,E,/(?:\\.|[^\\\/])*?/,b,r)},p=(g,y,b)=>t.concat(t.concat("(?:",g,")"),y,/(?:\\.|[^\\\/])*?/,b,r),h=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:c,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:d("s|tr|y",t.either(...f,{capture:!0}))},{begin:d("s|tr|y","\\(","\\)")},{begin:d("s|tr|y","\\[","\\]")},{begin:d("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=h,s.contains=h,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:h}}function VD(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),c=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(L,H)=>{H.data._beginMatch=L[1]||L[2]},"on:end":(L,H)=>{H.data._beginMatch!==L[1]&&H.ignoreMatch()}},d=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ -]`,h={scope:"string",variants:[c,u,f,d]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},y=["false","null","true"],b=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],S={keyword:b,literal:(L=>{let H=[];return L.forEach(I=>{H.push(I),I.toLowerCase()===I?H.push(I.toUpperCase()):H.push(I.toLowerCase())}),H})(y),built_in:E},v=L=>L.map(H=>H.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",v(E).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},R=t.concat(r,"\\b(?!\\()"),O={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},B={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},C={relevance:0,begin:/\(/,end:/\)/,keywords:S,contains:[B,s,O,e.C_BLOCK_COMMENT_MODE,h,g,x]},V={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",v(b).join("\\b|"),"|",v(E).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[C]};C.contains.push(V);let Y=[B,O,e.C_BLOCK_COMMENT_MODE,h,g,x],q={begin:t.concat(/#\[\s*\\?/,t.either(i,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...Y]},...Y,{scope:"meta",variants:[{match:i},{match:o}]}]};return{case_insensitive:!1,keywords:S,contains:[q,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},s,V,O,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},x,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:S,contains:["self",q,s,O,e.C_BLOCK_COMMENT_MODE,h,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},h,g]}}function GD(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function KD(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function YD(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},c={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,c,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,c,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",p=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,h=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${p}))[eE][+-]?(${d})[jJ]?(?=${h})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${d})[jJ](?=${h})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},b={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,g,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,b,f]}]}}function $D(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function WD(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function jD(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:s},f={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},d="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",h={className:"number",relevance:0,variants:[{begin:`\\b(${d})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},x=[f,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);c.contains=x,g.contains=x;let C=[{begin:/^\s*=>/,starts:{end:"$",contains:x}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:x}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(C).concat(u).concat(x)}}function XD(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],c=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:c,keyword:a,literal:l,built_in:u},illegal:""},o]}}var gW=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),bW=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],yW=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],EW=[...bW,...yW],TW=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),SW=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),xW=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),_W=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function QD(e){let t=gW(e),n=xW,r=SW,i="@[a-z-]+",o="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+EW.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+_W.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:TW.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function ZD(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function JD(e){let t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],c=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],d=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=c,h=[...u,...l].filter(v=>!c.includes(v)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},b={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function E(v){return t.concat(/\b/,t.either(...v.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}let T={scope:"keyword",match:E(d),relevance:0};function S(v,{exceptions:x,when:R}={}){let O=R;return x=x||[],v.map(B=>B.match(/\|\d+$/)||x.includes(B)?B:O(B)?`${B}|0`:B)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:S(h,{when:v=>v.length<3}),literal:o,type:a,built_in:f},contains:[{scope:"type",match:E(s)},T,b,g,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,y]}}function rI(e){return e?typeof e=="string"?e:e.source:null}function Xf(e){return st("(?=",e,")")}function st(...e){return e.map(n=>rI(n)).join("")}function vW(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function qn(...e){return"("+(vW(e).capture?"":"?:")+e.map(r=>rI(r)).join("|")+")"}var hS=e=>st(/\b/,e,/\w$/.test(e)?/\b/:/\B/),CW=["Protocol","Type"].map(hS),eI=["init","self"].map(hS),AW=["Any","Self"],dS=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],tI=["false","nil","true"],NW=["assignment","associativity","higherThan","left","lowerThan","none","right"],wW=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],nI=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],iI=qn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),oI=qn(iI,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),pS=st(iI,oI,"*"),sI=qn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Xm=qn(sI,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ai=st(sI,Xm,"*"),jm=st(/[A-Z]/,Xm,"*"),RW=["attached","autoclosure",st(/convention\(/,qn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",st(/objc\(/,Ai,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],kW=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function aI(e){let t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,qn(...CW,...eI)],className:{2:"keyword"}},o={match:st(/\./,qn(...dS)),relevance:0},s=dS.filter(me=>typeof me=="string").concat(["_|0"]),a=dS.filter(me=>typeof me!="string").concat(AW).map(hS),l={variants:[{className:"keyword",match:qn(...a,...eI)}]},u={$pattern:qn(/\b\w+/,/#\w+/),keyword:s.concat(wW),literal:tI},c=[i,o,l],f={match:st(/\./,qn(...nI)),relevance:0},d={className:"built_in",match:st(/\b/,qn(...nI),/(?=\()/)},p=[f,d],h={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:pS},{match:`\\.(\\.|${oI})+`}]},y=[h,g],b="([0-9]_*)+",E="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${b})(\\.(${b}))?([eE][+-]?(${b}))?\\b`},{match:`\\b0x(${E})(\\.(${E}))?([pP][+-]?(${b}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},S=(me="")=>({className:"subst",variants:[{match:st(/\\/,me,/[0\\tnr"']/)},{match:st(/\\/,me,/u\{[0-9a-fA-F]{1,8}\}/)}]}),v=(me="")=>({className:"subst",match:st(/\\/,me,/[\t ]*(?:[\r\n]|\r\n)/)}),x=(me="")=>({className:"subst",label:"interpol",begin:st(/\\/,me,/\(/),end:/\)/}),R=(me="")=>({begin:st(me,/"""/),end:st(/"""/,me),contains:[S(me),v(me),x(me)]}),O=(me="")=>({begin:st(me,/"/),end:st(/"/,me),contains:[S(me),x(me)]}),B={className:"string",variants:[R(),R("#"),R("##"),R("###"),O(),O("#"),O("##"),O("###")]},C=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],V={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:C},Y=me=>{let we=st(me,/\//),ue=st(/\//,me);return{begin:we,end:ue,contains:[...C,{scope:"comment",begin:`#(?!.*${ue})`,end:/$/}]}},q={scope:"regexp",variants:[Y("###"),Y("##"),Y("#"),V]},L={match:st(/`/,Ai,/`/)},H={className:"variable",match:/\$\d+/},I={className:"variable",match:`\\$${Xm}+`},P=[L,H,I],D={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:kW,contains:[...y,T,B]}]}},U={scope:"keyword",match:st(/@/,qn(...RW),Xf(qn(/\(/,/\s+/)))},_={scope:"meta",match:st(/@/,Ai)},te=[D,U,_],ne={match:Xf(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:st(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Xm,"+")},{className:"type",match:jm,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:st(/\s+&\s+/,Xf(jm)),relevance:0}]},A={begin://,keywords:u,contains:[...r,...c,...te,h,ne]};ne.contains.push(A);let re={match:st(Ai,/\s*:/),keywords:"_|0",relevance:0},se={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",re,...r,q,...c,...p,...y,T,B,...P,...te,ne]},xe={begin://,keywords:"repeat each",contains:[...r,ne]},Ve={begin:qn(Xf(st(Ai,/\s*:/)),Xf(st(Ai,/\s+/,Ai,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ai}]},de={begin:/\(/,end:/\)/,keywords:u,contains:[Ve,...r,...c,...y,T,B,...te,ne,se],endsParent:!0,illegal:/["']/},ct={match:[/(func|macro)/,/\s+/,qn(L.match,Ai,pS)],className:{1:"keyword",3:"title.function"},contains:[xe,de,t],illegal:[/\[/,/%/]},Ge={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[xe,de,t],illegal:/\[|%/},rt={match:[/operator/,/\s+/,pS],className:{1:"keyword",3:"title"}},he={begin:[/precedencegroup/,/\s+/,jm],className:{1:"keyword",3:"title"},contains:[ne],keywords:[...NW,...tI],end:/}/},Ce={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ae={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ne={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ai,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[xe,...c,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:jm},...c],relevance:0}]};for(let me of B.variants){let we=me.contains.find(St=>St.label==="interpol");we.keywords=u;let ue=[...c,...p,...y,T,B,...P];we.contains=[...ue,{begin:/\(/,end:/\)/,contains:["self",...ue]}]}return{name:"Swift",keywords:u,contains:[...r,ct,Ge,Ce,Ae,Ne,rt,he,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},q,...c,...p,...y,T,B,...P,...te,ne,se]}}var Qm="[A-Za-z$_][0-9A-Za-z$_]*",lI=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],uI=["true","false","null","undefined","NaN","Infinity"],cI=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],fI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],dI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],pI=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],hI=[].concat(dI,cI,fI);function MW(e){let t=e.regex,n=(D,{after:U})=>{let _="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,U)=>{let _=D[0].length+D.index,te=D.input[_];if(te==="<"||te===","){U.ignoreMatch();return}te===">"&&(n(D,{after:_})||U.ignoreMatch());let ne,A=D.input.substring(_);if(ne=A.match(/^\s*=/)){U.ignoreMatch();return}if((ne=A.match(/^\s+extends\s+/))&&ne.index===0){U.ignoreMatch();return}}},a={$pattern:Qm,keyword:lI,literal:uI,built_in:hI,"variable.language":pI},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,g,y,{match:/\$\d+/},f];d.contains=T.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(T)});let S=[].concat(E,d.contains),v=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(S)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:v},R={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...cI,...fI]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},V={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(D){return t.concat("(?!",D.join("|"),")")}let q={match:t.concat(/\b/,Y([...dI,"super","import"].map(D=>`${D}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,g,y,E,{match:/\$\d+/},f,O,{scope:"attr",match:r+t.lookahead(":"),relevance:0},P,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},q,V,R,H,{match:/\$[(.]/}]}}function mI(e){let t=e.regex,n=MW(e),r=Qm,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Qm,keyword:lI.concat(l),literal:uI,built_in:hI.concat(i),"variable.language":pI},c={className:"meta",begin:"@"+r},f=(g,y,b)=>{let E=g.contains.findIndex(T=>T.label===y);if(E===-1)throw new Error("can not find mode to replace");g.contains.splice(E,1,b)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(c);let d=n.contains.find(g=>g.scope==="attr"),p=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,p]),n.contains=n.contains.concat([c,o,s,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",a);let h=n.contains.find(g=>g.label==="func.def");return h.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function gI(e){let t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,i),/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,t.either(o,i),/ +/,t.either(s,a),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},c={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,u,c,f,d,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[d]}]}}function bI(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");let n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,e.QUOTE_STRING_MODE,l,u,a]}}function yI(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(o,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,l,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,l,a]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function EI(e){let t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},a=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),d={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},h={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},y=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},d,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},h,g,o,s],b=[...y];return b.pop(),b.push(a),p.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}var mS={arduino:mD,bash:gD,c:bD,cpp:yD,csharp:ED,css:TD,diff:SD,go:xD,graphql:_D,ini:vD,java:ND,javascript:OD,json:DD,kotlin:ID,less:BD,lua:UD,makefile:FD,markdown:HD,objectivec:zD,perl:qD,php:VD,"php-template":GD,plaintext:KD,python:YD,"python-repl":$D,r:WD,ruby:jD,rust:XD,scss:QD,shell:ZD,sql:JD,swift:aI,typescript:mI,vbnet:gI,wasm:bI,xml:yI,yaml:EI};var HI=G(FI(),1);var zI=HI.default;var qI={},Sj="hljs-";function CS(e){let t=zI.newInstance();return e&&o(e),{highlight:n,highlightAuto:r,listLanguages:i,register:o,registerAlias:s,registered:a};function n(l,u,c){let f=c||qI,d=typeof f.prefix=="string"?f.prefix:Sj;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:vS,classPrefix:d});let p=t.highlight(u,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});let h=p._emitter.root,g=h.data;return g.language=p.language,g.relevance=p.relevance,h}function r(l,u){let f=(u||qI).subset||i(),d=-1,p=0,h;for(;++dp&&(p=y.data.relevance,h=y)}return h||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return t.listLanguages()}function o(l,u){if(typeof l=="string")t.registerLanguage(l,u);else{let c;for(c in l)Object.hasOwn(l,c)&&t.registerLanguage(c,l[c])}}function s(l,u){if(typeof l=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let c;for(c in l)if(Object.hasOwn(l,c)){let f=l[c];t.registerAliases(typeof f=="string"?f:[...f],{languageName:c})}}}function a(l){return!!t.getLanguage(l)}}var vS=class{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;let n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){let r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){let n=this,r=t.split(".").map(function(s,a){return a?s+"_".repeat(a):n.options.classPrefix+s}),i=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}};var xj={};function ng(e){let t=e||xj,n=t.aliases,r=t.detect||!1,i=t.languages||mS,o=t.plainText,s=t.prefix,a=t.subset,l="hljs",u=CS(i);if(n&&u.registerAlias(n),s){let c=s.indexOf("-");l=c===-1?s:s.slice(0,c)}return function(c,f){Le(c,"element",function(d,p,h){if(d.tagName!=="code"||!h||h.type!=="element"||h.tagName!=="pre")return;let g=_j(d);if(g===!1||!g&&!r||g&&o&&o.includes(g))return;Array.isArray(d.properties.className)||(d.properties.className=[]),d.properties.className.includes(l)||d.properties.className.unshift(l);let y=fS(d,{whitespace:"pre"}),b;try{b=g?u.highlight(g,y,{prefix:s}):u.highlightAuto(y,{prefix:s,subset:a})}catch(E){let T=E;if(g&&/Unknown language/.test(T.message)){f.message("Cannot highlight as `"+g+"`, it\u2019s not registered",{ancestors:[h,d],cause:T,place:d.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw T}!g&&b.data&&b.data.language&&d.properties.className.push("language-"+b.data.language),b.children.length>0&&(d.children=b.children)})}}function _j(e){let t=e.properties.className,n=-1;if(!Array.isArray(t))return;let r;for(;++ne=>{Le(e,"element",t=>{let n=t.properties;if(!n||!(bm(n.className)||"dataSuggestion"in n))return;let i=typeof n.dataSuggestion=="string"&&n.dataSuggestion||Bf(t.children);"tabIndex"in n||(n.tabIndex=0),"role"in n||(n.role="button"),!("ariaLabel"in n)&&i&&(n.ariaLabel=`Use chat suggestion: ${i}`)})};var VI=()=>e=>{Le(e,"html",(t,n,r)=>{if(!r||n===void 0)return;let i={type:"text",value:t.value};return r.children.splice(n,1,i),[Hn,n]})};var Ni={"data-shinychat-link":"",target:"_blank",rel:"noopener noreferrer"},NS=()=>e=>{Le(e,"element",t=>{if(t.tagName!=="a")return;let n=t.properties?.href;typeof n=="string"&&(n.startsWith("#")||/^[a-z][a-z0-9+.-]*:/i.test(n)&&!/^https?:/i.test(n)||(t.properties={...t.properties,dataShinychatLink:Ni["data-shinychat-link"],target:Ni.target,rel:Ni.rel}))})};var wS=()=>e=>{Le(e,"element",t=>{let n=t.properties;n&&(t.tagName==="input"||t.tagName==="textarea")&&("value"in n&&(n.defaultValue=n.value,delete n.value),"checked"in n&&(n.defaultChecked=n.checked,delete n.checked))})};var vj=new Set(["shiny-tool-request","shiny-tool-result","shiny-chat-raw-html","shinychat-raw-html","shiny-web-search","shiny-web-search-results","shiny-web-fetch"]);function Cj(e){return e.type==="element"&&vj.has(e.tagName)}function GI(e){return e.some(t=>t.type==="text"?t.value.trim().length>0:!0)}function KI(e){Le(e,"element",(t,n,r)=>{if(t.tagName!=="p"||!r||n===void 0)return;let i=t.children.findIndex(Cj);if(i===-1)return;let o=t.children.slice(0,i),s=t.children[i],a=t.children.slice(i+1),l=[];if(o.length>0&&GI(o)&&l.push({...t,children:o}),l.push(s),a.length>0&&GI(a)){let c={type:"root",children:[{...t,children:a}]};KI(c),l.push(...c.children)}return r.children.splice(n,1,...l),[Hn,n]})}var YI=()=>KI;var Aj=new Set(["shiny-web-search","shiny-web-search-results","shiny-web-fetch"]);function $I(e){return e.type==="element"&&Aj.has(e.tagName)}function Nj(e){return e.type==="text"&&e.value.trim()===""}function wj(e){Le(e,"element",(t,n,r)=>{if(!r||n===void 0||!$I(t))return;let i=r.children,o=[],s=n;for(let l=n;lwj;function Jf(e){return e.type==="element"&&e.tagName==="shiny-aside"}function kS(e){let t=e.properties?.label;return typeof t=="string"&&t!==""||e.properties?.dataCitation!=null}function XI(e){return e.children.some(t=>t.type==="element"&&t.tagName==="p")}function Rj(e){return e.tagName==="p"?!0:e.tagName!=="li"?!1:!XI(e)}function kj(e){let t=[];return Le(e,"element",(n,r,i)=>{if(n!==e&&n.tagName==="li")return Hn;if(!(!Jf(n)||!i||r===void 0))return t.push(n),i.children.splice(r,1),[Hn,r]}),t}function Mj(e){let t=e.children.filter(Jf);return t.length===0?[]:(e.children=e.children.filter(n=>!Jf(n)),t)}function Oj(e){Le(e,"element",t=>{if(t.tagName!=="li"||!XI(t))return;let n=null,r=0;for(;r0?WI(t):null,r=!1,i=[];for(let o of e)kS(o)?r||(i.push(n),r=!0):i.push(WI([o]));return i}function Dj(e){let t=0;Le(e,"element",n=>{!Jf(n)||kS(n)||(t+=1,n.properties={...n.properties,index:t})})}function Ij(e){Oj(e),Le(e,"element",n=>{if(!Rj(n))return;let r=kj(n);r.length!==0&&(Lj(n.children),n.children.push(...jI(r)))});let t=jI(Mj(e));e.children.push(...t),Dj(e)}function Lj(e){for(;e.length>0;){let t=e[e.length-1];if(t.type==="element"&&t.tagName==="br"){e.pop();continue}if(t.type!=="text")return;let n=t.value.trimEnd();if(n){t.value=n;return}e.pop()}}var MS=()=>Ij;var QI=ba().use(va).use(Aa).use(Na).freeze(),ZI="**";function Pj(e,t){let n=e.properties?.[t];return typeof n=="string"&&n!==""?n:void 0}function Bj(e){return e.children.some(t=>t.type==="element"&&t.tagName==="p")}function Uj(e){return e.tagName==="p"?!0:e.tagName==="li"&&!Bj(e)}function Fj(e){let t="",n=[],r=[],i=o=>{if(o.type==="text"){let s=t.length;t+=o.value,n.push({node:o,start:s,end:t.length});return}if(o.type==="element"){if(o.tagName==="shiny-aside"){let s=Pj(o,"grounded-span");s&&r.push({node:o,offset:t.length,groundedSpan:s});return}if(!(o.tagName==="p"||o.tagName==="li"))for(let s of o.children)i(s)}};for(let o of e.children)i(o);return{text:t,segments:n,asides:r}}function Hj(e,t){let n=t.filter(s=>s.starte.start);if(n.length===0)return[e.node];let r=new Set([e.start,e.end]);for(let s of n)r.add(Math.max(e.start,s.start)),r.add(Math.min(e.end,s.end));let i=[...r].sort((s,a)=>s-a),o=[];for(let s=0;sd.start<=a&&d.end>=l).map(d=>d.id),f={type:"text",value:u};c.length===0?o.push(f):o.push({type:"element",tagName:"span",properties:{className:["shiny-aside-grounded"],dataAsideGrounding:c.join(" ")},children:[f]})}return o}function JI(e,t,n){e.children=e.children.flatMap(r=>{if(r.type==="text"){let i=t.get(r);return i?Hj(i,n):r}return r.type==="element"&&r.tagName!=="shiny-aside"&&JI(r,t,n),r})}function OS(e){let t=QI.runSync(QI.parse(e)),n="";return Le(t,"text",r=>{n+=r.value}),n}function zj(e){return[OS(e),OS(`${ZI}${e}`),OS(`${e}${ZI}`)]}function qj(e,t){let{text:n,segments:r,asides:i}=Fj(e),o=[];for(let s of i){let a=n.slice(0,s.offset),l=s.groundedSpan,u=a.lastIndexOf(l);if(u===-1){for(let f of zj(s.groundedSpan))if(f!==""&&(u=a.lastIndexOf(f),u!==-1)){l=f;break}}if(u===-1)continue;let c=t();s.node.properties={...s.node.properties,dataGroundingId:c},o.push({start:u,end:u+l.length,id:c})}o.length!==0&&JI(e,new Map(r.map(s=>[s.node,s])),o)}function Vj(e){let t=0,n=()=>(t+=1,`aside-grounding-${t}`);Le(e,"element",r=>{Uj(r)&&qj(r,n)})}var DS=()=>Vj;function Gj(e,t){let n=e.properties?.[t];return typeof n=="string"?n:void 0}function eL(e){return e.children.map(t=>t.type==="text"?t.value:t.type==="element"?eL(t):"").join("").trim()}function Kj(e){if(e.properties?.dataCitation==null)return null;let t=Gj(e,"url");if(!t)return null;let n=eL(e);return n===""||n===t?{url:t}:{url:t,title:n}}function Yj(e){return e.children.some(t=>t.type==="element"&&t.tagName==="shiny-web-search-results")}function $j(e){let t=new Map;for(let n of e){let r=t.get(n.url);r?!r.title&&n.title&&(r.title=n.title):t.set(n.url,n)}return[...t.values()]}function Wj(e){let t=null,n=new Map;Le(e,"element",r=>{if(r.tagName==="shiny-web-activity"){t=Yj(r)?null:r;return}if(!t||r.tagName!=="shiny-aside")return;let i=Kj(r);if(!i)return;let o=n.get(t)??[];o.push(i),n.set(t,o)});for(let[r,i]of n)r.properties={...r.properties,citedSources:JSON.stringify($j(i))}}var IS=()=>Wj;var tL=()=>e=>{Le(e,"element",(t,n,r)=>{if(!r||n===void 0||t.tagName!=="ul"&&t.tagName!=="ol")return;let i=jj(t.children);if(!i)return;let o=Xj(i);if(!o)return;let s={type:"element",tagName:"p",properties:{},children:[{type:"text",value:o}]};return r.children.splice(n+1,0,s),[Hn,n+1]})};function jj(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type==="element"&&n.tagName==="li")return n}return null}function Xj(e){let t=e.children;if(t.length<2)return null;let n=t[t.length-1];if(n.type!=="text")return null;let r=n.value.indexOf(` -`);if(r===-1)return null;let i=n.value.substring(0,r),o=n.value.substring(r+1).trim();if(!o)return null;let s=t[t.length-2];return!s||s.type!=="element"?null:(i.trim()?n.value=i:t.pop(),o)}var nL=function(){return(e,t)=>{let n=t.toString(),r=e.position?.end.offset;if(r!==void 0&&r>n.length)return;let i=Qj(n,e);if(i)return t.value=i,this.parse(t)}};function Qj(e,t){let n=Zj(e,t);if(n.length===0)return null;let r=e;for(let i of n.sort((o,s)=>s.start-o.start))r=nX(r,i);return r===e?null:r}function Zj(e,t){let n=Jj(t),r=[],i=[];for(let o of n){if(o.closing){let s=r.pop();if(s&&s.targetIndent!==null){let a=oX(e,s.start);i.push({start:s.start,end:o.end,targetIndent:s.targetIndent-sX(e,s.start,a),blockquoteDepth:a})}continue}o.selfClosing||(r.some(s=>s.targetIndent!==null)&&(o.targetIndent=null),r.push(o))}return i}function Jj(e){let t=[];return rL(e,null,t),t.sort((n,r)=>n.start-r.start)}function rL(e,t,n){let r=e.type==="listItem"?e:t;if(e.type==="html"&&eX(e,r,n),"children"in e)for(let i of e.children)rL(i,r,n)}function eX(e,t,n){let r=e.position?.start.offset;if(r===void 0)return;let i=/<\/shiny-aside\s*>|])(?:"[^"]*"|'[^']*'|[^"'>])*>/g;for(let o of e.value.matchAll(i)){let s=o[0],a=r+o.index;n.push({start:a,end:a+s.length,closing:s.startsWith("$/.test(s),targetIndent:t?tX(t):null})}}function tX(e){for(let t of e.children){let n=t.position?.start.column;if(n!==void 0)return n-1}return null}function nX(e,t){let n=e.lastIndexOf(` +`},i)),o}function Na(e,t){return e&&"run"in e?async function(n,r){let i=zm(n,{file:r,...t});await e.run(i,r)}:function(n,r){return zm(n,{file:r,...e||t})}}var l$={},u$={}.hasOwnProperty,Q2=su("type",{handlers:{root:c$,element:m$,text:p$,comment:h$,doctype:d$}});function oS(e,t){let r=(t||l$).space;return Q2(e,r==="svg"?An:ri)}function c$(e,t){let n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=sS(e.children,n,t),_u(e,n),n}function f$(e,t){let n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=sS(e.children,n,t),_u(e,n),n}function d$(e){let t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return _u(e,t),t}function p$(e){let t={nodeName:"#text",value:e.value,parentNode:null};return _u(e,t),t}function h$(e){let t={nodeName:"#comment",data:e.value,parentNode:null};return _u(e,t),t}function m$(e,t){let n=t,r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=An);let i=[],o;if(e.properties){for(o in e.properties)if(o!=="children"&&u$.call(e.properties,o)){let l=g$(r,o,e.properties[o]);l&&i.push(l)}}let s=r.space;let a={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Ei[s],childNodes:[],parentNode:null};return a.childNodes=sS(e.children,a,r),_u(e,a),e.tagName==="template"&&e.content&&(a.content=f$(e.content,r)),a}function g$(e,t,n){let r=ni(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?lu(n):uu(n));let i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){let o=i.name.indexOf(":");o<0?i.prefix="":(i.name=i.name.slice(o+1),i.prefix=r.attribute.slice(0,o)),i.namespace=Ei[r.space]}return i}function sS(e,t,n){let r=-1,i=[];if(e)for(;++r])/gi,y$=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Z2={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function qm(e,t){let n=w$(e),r=su("type",{handlers:{root:E$,element:T$,text:S$,comment:eD,doctype:x$,raw:v$},unknown:C$}),i={parser:n?new Es(Z2):Es.getFragmentParser(void 0,Z2),handle(a){r(a,i)},stitches:!1,options:t||{}};r(e,i),vu(i,or());let o=n?i.parser.document:i.parser.getFragment(),s=Sf(o,{file:i.options.file});return i.stitches&&Le(s,"comment",function(a,l,u){let c=a;if(c.value.stitch&&u&&l!==void 0){let f=u.children;return f[l]=c.value.stitch,l}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function J2(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);let n={type:ms.TokenType.CHARACTER,chars:e.value,location:$f(e)};vu(t,or(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function x$(e,t){let n={type:ms.TokenType.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:$f(e)};vu(t,or(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function _$(e,t){t.stitches=!0;let n=R$(e);if("children"in e&&"children"in n){let r=qm({type:"root",children:e.children},t.options);n.children=r.children}eD({type:"comment",value:{stitch:n}},t)}function eD(e,t){let n=e.value,r={type:ms.TokenType.COMMENT,data:n,location:$f(e)};vu(t,or(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function v$(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,tD(t,or(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(b$,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function C$(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))_$(n,t);else{let r="";throw y$.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function vu(e,t){tD(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Ct.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function tD(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function A$(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Ct.PLAINTEXT)return;vu(t,or(e));let r=t.parser.openElements.current,i="namespaceURI"in r?r.namespaceURI:Ei.html;i===Ei.html&&n==="svg"&&(i=Ei.svg);let o=oS({...e,children:[]},{space:i===Ei.svg?"svg":"html"}),s={type:ms.TokenType.START_TAG,tagName:n,tagID:_f.getTagID(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:$f(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function N$(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Bh.includes(n)||t.parser.tokenizer.state===Ct.PLAINTEXT)return;vu(t,pa(e));let r={type:ms.TokenType.END_TAG,tagName:n,tagID:_f.getTagID(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:$f(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Ct.RCDATA||t.parser.tokenizer.state===Ct.RAWTEXT||t.parser.tokenizer.state===Ct.SCRIPT_DATA)&&(t.parser.tokenizer.state=Ct.DATA)}function w$(e){let t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function $f(e){let t=or(e)||{line:void 0,column:void 0,offset:void 0},n=pa(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function R$(e){return"children"in e?li({...e,children:[]}):li(e)}function Wf(e){return function(t,n){return qm(t,{...e,file:n})}}var wa=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],aS={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...wa,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...wa],h2:[["className","sr-only"]],img:[...wa,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...wa,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...wa],table:[...wa],ul:[...wa,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]};var vs={}.hasOwnProperty;function lS(e,t){let n={type:"root",children:[]},r={schema:t?{...aS,...t}:aS,stack:[]},i=iD(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function iD(e,t){if(t&&typeof t=="object"){let n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return k$(e,n);case"doctype":return M$(e,n);case"element":return O$(e,n);case"root":return D$(e,n);case"text":return I$(e,n);default:}}}function k$(e,t){if(e.schema.allowComments){let n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),o={type:"comment",value:r<0?n:n.slice(0,r)};return jf(o,t),o}}function M$(e,t){if(e.schema.allowDoctypes){let n={type:"doctype"};return jf(n,t),n}}function O$(e,t){let n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);let r=oD(e,t.children),i=L$(e,t.properties);e.stack.pop();let o=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(o=!0,e.schema.ancestors&&vs.call(e.schema.ancestors,n))){let a=e.schema.ancestors[n],l=-1;for(o=!1;++l1){let i=!1,o=0;for(;++o-1&&o>l||s>-1&&o>s||a>-1&&o>a)return!0;let u=-1;for(;++u4&&t.slice(0,4).toLowerCase()==="data")return n}function Vm(e){return function(t){return lS(t,e)}}var Gm=function(e,t,n){let r=xi(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=c):c&&(u!==void 0&&u>-1&&l.push(` +`.repeat(u)||" "),u=-1,l.push(c))}return l.join("")}function dD(e,t,n){return e.type==="element"?G$(e,t,n):e.type==="text"?n.whitespace==="normal"?pD(e,n):K$(e):[]}function G$(e,t,n){let r=hD(e,n),i=e.children||[],o=-1,s=[];if(V$(e))return s;let a,l;for(cS(e)||cD(e)&&Gm(t,e,cD)?l=` +`:q$(e)?(a=2,l=2):fD(e)&&(a=1,l=1);++o]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],S={type:g,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},v={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},x=[v,f,a,n,e.C_BLOCK_COMMENT_MODE,c,u],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:x.concat([{begin:/\(/,end:/\)/,keywords:S,contains:x.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:p,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:S,illegal:"",keywords:S,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:S},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function mD(e){let t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=X$(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function gD(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(a);let l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},c={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},d=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${d.join("|")})`,relevance:10}),h={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],b={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],T=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],S=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],v=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:y,built_in:[...E,...T,"set","shopt",...S,...v]},contains:[p,e.SHEBANG(),h,f,o,s,b,a,l,u,c,n]}}function bD(e){let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",y={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},b=[f,a,n,e.C_BLOCK_COMMENT_MODE,c,u],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:b.concat([{begin:/\(/,end:/\)/,keywords:y,contains:b.concat(["self"]),relevance:0}]),relevance:0},T={begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(d,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:y,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:y}}}function yD(e){let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],S={type:g,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},v={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},x=[v,f,a,n,e.C_BLOCK_COMMENT_MODE,c,u],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:x.concat([{begin:/\(/,end:/\)/,keywords:S,contains:x.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:S,relevance:0},{begin:p,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:S,illegal:"",keywords:S,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:S},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function ED(e){let t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:t,literal:r},a=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},c={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(c,{illegal:/\n/}),d={className:"subst",begin:/\{/,end:/\}/,keywords:s},p=e.inherit(d,{illegal:/\n/}),h={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]},y=e.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});d.contains=[g,h,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],p.contains=[y,h,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let b={variants:[u,g,h,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},T=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",S={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},b,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+T+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,E],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[b,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},S]}}var Q$=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Z$=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],J$=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],eW=[...Z$,...J$],tW=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),nW=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),rW=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),iW=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function TD(e){let t=e.regex,n=Q$(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+nW.join("|")+")"},{begin:":(:)?("+rW.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+iW.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:tW.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+eW.join("|")+")\\b"}]}}function SD(e){let t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function xD(e){let o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"AD(e,t,n-1))}function ND(e){let t=e.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+AD("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},c={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[c,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,CD,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},CD,u]}}var wD="[A-Za-z$_][0-9A-Za-z$_]*",oW=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],sW=["true","false","null","undefined","NaN","Infinity"],RD=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],kD=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],MD=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],aW=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],lW=[].concat(MD,RD,kD);function OD(e){let t=e.regex,n=(D,{after:U})=>{let _="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,U)=>{let _=D[0].length+D.index,te=D.input[_];if(te==="<"||te===","){U.ignoreMatch();return}te===">"&&(n(D,{after:_})||U.ignoreMatch());let ne,A=D.input.substring(_);if(ne=A.match(/^\s*=/)){U.ignoreMatch();return}if((ne=A.match(/^\s+extends\s+/))&&ne.index===0){U.ignoreMatch();return}}},a={$pattern:wD,keyword:oW,literal:sW,built_in:lW,"variable.language":aW},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,g,y,{match:/\$\d+/},f];d.contains=T.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(T)});let S=[].concat(E,d.contains),v=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(S)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:v},R={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...RD,...kD]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},V={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(D){return t.concat("(?!",D.join("|"),")")}let q={match:t.concat(/\b/,Y([...MD,"super","import"].map(D=>`${D}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,g,y,E,{match:/\$\d+/},f,O,{scope:"attr",match:r+t.lookahead(":"),relevance:0},P,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},q,V,R,H,{match:/\$[(.]/}]}}function DD(e){let t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Au="[0-9](_*[0-9])*",$m=`\\.(${Au})`,Wm="[0-9a-fA-F](_*[0-9a-fA-F])*",uW={className:"number",variants:[{begin:`(\\b(${Au})((${$m})|\\.)?|(${$m}))[eE][+-]?(${Au})[fFdD]?\\b`},{begin:`\\b(${Au})((${$m})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${$m})[fFdD]?\\b`},{begin:`\\b(${Au})[fFdD]\\b`},{begin:`\\b0[xX]((${Wm})\\.?|(${Wm})?\\.(${Wm}))[pP][+-]?(${Au})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Wm})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function ID(e){let t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);let a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(s,{className:"string"}),"self"]}]},u=uW,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=f;return d.variants[1].contains=[f],f.variants[1].contains=[d],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,n,r,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,a,l,s,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}var cW=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),fW=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],dW=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],pW=[...fW,...dW],hW=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),LD=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),PD=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),mW=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),gW=LD.concat(PD).sort().reverse();function BD(e){let t=cW(e),n=gW,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],a=[],l=function(T){return{className:"string",begin:"~?"+T+".*?"+T}},u=function(T,S,v){return{className:T,begin:S,relevance:v}},c={$pattern:/[a-z-]+/,keyword:r,attribute:hW.join(" ")},f={begin:"\\(",end:"\\)",contains:a,keywords:c,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);let d=a.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},h={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+mW.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:a,relevance:0}},y={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:d}},b={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+pW.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",o,0),u("selector-id","#"+o),u("selector-class","\\."+o,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+LD.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+PD.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},t.FUNCTION_DISPATCH]},E={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[b]};return s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,y,E,h,b,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function UD(e){let t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function FD(e){let t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},c={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),d=e.inherit(c,{contains:[]});u.contains.push(d),c.contains.push(f);let p=[n,l];return[u,c,f,d].forEach(b=>{b.contains=b.contains.concat(p)}),p=p.concat(u,c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,o,u,c,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,l,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function zD(e){let t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function qD(e){let t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},c=[e.BACKSLASH_ESCAPE,o,l],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],d=(g,y,b="\\1")=>{let E=b==="\\1"?b:t.concat(b,y);return t.concat(t.concat("(?:",g,")"),y,/(?:\\.|[^\\\/])*?/,E,/(?:\\.|[^\\\/])*?/,b,r)},p=(g,y,b)=>t.concat(t.concat("(?:",g,")"),y,/(?:\\.|[^\\\/])*?/,b,r),h=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:c,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:d("s|tr|y",t.either(...f,{capture:!0}))},{begin:d("s|tr|y","\\(","\\)")},{begin:d("s|tr|y","\\[","\\]")},{begin:d("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=h,s.contains=h,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:h}}function VD(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),c=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(L,H)=>{H.data._beginMatch=L[1]||L[2]},"on:end":(L,H)=>{H.data._beginMatch!==L[1]&&H.ignoreMatch()}},d=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ +]`,h={scope:"string",variants:[c,u,f,d]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},y=["false","null","true"],b=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],E=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],S={keyword:b,literal:(L=>{let H=[];return L.forEach(I=>{H.push(I),I.toLowerCase()===I?H.push(I.toUpperCase()):H.push(I.toLowerCase())}),H})(y),built_in:E},v=L=>L.map(H=>H.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",v(E).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},R=t.concat(r,"\\b(?!\\()"),O={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},B={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},C={relevance:0,begin:/\(/,end:/\)/,keywords:S,contains:[B,s,O,e.C_BLOCK_COMMENT_MODE,h,g,x]},V={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",v(b).join("\\b|"),"|",v(E).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[C]};C.contains.push(V);let Y=[B,O,e.C_BLOCK_COMMENT_MODE,h,g,x],q={begin:t.concat(/#\[\s*\\?/,t.either(i,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...Y]},...Y,{scope:"meta",variants:[{match:i},{match:o}]}]};return{case_insensitive:!1,keywords:S,contains:[q,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},s,V,O,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},x,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:S,contains:["self",q,s,O,e.C_BLOCK_COMMENT_MODE,h,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},h,g]}}function GD(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function KD(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function YD(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},c={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,c,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,c,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",p=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,h=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${p}))[eE][+-]?(${d})[jJ]?(?=${h})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${d})[jJ](?=${h})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},b={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,g,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,b,f]}]}}function $D(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function WD(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function jD(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:s},f={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},d="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",h={className:"number",relevance:0,variants:[{begin:`\\b(${d})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},x=[f,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);c.contains=x,g.contains=x;let C=[{begin:/^\s*=>/,starts:{end:"$",contains:x}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:x}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(C).concat(u).concat(x)}}function XD(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],c=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:c,keyword:a,literal:l,built_in:u},illegal:""},o]}}var bW=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),yW=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],EW=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],TW=[...yW,...EW],SW=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),xW=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),_W=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),vW=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function QD(e){let t=bW(e),n=_W,r=xW,i="@[a-z-]+",o="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+TW.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+vW.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:SW.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function ZD(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function JD(e){let t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],c=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],d=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=c,h=[...u,...l].filter(v=>!c.includes(v)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},b={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function E(v){return t.concat(/\b/,t.either(...v.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}let T={scope:"keyword",match:E(d),relevance:0};function S(v,{exceptions:x,when:R}={}){let O=R;return x=x||[],v.map(B=>B.match(/\|\d+$/)||x.includes(B)?B:O(B)?`${B}|0`:B)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:S(h,{when:v=>v.length<3}),literal:o,type:a,built_in:f},contains:[{scope:"type",match:E(s)},T,b,g,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,y]}}function rI(e){return e?typeof e=="string"?e:e.source:null}function Xf(e){return st("(?=",e,")")}function st(...e){return e.map(n=>rI(n)).join("")}function CW(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function qn(...e){return"("+(CW(e).capture?"":"?:")+e.map(r=>rI(r)).join("|")+")"}var hS=e=>st(/\b/,e,/\w$/.test(e)?/\b/:/\B/),AW=["Protocol","Type"].map(hS),eI=["init","self"].map(hS),NW=["Any","Self"],dS=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],tI=["false","nil","true"],wW=["assignment","associativity","higherThan","left","lowerThan","none","right"],RW=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],nI=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],iI=qn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),oI=qn(iI,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),pS=st(iI,oI,"*"),sI=qn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Xm=qn(sI,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ai=st(sI,Xm,"*"),jm=st(/[A-Z]/,Xm,"*"),kW=["attached","autoclosure",st(/convention\(/,qn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",st(/objc\(/,Ai,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],MW=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function aI(e){let t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,qn(...AW,...eI)],className:{2:"keyword"}},o={match:st(/\./,qn(...dS)),relevance:0},s=dS.filter(me=>typeof me=="string").concat(["_|0"]),a=dS.filter(me=>typeof me!="string").concat(NW).map(hS),l={variants:[{className:"keyword",match:qn(...a,...eI)}]},u={$pattern:qn(/\b\w+/,/#\w+/),keyword:s.concat(RW),literal:tI},c=[i,o,l],f={match:st(/\./,qn(...nI)),relevance:0},d={className:"built_in",match:st(/\b/,qn(...nI),/(?=\()/)},p=[f,d],h={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:pS},{match:`\\.(\\.|${oI})+`}]},y=[h,g],b="([0-9]_*)+",E="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${b})(\\.(${b}))?([eE][+-]?(${b}))?\\b`},{match:`\\b0x(${E})(\\.(${E}))?([pP][+-]?(${b}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},S=(me="")=>({className:"subst",variants:[{match:st(/\\/,me,/[0\\tnr"']/)},{match:st(/\\/,me,/u\{[0-9a-fA-F]{1,8}\}/)}]}),v=(me="")=>({className:"subst",match:st(/\\/,me,/[\t ]*(?:[\r\n]|\r\n)/)}),x=(me="")=>({className:"subst",label:"interpol",begin:st(/\\/,me,/\(/),end:/\)/}),R=(me="")=>({begin:st(me,/"""/),end:st(/"""/,me),contains:[S(me),v(me),x(me)]}),O=(me="")=>({begin:st(me,/"/),end:st(/"/,me),contains:[S(me),x(me)]}),B={className:"string",variants:[R(),R("#"),R("##"),R("###"),O(),O("#"),O("##"),O("###")]},C=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],V={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:C},Y=me=>{let we=st(me,/\//),ue=st(/\//,me);return{begin:we,end:ue,contains:[...C,{scope:"comment",begin:`#(?!.*${ue})`,end:/$/}]}},q={scope:"regexp",variants:[Y("###"),Y("##"),Y("#"),V]},L={match:st(/`/,Ai,/`/)},H={className:"variable",match:/\$\d+/},I={className:"variable",match:`\\$${Xm}+`},P=[L,H,I],D={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:MW,contains:[...y,T,B]}]}},U={scope:"keyword",match:st(/@/,qn(...kW),Xf(qn(/\(/,/\s+/)))},_={scope:"meta",match:st(/@/,Ai)},te=[D,U,_],ne={match:Xf(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:st(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Xm,"+")},{className:"type",match:jm,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:st(/\s+&\s+/,Xf(jm)),relevance:0}]},A={begin://,keywords:u,contains:[...r,...c,...te,h,ne]};ne.contains.push(A);let re={match:st(Ai,/\s*:/),keywords:"_|0",relevance:0},se={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",re,...r,q,...c,...p,...y,T,B,...P,...te,ne]},xe={begin://,keywords:"repeat each",contains:[...r,ne]},Ve={begin:qn(Xf(st(Ai,/\s*:/)),Xf(st(Ai,/\s+/,Ai,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ai}]},de={begin:/\(/,end:/\)/,keywords:u,contains:[Ve,...r,...c,...y,T,B,...te,ne,se],endsParent:!0,illegal:/["']/},ct={match:[/(func|macro)/,/\s+/,qn(L.match,Ai,pS)],className:{1:"keyword",3:"title.function"},contains:[xe,de,t],illegal:[/\[/,/%/]},Ge={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[xe,de,t],illegal:/\[|%/},rt={match:[/operator/,/\s+/,pS],className:{1:"keyword",3:"title"}},he={begin:[/precedencegroup/,/\s+/,jm],className:{1:"keyword",3:"title"},contains:[ne],keywords:[...wW,...tI],end:/}/},Ce={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ae={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ne={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ai,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[xe,...c,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:jm},...c],relevance:0}]};for(let me of B.variants){let we=me.contains.find(St=>St.label==="interpol");we.keywords=u;let ue=[...c,...p,...y,T,B,...P];we.contains=[...ue,{begin:/\(/,end:/\)/,contains:["self",...ue]}]}return{name:"Swift",keywords:u,contains:[...r,ct,Ge,Ce,Ae,Ne,rt,he,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},q,...c,...p,...y,T,B,...P,...te,ne,se]}}var Qm="[A-Za-z$_][0-9A-Za-z$_]*",lI=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],uI=["true","false","null","undefined","NaN","Infinity"],cI=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],fI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],dI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],pI=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],hI=[].concat(dI,cI,fI);function OW(e){let t=e.regex,n=(D,{after:U})=>{let _="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,U)=>{let _=D[0].length+D.index,te=D.input[_];if(te==="<"||te===","){U.ignoreMatch();return}te===">"&&(n(D,{after:_})||U.ignoreMatch());let ne,A=D.input.substring(_);if(ne=A.match(/^\s*=/)){U.ignoreMatch();return}if((ne=A.match(/^\s+extends\s+/))&&ne.index===0){U.ignoreMatch();return}}},a={$pattern:Qm,keyword:lI,literal:uI,built_in:hI,"variable.language":pI},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},E={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,g,y,{match:/\$\d+/},f];d.contains=T.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(T)});let S=[].concat(E,d.contains),v=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(S)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:v},R={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...cI,...fI]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},V={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(D){return t.concat("(?!",D.join("|"),")")}let q={match:t.concat(/\b/,Y([...dI,"super","import"].map(D=>`${D}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,g,y,E,{match:/\$\d+/},f,O,{scope:"attr",match:r+t.lookahead(":"),relevance:0},P,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},q,V,R,H,{match:/\$[(.]/}]}}function mI(e){let t=e.regex,n=OW(e),r=Qm,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Qm,keyword:lI.concat(l),literal:uI,built_in:hI.concat(i),"variable.language":pI},c={className:"meta",begin:"@"+r},f=(g,y,b)=>{let E=g.contains.findIndex(T=>T.label===y);if(E===-1)throw new Error("can not find mode to replace");g.contains.splice(E,1,b)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(c);let d=n.contains.find(g=>g.scope==="attr"),p=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,p]),n.contains=n.contains.concat([c,o,s,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",a);let h=n.contains.find(g=>g.label==="func.def");return h.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function gI(e){let t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,i),/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,t.either(o,i),/ +/,t.either(s,a),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},c={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,u,c,f,d,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[d]}]}}function bI(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");let n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,e.QUOTE_STRING_MODE,l,u,a]}}function yI(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(o,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,l,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,l,a]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function EI(e){let t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},a=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),d={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},h={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},y=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},d,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},h,g,o,s],b=[...y];return b.pop(),b.push(a),p.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}var mS={arduino:mD,bash:gD,c:bD,cpp:yD,csharp:ED,css:TD,diff:SD,go:xD,graphql:_D,ini:vD,java:ND,javascript:OD,json:DD,kotlin:ID,less:BD,lua:UD,makefile:FD,markdown:HD,objectivec:zD,perl:qD,php:VD,"php-template":GD,plaintext:KD,python:YD,"python-repl":$D,r:WD,ruby:jD,rust:XD,scss:QD,shell:ZD,sql:JD,swift:aI,typescript:mI,vbnet:gI,wasm:bI,xml:yI,yaml:EI};var HI=G(FI(),1);var zI=HI.default;var qI={},xj="hljs-";function CS(e){let t=zI.newInstance();return e&&o(e),{highlight:n,highlightAuto:r,listLanguages:i,register:o,registerAlias:s,registered:a};function n(l,u,c){let f=c||qI,d=typeof f.prefix=="string"?f.prefix:xj;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:vS,classPrefix:d});let p=t.highlight(u,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});let h=p._emitter.root,g=h.data;return g.language=p.language,g.relevance=p.relevance,h}function r(l,u){let f=(u||qI).subset||i(),d=-1,p=0,h;for(;++dp&&(p=y.data.relevance,h=y)}return h||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return t.listLanguages()}function o(l,u){if(typeof l=="string")t.registerLanguage(l,u);else{let c;for(c in l)Object.hasOwn(l,c)&&t.registerLanguage(c,l[c])}}function s(l,u){if(typeof l=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let c;for(c in l)if(Object.hasOwn(l,c)){let f=l[c];t.registerAliases(typeof f=="string"?f:[...f],{languageName:c})}}}function a(l){return!!t.getLanguage(l)}}var vS=class{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;let n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){let r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){let n=this,r=t.split(".").map(function(s,a){return a?s+"_".repeat(a):n.options.classPrefix+s}),i=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}};var _j={};function ng(e){let t=e||_j,n=t.aliases,r=t.detect||!1,i=t.languages||mS,o=t.plainText,s=t.prefix,a=t.subset,l="hljs",u=CS(i);if(n&&u.registerAlias(n),s){let c=s.indexOf("-");l=c===-1?s:s.slice(0,c)}return function(c,f){Le(c,"element",function(d,p,h){if(d.tagName!=="code"||!h||h.type!=="element"||h.tagName!=="pre")return;let g=vj(d);if(g===!1||!g&&!r||g&&o&&o.includes(g))return;Array.isArray(d.properties.className)||(d.properties.className=[]),d.properties.className.includes(l)||d.properties.className.unshift(l);let y=fS(d,{whitespace:"pre"}),b;try{b=g?u.highlight(g,y,{prefix:s}):u.highlightAuto(y,{prefix:s,subset:a})}catch(E){let T=E;if(g&&/Unknown language/.test(T.message)){f.message("Cannot highlight as `"+g+"`, it\u2019s not registered",{ancestors:[h,d],cause:T,place:d.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw T}!g&&b.data&&b.data.language&&d.properties.className.push("language-"+b.data.language),b.children.length>0&&(d.children=b.children)})}}function vj(e){let t=e.properties.className,n=-1;if(!Array.isArray(t))return;let r;for(;++ne=>{Le(e,"element",t=>{let n=t.properties;if(!n||!(bm(n.className)||"dataSuggestion"in n))return;let i=typeof n.dataSuggestion=="string"&&n.dataSuggestion||Bf(t.children);"tabIndex"in n||(n.tabIndex=0),"role"in n||(n.role="button"),!("ariaLabel"in n)&&i&&(n.ariaLabel=`Use chat suggestion: ${i}`)})};var VI=()=>e=>{Le(e,"html",(t,n,r)=>{if(!r||n===void 0)return;let i={type:"text",value:t.value};return r.children.splice(n,1,i),[Hn,n]})};var Ni={"data-shinychat-link":"",target:"_blank",rel:"noopener noreferrer"},NS=()=>e=>{Le(e,"element",t=>{if(t.tagName!=="a")return;let n=t.properties?.href;typeof n=="string"&&(n.startsWith("#")||/^[a-z][a-z0-9+.-]*:/i.test(n)&&!/^https?:/i.test(n)||(t.properties={...t.properties,dataShinychatLink:Ni["data-shinychat-link"],target:Ni.target,rel:Ni.rel}))})};var wS=()=>e=>{Le(e,"element",t=>{let n=t.properties;n&&(t.tagName==="input"||t.tagName==="textarea")&&("value"in n&&(n.defaultValue=n.value,delete n.value),"checked"in n&&(n.defaultChecked=n.checked,delete n.checked))})};var Cj=new Set(["shiny-tool-request","shiny-tool-result","shiny-chat-raw-html","shinychat-raw-html","shiny-web-search","shiny-web-search-results","shiny-web-fetch"]);function Aj(e){return e.type==="element"&&Cj.has(e.tagName)}function GI(e){return e.some(t=>t.type==="text"?t.value.trim().length>0:!0)}function KI(e){Le(e,"element",(t,n,r)=>{if(t.tagName!=="p"||!r||n===void 0)return;let i=t.children.findIndex(Aj);if(i===-1)return;let o=t.children.slice(0,i),s=t.children[i],a=t.children.slice(i+1),l=[];if(o.length>0&&GI(o)&&l.push({...t,children:o}),l.push(s),a.length>0&&GI(a)){let c={type:"root",children:[{...t,children:a}]};KI(c),l.push(...c.children)}return r.children.splice(n,1,...l),[Hn,n]})}var YI=()=>KI;var Nj=new Set(["shiny-web-search","shiny-web-search-results","shiny-web-fetch"]);function $I(e){return e.type==="element"&&Nj.has(e.tagName)}function wj(e){return e.type==="text"&&e.value.trim()===""}function Rj(e){Le(e,"element",(t,n,r)=>{if(!r||n===void 0||!$I(t))return;let i=r.children,o=[],s=n;for(let l=n;lRj;function Jf(e){return e.type==="element"&&e.tagName==="shiny-aside"}function kS(e){let t=e.properties?.label;return typeof t=="string"&&t!==""||e.properties?.dataCitation!=null}function XI(e){return e.children.some(t=>t.type==="element"&&t.tagName==="p")}function kj(e){return e.tagName==="p"?!0:e.tagName!=="li"?!1:!XI(e)}function Mj(e){let t=[];return Le(e,"element",(n,r,i)=>{if(n!==e&&n.tagName==="li")return Hn;if(!(!Jf(n)||!i||r===void 0))return t.push(n),i.children.splice(r,1),[Hn,r]}),t}function Oj(e){let t=e.children.filter(Jf);return t.length===0?[]:(e.children=e.children.filter(n=>!Jf(n)),t)}function Dj(e){Le(e,"element",t=>{if(t.tagName!=="li"||!XI(t))return;let n=null,r=0;for(;r0?WI(t):null,r=!1,i=[];for(let o of e)kS(o)?r||(i.push(n),r=!0):i.push(WI([o]));return i}function Ij(e){let t=0;Le(e,"element",n=>{!Jf(n)||kS(n)||(t+=1,n.properties={...n.properties,index:t})})}function Lj(e){Dj(e),Le(e,"element",n=>{if(!kj(n))return;let r=Mj(n);r.length!==0&&(Pj(n.children),n.children.push(...jI(r)))});let t=jI(Oj(e));e.children.push(...t),Ij(e)}function Pj(e){for(;e.length>0;){let t=e[e.length-1];if(t.type==="element"&&t.tagName==="br"){e.pop();continue}if(t.type!=="text")return;let n=t.value.trimEnd();if(n){t.value=n;return}e.pop()}}var MS=()=>Lj;var QI=ba().use(va).use(Aa).use(Na).freeze(),ZI="**";function Bj(e,t){let n=e.properties?.[t];return typeof n=="string"&&n!==""?n:void 0}function Uj(e){return e.children.some(t=>t.type==="element"&&t.tagName==="p")}function Fj(e){return e.tagName==="p"?!0:e.tagName==="li"&&!Uj(e)}function Hj(e){let t="",n=[],r=[],i=o=>{if(o.type==="text"){let s=t.length;t+=o.value,n.push({node:o,start:s,end:t.length});return}if(o.type==="element"){if(o.tagName==="shiny-aside"){let s=Bj(o,"grounded-span");s&&r.push({node:o,offset:t.length,groundedSpan:s});return}if(!(o.tagName==="p"||o.tagName==="li"))for(let s of o.children)i(s)}};for(let o of e.children)i(o);return{text:t,segments:n,asides:r}}function zj(e,t){let n=t.filter(s=>s.starte.start);if(n.length===0)return[e.node];let r=new Set([e.start,e.end]);for(let s of n)r.add(Math.max(e.start,s.start)),r.add(Math.min(e.end,s.end));let i=[...r].sort((s,a)=>s-a),o=[];for(let s=0;sd.start<=a&&d.end>=l).map(d=>d.id),f={type:"text",value:u};c.length===0?o.push(f):o.push({type:"element",tagName:"span",properties:{className:["shiny-aside-grounded"],dataAsideGrounding:c.join(" ")},children:[f]})}return o}function JI(e,t,n){e.children=e.children.flatMap(r=>{if(r.type==="text"){let i=t.get(r);return i?zj(i,n):r}return r.type==="element"&&r.tagName!=="shiny-aside"&&JI(r,t,n),r})}function OS(e){let t=QI.runSync(QI.parse(e)),n="";return Le(t,"text",r=>{n+=r.value}),n}function qj(e){return[OS(e),OS(`${ZI}${e}`),OS(`${e}${ZI}`)]}function Vj(e,t){let{text:n,segments:r,asides:i}=Hj(e),o=[];for(let s of i){let a=n.slice(0,s.offset),l=s.groundedSpan,u=a.lastIndexOf(l);if(u===-1){for(let f of qj(s.groundedSpan))if(f!==""&&(u=a.lastIndexOf(f),u!==-1)){l=f;break}}if(u===-1)continue;let c=t();s.node.properties={...s.node.properties,dataGroundingId:c},o.push({start:u,end:u+l.length,id:c})}o.length!==0&&JI(e,new Map(r.map(s=>[s.node,s])),o)}function Gj(e){let t=0,n=()=>(t+=1,`aside-grounding-${t}`);Le(e,"element",r=>{Fj(r)&&Vj(r,n)})}var DS=()=>Gj;function Kj(e,t){let n=e.properties?.[t];return typeof n=="string"?n:void 0}function eL(e){return e.children.map(t=>t.type==="text"?t.value:t.type==="element"?eL(t):"").join("").trim()}function Yj(e){if(e.properties?.dataCitation==null)return null;let t=Kj(e,"url");if(!t)return null;let n=eL(e);return n===""||n===t?{url:t}:{url:t,title:n}}function $j(e){return e.children.some(t=>t.type==="element"&&t.tagName==="shiny-web-search-results")}function Wj(e){let t=new Map;for(let n of e){let r=t.get(n.url);r?!r.title&&n.title&&(r.title=n.title):t.set(n.url,n)}return[...t.values()]}function jj(e){let t=null,n=new Map;Le(e,"element",r=>{if(r.tagName==="shiny-web-activity"){t=$j(r)?null:r;return}if(!t||r.tagName!=="shiny-aside")return;let i=Yj(r);if(!i)return;let o=n.get(t)??[];o.push(i),n.set(t,o)});for(let[r,i]of n)r.properties={...r.properties,citedSources:JSON.stringify(Wj(i))}}var IS=()=>jj;var tL=()=>e=>{Le(e,"element",(t,n,r)=>{if(!r||n===void 0||t.tagName!=="ul"&&t.tagName!=="ol")return;let i=Xj(t.children);if(!i)return;let o=Qj(i);if(!o)return;let s={type:"element",tagName:"p",properties:{},children:[{type:"text",value:o}]};return r.children.splice(n+1,0,s),[Hn,n+1]})};function Xj(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type==="element"&&n.tagName==="li")return n}return null}function Qj(e){let t=e.children;if(t.length<2)return null;let n=t[t.length-1];if(n.type!=="text")return null;let r=n.value.indexOf(` +`);if(r===-1)return null;let i=n.value.substring(0,r),o=n.value.substring(r+1).trim();if(!o)return null;let s=t[t.length-2];return!s||s.type!=="element"?null:(i.trim()?n.value=i:t.pop(),o)}var nL=function(){return(e,t)=>{let n=t.toString(),r=e.position?.end.offset;if(r!==void 0&&r>n.length)return;let i=Zj(n,e);if(i)return t.value=i,this.parse(t)}};function Zj(e,t){let n=Jj(e,t);if(n.length===0)return null;let r=e;for(let i of n.sort((o,s)=>s.start-o.start))r=rX(r,i);return r===e?null:r}function Jj(e,t){let n=eX(t),r=[],i=[];for(let o of n){if(o.closing){let s=r.pop();if(s&&s.targetIndent!==null){let a=sX(e,s.start);i.push({start:s.start,end:o.end,targetIndent:s.targetIndent-aX(e,s.start,a),blockquoteDepth:a})}continue}o.selfClosing||(r.some(s=>s.targetIndent!==null)&&(o.targetIndent=null),r.push(o))}return i}function eX(e){let t=[];return rL(e,null,t),t.sort((n,r)=>n.start-r.start)}function rL(e,t,n){let r=e.type==="listItem"?e:t;if(e.type==="html"&&tX(e,r,n),"children"in e)for(let i of e.children)rL(i,r,n)}function tX(e,t,n){let r=e.position?.start.offset;if(r===void 0)return;let i=/<\/shiny-aside\s*>|])(?:"[^"]*"|'[^']*'|[^"'>])*>/g;for(let o of e.value.matchAll(i)){let s=o[0],a=r+o.index;n.push({start:a,end:a+s.length,closing:s.startsWith("$/.test(s),targetIndent:t?nX(t):null})}}function nX(e){for(let t of e.children){let n=t.position?.start.column;if(n!==void 0)return n-1}return null}function rX(e,t){let n=e.lastIndexOf(` `,t.start-1)+1,r=e.slice(n,t.start),i=/^[\t ]*$/.test(r),o=e.indexOf(` -`,t.start),s=i?n:o===-1?t.end:o+1;if(s>=t.end)return e;let a=e.slice(s,t.end),l=rX(a,t.blockquoteDepth);if(l===null||l>=t.targetIndent)return e;let u=" ".repeat(t.targetIndent-l),c=iX(a,u,t.blockquoteDepth);return e.slice(0,s)+c+e.slice(t.end)}function rX(e,t){let n=null;for(let r of e.split(/\r?\n/)){let i=r.slice(LS(r,t));if(i.trim()==="")continue;let o=oL(i);n=n===null?o:Math.min(n,o)}return n}function iX(e,t,n){return e.split(/(\r?\n)/).map((r,i)=>{if(i%2===1)return r;let o=LS(r,n),s=r.slice(o);return s.trim()===""?r:r.slice(0,o)+t+s}).join("")}function oX(e,t){return aX(iL(e,t))}function sX(e,t,n){if(n===0)return 0;let r=iL(e,t);return oL(r.slice(0,LS(r,n)))}function iL(e,t){let n=e.lastIndexOf(` +`,t.start),s=i?n:o===-1?t.end:o+1;if(s>=t.end)return e;let a=e.slice(s,t.end),l=iX(a,t.blockquoteDepth);if(l===null||l>=t.targetIndent)return e;let u=" ".repeat(t.targetIndent-l),c=oX(a,u,t.blockquoteDepth);return e.slice(0,s)+c+e.slice(t.end)}function iX(e,t){let n=null;for(let r of e.split(/\r?\n/)){let i=r.slice(LS(r,t));if(i.trim()==="")continue;let o=oL(i);n=n===null?o:Math.min(n,o)}return n}function oX(e,t,n){return e.split(/(\r?\n)/).map((r,i)=>{if(i%2===1)return r;let o=LS(r,n),s=r.slice(o);return s.trim()===""?r:r.slice(0,o)+t+s}).join("")}function sX(e,t){return lX(iL(e,t))}function aX(e,t,n){if(n===0)return 0;let r=iL(e,t);return oL(r.slice(0,LS(r,n)))}function iL(e,t){let n=e.lastIndexOf(` `,t-1)+1,r=e.indexOf(` -`,t);return e.slice(n,r===-1?e.length:r)}function LS(e,t){let n=0,r=0;for(;r")return i;n++,(e[n]===" "||e[n]===" ")&&n++,r++}return n}function aX(e){let t=0,n=0;for(;;){let r=t;for(;t-r<3&&e[t]===" ";)t++;if(e[t]!==">")return n;t++,(e[t]===" "||e[t]===" ")&&t++,n++}}function oL(e){let t=0;for(let n of e)if(n===" ")t++;else if(n===" ")t+=4-t%4;else break;return t}var sL=ba().use(va).use(Aa).use(nL).use(Na,{allowDangerousHtml:!0}).use(UM).use(Wf).use(FM).use(tL).use(YI).use(RS).use(DS).use(MS).use(IS).use($1).use(wS).use(AS).use(K1).use(NS).use(ng,{detect:!1,ignoreMissing:!0}).freeze(),aL=ba().use(RS).use(DS).use(MS).use(IS).use($1).use(wS).use(AS).use(K1).use(NS).freeze(),lL=ba().use(va).use(Aa).use(VI).use(Na,{allowDangerousHtml:!0}).use(Wf).use(Vm).freeze();var rg=G(fe(),1),ed=G(ie(),1);function uL({children:e,node:t,...n}){let[r,i]=(0,rg.useState)(!1),o=(0,rg.useRef)(null);return(0,ed.jsxs)("pre",{ref:o,...n,children:[(0,ed.jsx)("button",{onClick:async()=>{let l=o.current?.querySelector("code")?.textContent??"";try{await navigator.clipboard.writeText(l)}catch{let u=document.createElement("textarea");u.value=l,u.style.position="fixed",u.style.opacity="0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u)}i(!0),setTimeout(()=>i(!1),2e3)},className:`code-copy-button${r?" code-copy-button-checked":""}`,title:"Copy to clipboard","aria-label":"Copy to clipboard",children:(0,ed.jsx)("i",{className:"bi"})}),e]})}var cL=G(ie(),1);function PS({children:e,node:t,...n}){return(0,cL.jsx)("table",{className:"table table-striped table-bordered",...n,children:e})}var As=G(fe(),1);var fL=G(ie(),1);function Ma({html:e,className:t,displayContents:n=!0,fillable:r=!0}){let i=(0,As.useRef)(null),[o,s]=(0,As.useState)(!1),a=(0,As.useContext)(ds);return(0,As.useEffect)(()=>{let l=i.current;if(!l)return;l.innerHTML=e;let u=l.parentElement;return s(r&&!!u?.classList.contains("html-fill-container")),a&&e&&a.bindAll(l),()=>{a&&l&&a.unbindAll(l)}},[e,a,r]),(0,fL.jsx)("div",{ref:i,className:o?`html-fill-item html-fill-container${t?` ${t}`:""}`:t,style:n?{display:"contents"}:void 0})}var sr=G(ie(),1),dL=({node:e})=>(0,sr.jsx)(Ma,{html:e?bf(e.children):"",displayContents:!0}),lX={pre:uL,table:PS,"shiny-chat-raw-html":dL,"shinychat-raw-html":dL},uX={table:PS};function Kt({content:e,contentType:t,role:n,streaming:r=!1,tagToComponentMap:i,prefix:o}){let s=n==="user",a=t==="text",l=t==="html",u=l?aL:s?lL:sL,c=(0,yo.useMemo)(()=>s?{...uX,...i}:{...lX,...i},[s,i]),f=r&&!a?GM(e):e,d=(0,yo.useMemo)(()=>a?null:l?qM(f,u):zM(f,u),[f,a,l,u]),p=(0,yo.useMemo)(()=>d?VM(d,{tagToComponentMap:c,streaming:r}):null,[d,r,c]);return a?(0,sr.jsxs)(sr.Fragment,{children:[o,o&&" ",e]}):o&&p?(0,sr.jsx)(sr.Fragment,{children:cX(p,o)}):(0,sr.jsx)(sr.Fragment,{children:p})}function cX(e,t){let n=yo.default.Children.toArray(e.props.children);for(let r=0;r +`,t);return e.slice(n,r===-1?e.length:r)}function LS(e,t){let n=0,r=0;for(;r")return i;n++,(e[n]===" "||e[n]===" ")&&n++,r++}return n}function lX(e){let t=0,n=0;for(;;){let r=t;for(;t-r<3&&e[t]===" ";)t++;if(e[t]!==">")return n;t++,(e[t]===" "||e[t]===" ")&&t++,n++}}function oL(e){let t=0;for(let n of e)if(n===" ")t++;else if(n===" ")t+=4-t%4;else break;return t}var sL=ba().use(va).use(Aa).use(nL).use(Na,{allowDangerousHtml:!0}).use(UM).use(Wf).use(FM).use(tL).use(YI).use(RS).use(DS).use(MS).use(IS).use($1).use(wS).use(AS).use(K1).use(NS).use(ng,{detect:!1,ignoreMissing:!0}).freeze(),aL=ba().use(RS).use(DS).use(MS).use(IS).use($1).use(wS).use(AS).use(K1).use(NS).freeze(),lL=ba().use(va).use(Aa).use(VI).use(Na,{allowDangerousHtml:!0}).use(Wf).use(Vm).freeze();var rg=G(fe(),1),ed=G(ie(),1);function uL({children:e,node:t,...n}){let[r,i]=(0,rg.useState)(!1),o=(0,rg.useRef)(null);return(0,ed.jsxs)("pre",{ref:o,...n,children:[(0,ed.jsx)("button",{onClick:async()=>{let l=o.current?.querySelector("code")?.textContent??"";try{await navigator.clipboard.writeText(l)}catch{let u=document.createElement("textarea");u.value=l,u.style.position="fixed",u.style.opacity="0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u)}i(!0),setTimeout(()=>i(!1),2e3)},className:`code-copy-button${r?" code-copy-button-checked":""}`,title:"Copy to clipboard","aria-label":"Copy to clipboard",children:(0,ed.jsx)("i",{className:"bi"})}),e]})}var cL=G(ie(),1);function PS({children:e,node:t,...n}){return(0,cL.jsx)("table",{className:"table table-striped table-bordered",...n,children:e})}var As=G(fe(),1);var fL=G(ie(),1);function Ma({html:e,className:t,displayContents:n=!0,fillable:r=!0}){let i=(0,As.useRef)(null),[o,s]=(0,As.useState)(!1),a=(0,As.useContext)(ds);return(0,As.useEffect)(()=>{let l=i.current;if(!l)return;l.innerHTML=e;let u=l.parentElement;return s(r&&!!u?.classList.contains("html-fill-container")),a&&e&&a.bindAll(l),()=>{a&&l&&a.unbindAll(l)}},[e,a,r]),(0,fL.jsx)("div",{ref:i,className:o?`html-fill-item html-fill-container${t?` ${t}`:""}`:t,style:n?{display:"contents"}:void 0})}var uX=["shiny-chat-raw-html","shinychat-raw-html","shiny-tool-request","shiny-tool-result"],cX=new RegExp(`<(/?)(${uX.join("|")})(?=[\\s/>]|$)`,"gi");function dL(e){return e.replace(cX,"<$1$2")}var sr=G(ie(),1),pL=({node:e})=>(0,sr.jsx)(Ma,{html:e?bf(e.children):"",displayContents:!0}),fX={pre:uL,table:PS,"shiny-chat-raw-html":pL,"shinychat-raw-html":pL},dX={table:PS};function Kt({content:e,contentType:t,role:n,streaming:r=!1,tagToComponentMap:i,prefix:o}){let s=n==="user",a=t==="text",l=t==="html",u=l?aL:s?lL:sL,c=(0,yo.useMemo)(()=>s?{...dX,...i}:{...fX,...i},[s,i]),f=r&&!a?GM(e):e,d=(0,yo.useMemo)(()=>a?null:l?qM(f,u):zM(dL(f),u),[f,a,l,u]),p=(0,yo.useMemo)(()=>d?VM(d,{tagToComponentMap:c,streaming:r}):null,[d,r,c]);return a?(0,sr.jsxs)(sr.Fragment,{children:[o,o&&" ",e]}):o&&p?(0,sr.jsx)(sr.Fragment,{children:pX(p,o)}):(0,sr.jsx)(sr.Fragment,{children:p})}function pX(e,t){let n=yo.default.Children.toArray(e.props.children);for(let r=0;r -`;var sg='',mL=` +`;var sg='',gL=` -`,gL='',BS='',bL='',Ru='',yL='',EL='',TL='',SL='';var ar=G(fe(),1),xL=G(qi(),1);var td=G(ie(),1);function _L(e){let[t,n]=(0,ar.useState)(!1),r=(0,ar.useRef)(!1),i=(0,ar.useRef)(null),o=(0,ar.useRef)(null),s=(0,ar.useRef)(null),a=(0,ar.useRef)(d=>{s.current?.(d)}),l=(0,ar.useCallback)(()=>{if(!r.current)return;let d=e.current;d&&(r.current=!1,n(!1),d.removeAttribute("fullscreen"),d.removeAttribute("tabindex"),window.dispatchEvent(new Event("resize")),document.removeEventListener("keydown",a.current,!0),i.current?.focus(),i.current=null)},[e]),u=(0,ar.useCallback)(d=>{if(d.key==="Escape"){let T=d.target;if(typeof T.matches=="function"&&(T.matches("select[open]")||T.matches("input[aria-expanded='true']")))return;l(),d.preventDefault();return}if(d.key!=="Tab")return;let p=e.current;if(!p?.hasAttribute("fullscreen")||!r.current)return;let h=[...p.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(T=>T.offsetParent!==null),g=o.current;if(!g)return;let y=h[0],b=h[h.length-1],E=document.activeElement;!d.shiftKey&&(E===b||E===p)?(d.preventDefault(),g.focus()):!d.shiftKey&&E===g?(d.preventDefault(),(y??p).focus()):d.shiftKey&&(E===y||E===p)?(d.preventDefault(),g.focus()):d.shiftKey&&E===g?(d.preventDefault(),(b??p).focus()):!p.contains(E)&&E!==g&&(d.preventDefault(),p.focus())},[e,l]);s.current=u;let c=(0,ar.useCallback)(d=>{if(r.current)return;let p=e.current;p&&(r.current=!0,n(!0),i.current=d,p.setAttribute("fullscreen",""),window.dispatchEvent(new Event("resize")),document.addEventListener("keydown",a.current,!0),p.setAttribute("tabindex","-1"),p.focus())},[e]);(0,ar.useEffect)(()=>{let d=e.current,p=a.current;return()=>{r.current&&(r.current=!1,d&&(d.removeAttribute("fullscreen"),d.removeAttribute("tabindex")),document.removeEventListener("keydown",p,!0),i.current?.focus(),i.current=null)}},[e]);let f=t?(0,xL.createPortal)((0,td.jsx)("div",{className:"shiny-tool-fullscreen-backdrop",onClick:l,children:(0,td.jsxs)("button",{ref:o,type:"button",className:"shiny-tool-fullscreen-exit","aria-label":"Exit fullscreen",onClick:d=>{d.stopPropagation(),l()},children:["Close ",(0,td.jsx)("span",{dangerouslySetInnerHTML:{__html:bL}})]})}),document.body):null;return{enterFullscreen:c,exitFullscreen:l,overlay:f}}var wr=G(ie(),1);function fX(e){return e.replace(/&/g,"&").replace(//g,">")}var dX={__html:mL},pX={__html:BS};function ag({toolName:e,toolTitle:t,label:n,intent:r,icon:i,classStatus:o="",statusNote:s,fullScreen:a=!1,initialExpanded:l=!1,footer:u,onEnterFullscreen:c,cardRef:f,children:d}){let[p,h]=(0,Oa.useState)(l),g=(0,Oa.useId)(),y=`tool-header${g}`,b=`tool-content${g}`,E=i||sg,T=t||`${e}()`,S=n?`: ${fX(n)}`:"",v=`${T}${S}`,x=(0,Oa.useMemo)(()=>({__html:E}),[E]),R=(0,Oa.useMemo)(()=>({__html:v}),[v]);function O(C){C.preventDefault(),!C.currentTarget.closest(".shiny-tool-card")?.hasAttribute("fullscreen")&&(h(!p),requestAnimationFrame(()=>window.dispatchEvent(new Event("resize"))))}function B(C){C.preventDefault(),C.stopPropagation(),h(!0),c?.(C.currentTarget)}return(0,wr.jsxs)("div",{ref:f,className:"shiny-tool-card card bslib-card html-fill-item html-fill-container m-0",children:[(0,wr.jsxs)("button",{className:"card-header",id:y,onClick:O,"aria-expanded":p,"aria-controls":b,children:[(0,wr.jsx)("div",{className:`tool-icon${o?` ${o}`:""}`,dangerouslySetInnerHTML:x}),(0,wr.jsx)("div",{className:`tool-title${o?` ${o}`:""}`,dangerouslySetInnerHTML:R}),s&&(0,wr.jsx)("div",{className:`tool-status-note${o?` ${o}`:""}`,children:s}),(0,wr.jsx)("div",{className:"tool-spacer"}),r&&(0,wr.jsx)("div",{className:"tool-intent",children:r}),(0,wr.jsx)("div",{className:"collapse-indicator",dangerouslySetInnerHTML:dX})]}),(0,wr.jsxs)("div",{className:`card-body bslib-gap-spacing html-fill-item html-fill-container${p?"":" collapsed"}`,id:b,role:"region","aria-labelledby":y,inert:!p||void 0,children:[d,a&&c&&(0,wr.jsx)("button",{className:"tool-fullscreen-toggle badge rounded-pill",onClick:B,"aria-label":"Expand card","aria-controls":b,type:"button",dangerouslySetInnerHTML:pX})]}),u&&(0,wr.jsx)(Ma,{html:u,className:"card-footer",displayContents:!1,fillable:!1})]})}function Da(e,t="markdown"){let n="`".repeat(8);return`${n}${t} +`,bL='',BS='',yL='',Ru='',EL='',TL='',SL='',xL='';var ar=G(fe(),1),_L=G(qi(),1);var td=G(ie(),1);function vL(e){let[t,n]=(0,ar.useState)(!1),r=(0,ar.useRef)(!1),i=(0,ar.useRef)(null),o=(0,ar.useRef)(null),s=(0,ar.useRef)(null),a=(0,ar.useRef)(d=>{s.current?.(d)}),l=(0,ar.useCallback)(()=>{if(!r.current)return;let d=e.current;d&&(r.current=!1,n(!1),d.removeAttribute("fullscreen"),d.removeAttribute("tabindex"),window.dispatchEvent(new Event("resize")),document.removeEventListener("keydown",a.current,!0),i.current?.focus(),i.current=null)},[e]),u=(0,ar.useCallback)(d=>{if(d.key==="Escape"){let T=d.target;if(typeof T.matches=="function"&&(T.matches("select[open]")||T.matches("input[aria-expanded='true']")))return;l(),d.preventDefault();return}if(d.key!=="Tab")return;let p=e.current;if(!p?.hasAttribute("fullscreen")||!r.current)return;let h=[...p.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')].filter(T=>T.offsetParent!==null),g=o.current;if(!g)return;let y=h[0],b=h[h.length-1],E=document.activeElement;!d.shiftKey&&(E===b||E===p)?(d.preventDefault(),g.focus()):!d.shiftKey&&E===g?(d.preventDefault(),(y??p).focus()):d.shiftKey&&(E===y||E===p)?(d.preventDefault(),g.focus()):d.shiftKey&&E===g?(d.preventDefault(),(b??p).focus()):!p.contains(E)&&E!==g&&(d.preventDefault(),p.focus())},[e,l]);s.current=u;let c=(0,ar.useCallback)(d=>{if(r.current)return;let p=e.current;p&&(r.current=!0,n(!0),i.current=d,p.setAttribute("fullscreen",""),window.dispatchEvent(new Event("resize")),document.addEventListener("keydown",a.current,!0),p.setAttribute("tabindex","-1"),p.focus())},[e]);(0,ar.useEffect)(()=>{let d=e.current,p=a.current;return()=>{r.current&&(r.current=!1,d&&(d.removeAttribute("fullscreen"),d.removeAttribute("tabindex")),document.removeEventListener("keydown",p,!0),i.current?.focus(),i.current=null)}},[e]);let f=t?(0,_L.createPortal)((0,td.jsx)("div",{className:"shiny-tool-fullscreen-backdrop",onClick:l,children:(0,td.jsxs)("button",{ref:o,type:"button",className:"shiny-tool-fullscreen-exit","aria-label":"Exit fullscreen",onClick:d=>{d.stopPropagation(),l()},children:["Close ",(0,td.jsx)("span",{dangerouslySetInnerHTML:{__html:yL}})]})}),document.body):null;return{enterFullscreen:c,exitFullscreen:l,overlay:f}}var wr=G(ie(),1);function hX(e){return e.replace(/&/g,"&").replace(//g,">")}var mX={__html:gL},gX={__html:BS};function ag({toolName:e,toolTitle:t,label:n,intent:r,icon:i,classStatus:o="",statusNote:s,fullScreen:a=!1,initialExpanded:l=!1,footer:u,onEnterFullscreen:c,cardRef:f,children:d}){let[p,h]=(0,Oa.useState)(l),g=(0,Oa.useId)(),y=`tool-header${g}`,b=`tool-content${g}`,E=i||sg,T=t||`${e}()`,S=n?`: ${hX(n)}`:"",v=`${T}${S}`,x=(0,Oa.useMemo)(()=>({__html:E}),[E]),R=(0,Oa.useMemo)(()=>({__html:v}),[v]);function O(C){C.preventDefault(),!C.currentTarget.closest(".shiny-tool-card")?.hasAttribute("fullscreen")&&(h(!p),requestAnimationFrame(()=>window.dispatchEvent(new Event("resize"))))}function B(C){C.preventDefault(),C.stopPropagation(),h(!0),c?.(C.currentTarget)}return(0,wr.jsxs)("div",{ref:f,className:"shiny-tool-card card bslib-card html-fill-item html-fill-container m-0",children:[(0,wr.jsxs)("button",{className:"card-header",id:y,onClick:O,"aria-expanded":p,"aria-controls":b,children:[(0,wr.jsx)("div",{className:`tool-icon${o?` ${o}`:""}`,dangerouslySetInnerHTML:x}),(0,wr.jsx)("div",{className:`tool-title${o?` ${o}`:""}`,dangerouslySetInnerHTML:R}),s&&(0,wr.jsx)("div",{className:`tool-status-note${o?` ${o}`:""}`,children:s}),(0,wr.jsx)("div",{className:"tool-spacer"}),r&&(0,wr.jsx)("div",{className:"tool-intent",children:r}),(0,wr.jsx)("div",{className:"collapse-indicator",dangerouslySetInnerHTML:mX})]}),(0,wr.jsxs)("div",{className:`card-body bslib-gap-spacing html-fill-item html-fill-container${p?"":" collapsed"}`,id:b,role:"region","aria-labelledby":y,inert:!p||void 0,children:[d,a&&c&&(0,wr.jsx)("button",{className:"tool-fullscreen-toggle badge rounded-pill",onClick:B,"aria-label":"Expand card","aria-controls":b,type:"button",dangerouslySetInnerHTML:gX})]}),u&&(0,wr.jsx)(Ma,{html:u,className:"card-footer",displayContents:!1,fillable:!1})]})}function Da(e,t="markdown"){let n="`".repeat(8);return`${n}${t} ${e} -${n}`}var ku=G(ie(),1),hX='
Running\u2026
',lg=(0,vL.memo)(function({toolName:t,toolTitle:n,intent:r,arguments:i}){return(0,ku.jsx)(ag,{toolName:t,toolTitle:n,intent:r,icon:hX,children:(0,ku.jsxs)("div",{className:"shiny-tool-request__arguments",children:[(0,ku.jsx)("strong",{children:"Tool arguments"}),(0,ku.jsx)(Kt,{content:Da(i,"json"),contentType:"markdown",streaming:!1})]})})});var US=G(ie(),1);function CL({"request-id":e,"tool-name":t,"tool-title":n,intent:r,arguments:i}){let{supersededRequests:o}=Oh();return!e||!t||o.has(e)?null:(0,US.jsx)("div",{className:"shiny-tool-request",children:(0,US.jsx)(lg,{toolName:t,toolTitle:n,intent:r,arguments:i??"{}"})})}var ug=G(fe(),1);var Ye=G(ie(),1);function mX({filename:e}){return(0,Ye.jsxs)("div",{className:"shiny-chat-pdf badge fs-6 text-bg-secondary",children:[(0,Ye.jsx)("span",{className:"shiny-chat-pdf__icon me-1",dangerouslySetInnerHTML:{__html:TL}}),(0,Ye.jsx)("span",{className:"shiny-chat-pdf__filename font-monospace",children:e})]})}function gX({value:e,valueType:t}){return t==="html"?(0,Ye.jsx)(Ma,{html:e}):t==="text"?(0,Ye.jsx)("p",{children:e}):t==="markdown"?(0,Ye.jsx)(Kt,{content:e,contentType:"markdown",streaming:!1}):(0,Ye.jsx)(Kt,{content:Da(e,"text"),contentType:"markdown",streaming:!1})}var cg=(0,ug.memo)(function({toolName:t,toolTitle:n,label:r,intent:i,status:o,value:s,valueType:a,requestCall:l,showRequest:u=!1,fullScreen:c=!1,expanded:f=!1,icon:d,footer:p}){let h=(0,ug.useRef)(null),{enterFullscreen:g,overlay:y}=_L(h),b=o==="error";return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsxs)(ag,{toolName:t,toolTitle:n,label:r,intent:i,icon:b?og:d,classStatus:b?"text-danger":"",statusNote:b?"failed":void 0,fullScreen:c,initialExpanded:f,footer:p,onEnterFullscreen:g,cardRef:h,children:[bX(l,u),(0,Ye.jsx)(FS,{value:s,valueType:a,showRequest:u})]}),y]})});function bX(e,t){if(!t||!e)return null;let n=Da(e,""),r=e.split(` -`).length>2;return(0,Ye.jsx)("div",{className:"shiny-tool-result__request",children:r?(0,Ye.jsxs)("details",{children:[(0,Ye.jsx)("summary",{children:"Tool call"}),(0,Ye.jsx)(Kt,{content:n,contentType:"markdown",streaming:!1})]}):(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)("strong",{children:"Tool call"}),(0,Ye.jsx)(Kt,{content:n,contentType:"markdown",streaming:!1})]})})}function FS({value:e,valueType:t,showRequest:n}){let r=e||"[Empty result]",i;if(t==="html")i=(0,Ye.jsx)(Ma,{html:r});else if(t==="text")i=(0,Ye.jsx)("p",{children:r});else if(t==="content_extra")try{let s=JSON.parse(e);i=(0,Ye.jsx)("div",{className:"shiny-chat-content-extra",children:s.map((a,l)=>a.type==="image"?(0,Ye.jsx)("img",{src:a.src,className:"shiny-chat-tool-image"},l):a.type==="pdf"?(0,Ye.jsx)(mX,{filename:a.filename??""},l):a.type==="text"?(0,Ye.jsx)(gX,{value:a.value??"",valueType:a.value_type??"code"},l):null)})}catch{i=(0,Ye.jsx)(Kt,{content:Da(r,"text"),contentType:"markdown",streaming:!1})}else{let s=t!=="markdown"?Da(r,"text"):r;i=(0,Ye.jsx)(Kt,{content:s,contentType:"markdown",streaming:!1})}return!n&&t==="html"?i:(0,Ye.jsxs)("div",{className:"shiny-tool-result__result",children:[n?(0,Ye.jsx)("strong",{children:"Tool result"}):null,i]})}var HS=G(ie(),1);function AL({"request-id":e,"tool-name":t,"tool-title":n,label:r,intent:i,status:o,value:s,"value-type":a,"request-call":l,"show-request":u,"full-screen":c,expanded:f,"custom-display":d,icon:p,footer:h}){return ru(d)||!e||!t?null:(0,HS.jsx)("div",{className:"shiny-tool-result",children:(0,HS.jsx)(cg,{toolName:t,toolTitle:n,label:r,intent:i,status:o??"success",value:s??"",valueType:a??"markdown",requestCall:l,showRequest:ru(u),fullScreen:ru(c),expanded:ru(f),icon:p,footer:h})})}function nd(){return null}var Or=G(fe(),1);var Q=G(fe(),1);function fg(){return typeof window<"u"}function Ri(e){return dg(e)?(e.nodeName||"").toLowerCase():"#document"}function yn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ki(e){var t;return(t=(dg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dg(e){return fg()?e instanceof Node||e instanceof yn(e).Node:!1}function pt(e){return fg()?e instanceof Element||e instanceof yn(e).Element:!1}function Ut(e){return fg()?e instanceof HTMLElement||e instanceof yn(e).HTMLElement:!1}function Mu(e){return!fg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yn(e).ShadowRoot}function rd(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=kr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function NL(e){return/^(table|td|th)$/.test(Ri(e))}function id(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var yX=/transform|translate|scale|rotate|perspective|filter/,EX=/paint|layout|strict|content/,Ia=e=>!!e&&e!=="none",zS;function pg(e){let t=pt(e)?kr(e):e;return Ia(t.transform)||Ia(t.translate)||Ia(t.scale)||Ia(t.rotate)||Ia(t.perspective)||!Ou()&&(Ia(t.backdropFilter)||Ia(t.filter))||yX.test(t.willChange||"")||EX.test(t.contain||"")}function wL(e){let t=wi(e);for(;Ut(t)&&!Mi(t);){if(pg(t))return t;if(id(t))return null;t=wi(t)}return null}function Ou(){return zS==null&&(zS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),zS}function Mi(e){return/^(html|body|#document)$/.test(Ri(e))}function kr(e){return yn(e).getComputedStyle(e)}function od(e){return pt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wi(e){if(Ri(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Mu(e)&&e.host||ki(e);return Mu(t)?t.host:t}function RL(e){let t=wi(e);return Mi(t)?(e.ownerDocument||e).body:Ut(t)&&rd(t)?t:RL(t)}function Rr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let i=RL(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=yn(i);if(o){let a=hg(s);return t.concat(s,s.visualViewport||[],rd(i)?i:[],a&&n?Rr(a):[])}else return t.concat(i,Rr(i,[],n))}function hg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Pu=G(fe(),1),YL=G(fe(),1);var Du=Math.min,Eo=Math.max,ad=Math.round,ld=Math.floor,Oi=e=>({x:e,y:e}),TX={left:"right",right:"left",bottom:"top",top:"bottom"};function OL(e,t,n){return Eo(e,Du(t,n))}function ud(e,t){return typeof e=="function"?e(t):e}function La(e){return e.split("-")[0]}function cd(e){return e.split("-")[1]}function qS(e){return e==="x"?"y":"x"}function VS(e){return e==="y"?"height":"width"}function To(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function GS(e){return qS(To(e))}function DL(e,t,n){n===void 0&&(n=!1);let r=cd(e),i=GS(e),o=VS(i),s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=sd(s)),[s,sd(s)]}function IL(e){let t=sd(e);return[mg(e),t,mg(t)]}function mg(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var kL=["left","right"],ML=["right","left"],SX=["top","bottom"],xX=["bottom","top"];function _X(e,t,n){switch(e){case"top":case"bottom":return n?t?ML:kL:t?kL:ML;case"left":case"right":return t?SX:xX;default:return[]}}function LL(e,t,n,r){let i=cd(e),o=_X(La(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(mg)))),o}function sd(e){let t=La(e);return TX[t]+e.slice(t.length)}function vX(e){var t,n,r,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function PL(e){return typeof e!="number"?vX(e):{top:e,right:e,bottom:e,left:e}}function Pa(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var CX=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],gg=CX.join(","),UL=typeof Element>"u",Iu=UL?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,bg=!UL&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},yg=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):yg(t.parentNode));return s},AX=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},FL=function(t,n,r){if(yg(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(gg));return n&&Iu.call(t,gg)&&i.unshift(t),i=i.filter(r),i},Eg=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!yg(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=Eg(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var c=Iu.call(s,gg);c&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),d=!yg(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&d){var p=Eg(f===!0?s.children:f.children,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:s,candidates:p})}else o.unshift.apply(o,s.children)}}return i},HL=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},zL=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||AX(t))&&!HL(t)?0:t.tabIndex},NX=function(t,n){var r=zL(t);return r<0&&n&&!HL(t)?0:r},wX=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},qL=function(t){return t.tagName==="INPUT"},RX=function(t){return qL(t)&&t.type==="hidden"},kX=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},MX=function(t,n){for(var r=0;rsummary:first-of-type"),u=l?t.parentElement:t;if(Iu.call(u,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var c=t;t;){var f=t.parentElement,d=bg(t);if(f&&!f.shadowRoot&&i(f)===!0)return BL(t);t.assignedSlot?t=t.assignedSlot:!f&&d!==t.ownerDocument?t=d.host:t=f}t=c}if(LX(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return BL(t);return!1},BX=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r=0)},VL=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=NX(a,s),u=s?VL(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(wX).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},Lu=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Eg([t],n.includeContainer,{filter:YS.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:UX}):r=FL(t,n.includeContainer,YS.bind(null,n)),VL(r)},GL=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Eg([t],n.includeContainer,{filter:KS.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=FL(t,n.includeContainer,KS.bind(null,n)),r},$S=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Iu.call(t,gg)===!1?!1:YS(n,t)};function jS(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function XS(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function QS(){return/apple/i.test(navigator.vendor)}function WS(){let e=/android/i;return e.test(jS())||e.test(XS())}function $L(){return jS().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function WL(){return XS().includes("jsdom/")}var KL="data-floating-ui-focusable",FX="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function So(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function En(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Mu(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Di(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Tg(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function jL(e){return e.matches("html,body")}function Tn(e){return e?.ownerDocument||document}function Sg(e){return Ut(e)&&e.matches(FX)}function ZS(e){return e?e.getAttribute("role")==="combobox"&&Sg(e):!1}function XL(e){if(!e||WL())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function xg(e){return e?e.hasAttribute(KL)?e:e.querySelector("["+KL+"]")||e:null}function Ba(e,t,n){return n===void 0&&(n=!0),e.filter(i=>{var o;return i.parentId===t&&(!n||((o=i.context)==null?void 0:o.open))}).flatMap(i=>[i,...Ba(e,i.id,n)])}function JS(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){let o=e.find(s=>s.id===i);i=o?.parentId,o&&(r=r.concat(o))}return r}function _g(e){e.preventDefault(),e.stopPropagation()}function QL(e){return"nativeEvent"in e}function ZL(e){return e.mozInputSource===0&&e.isTrusted?!0:WS()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function JL(e){return WL()?!1:!WS()&&e.width===0&&e.height===0||WS()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Bu(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var HX=typeof document<"u",zX=function(){},Vn=HX?YL.useLayoutEffect:zX,qX={...Pu};function Ns(e){let t=Pu.useRef(e);return Vn(()=>{t.current=e}),t}var VX=qX.useInsertionEffect,GX=VX||(e=>e());function Gn(e){let t=Pu.useRef(()=>{});return GX(()=>{t.current=e}),Pu.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function e3(e,t){let n=Lu(e,Uu()),r=n.length;if(r===0)return;let i=So(Tn(e)),o=n.indexOf(i),s=o===-1?t===1?0:r-1:o+t;return n[s]}function ex(e){return e3(Tn(e).body,1)||e}function tx(e){return e3(Tn(e).body,-1)||e}function Fu(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!En(n,r)}function t3(e){Lu(e,Uu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function nx(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{let r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}var lr=G(ie(),1);var hx=G(qi(),1);function n3(e,t,n){let{reference:r,floating:i}=e,o=To(t),s=GS(t),a=VS(s),l=La(t),u=o==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[a]/2-i[a]/2,p;switch(l){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}let h=cd(t);return h&&(p[s]+=d*(h==="end"?1:-1)*(n&&u?-1:1)),p}async function r3(e,t){var n;t===void 0&&(t={});let{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=ud(t,e),h=PL(p),y=a[d?f==="floating"?"reference":"floating":f],b=Pa(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),E=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),S=await(o.isElement==null?void 0:o.isElement(T))&&await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1},v=Pa(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:T,strategy:l}):E);return{top:(b.top-v.top+h.top)/S.y,bottom:(v.bottom-b.bottom+h.bottom)/S.y,left:(b.left-v.left+h.left)/S.x,right:(v.right-b.right+h.right)/S.x}}var KX=50,i3=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:r3},l=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=n3(u,r,l),d=r,p=0,h={};for(let g=0;gL<=0)){var V,Y;let L=(((V=o.flip)==null?void 0:V.index)||0)+1,H=R[L];if(H&&(!(f==="alignment"?E!==To(H):!1)||C.every(D=>To(D.placement)===E?D.overflows[0]>0:!0)))return{data:{index:L,overflows:C},reset:{placement:H}};let I=(Y=C.filter(P=>P.overflows[0]<=0).sort((P,D)=>P.overflows[1]-D.overflows[1])[0])==null?void 0:Y.placement;if(!I)switch(p){case"bestFit":{var q;let P=(q=C.filter(D=>{if(x){let U=To(D.placement);return U===E||U==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(U=>U>0).reduce((U,_)=>U+_,0)]).sort((D,U)=>D[1]-U[1])[0])==null?void 0:q[0];P&&(I=P);break}case"initialPlacement":I=a;break}if(i!==I)return{reset:{placement:I}}}return{}}}};var YX=new Set(["left","top"]);async function $X(e,t){let{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=La(n),a=cd(n),l=To(n)==="y",u=YX.has(s)?-1:1,c=o&&l?-1:1,f=ud(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof h=="number"&&(p=a==="end"?h*-1:h),l?{x:p*c,y:d*u}:{x:d*u,y:p*c}}var s3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:i,y:o,placement:s,middlewareData:a}=t,l=await $X(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},a3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:E=>{let{x:T,y:S}=E;return{x:T,y:S}}},...u}=ud(e,t),c={x:n,y:r},f=await o.detectOverflow(t,u),d=To(i),p=qS(d),h=c[p],g=c[d],y=(E,T)=>OL(T+f[E==="y"?"top":"left"],T,T-f[E==="y"?"bottom":"right"]);s&&(h=y(p,h)),a&&(g=y(d,g));let b=l.fn({...t,[p]:h,[d]:g});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:s,[d]:a}}}}}};function c3(e){let t=kr(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ut(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=ad(n)!==o||ad(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function ix(e){return pt(e)?e:e.contextElement}function Hu(e){let t=ix(e);if(!Ut(t))return Oi(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=c3(t),s=(o?ad(n.width):n.width)/r,a=(o?ad(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var WX=Oi(0);function f3(e){let t=yn(e);return!Ou()||!t.visualViewport?WX:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jX(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===yn(e)}function Ua(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),o=ix(e),s=Oi(1);t&&(r?pt(r)&&(s=Hu(r)):s=Hu(e));let a=jX(o,n,r)?f3(o):Oi(0),l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,f=i.height/s.y;if(o&&r){let d=yn(o),p=pt(r)?yn(r):r,h=d,g=hg(h);for(;g&&p!==h;){let y=Hu(g),b=g.getBoundingClientRect(),E=kr(g),T=b.left+(g.clientLeft+parseFloat(E.paddingLeft))*y.x,S=b.top+(g.clientTop+parseFloat(E.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,f*=y.y,l+=T,u+=S,h=yn(g),g=hg(h)}}return Pa({width:c,height:f,x:l,y:u})}function vg(e,t){let n=od(e).scrollLeft;return t?t.left+n:Ua(ki(e)).left+n}function d3(e,t){let n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-vg(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function XX(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o=i==="fixed",s=ki(r),a=t?id(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=Oi(1),c=Oi(0),f=Ut(r);if((f||!o)&&((Ri(r)!=="body"||rd(s))&&(l=od(r)),f)){let p=Ua(r);u=Hu(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}let d=s&&!f&&!o?d3(s,l):Oi(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:n.y*u.y-l.scrollTop*u.y+c.y+d.y}}function QX(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ZX(e){let t=od(e),n=e.ownerDocument.body,r=Eo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Eo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),o=-t.scrollLeft+vg(e),s=-t.scrollTop;return kr(n).direction==="rtl"&&(o+=Eo(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:o,y:s}}var JX=25;function eQ(e,t,n){n===void 0&&(n="viewport");let r=n==="layoutViewport",i=yn(e),o=ki(e),s=i.visualViewport,a=o.clientWidth,l=o.clientHeight,u=0,c=0;if(s){let d=!Ou()||t==="fixed";r?d||(u=-s.offsetLeft,c=-s.offsetTop):(a=s.width,l=s.height,d&&(u=s.offsetLeft,c=s.offsetTop))}if(vg(o)<=0){let d=o.ownerDocument,p=d.body,h=getComputedStyle(p),g=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,y=Math.abs(o.clientWidth-p.clientWidth-g),b=getComputedStyle(o).scrollbarGutter==="stable both-edges"?y/2:y;b<=JX&&(a-=b)}return{width:a,height:l,x:u,y:c}}function tQ(e,t){let n=Ua(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Hu(e),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:s,height:a,x:l,y:u}}function l3(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=eQ(e,n,t);else if(t==="document")r=ZX(ki(e));else if(pt(t))r=tQ(t,n);else{let i=f3(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Pa(r)}function nQ(e,t){let n=t.get(e);if(n)return n;let r=Rr(e,[],!1).filter(a=>pt(a)&&Ri(a)!=="body"),i=null,o=kr(e).position==="fixed",s=o?wi(e):e;for(;pt(s)&&!Mi(s);){let a=kr(s),l=pg(s),u=i?i.position:o?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&a.position==="static")?r=r.filter(f=>f!==s):i=a,s=wi(s)}return t.set(e,r),r}function rQ(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,s=[...n==="clippingAncestors"?id(t)?[]:nQ(t,this._c):[].concat(n),r],a=l3(t,s[0],i),l=a.top,u=a.right,c=a.bottom,f=a.left;for(let d=1;d{a(!1,1e-7)},1e3)}R=!1}try{r=new IntersectionObserver(O,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(O,x)}r.observe(e)}let l=yn(e),u=()=>a(n);return l.addEventListener("resize",u),a(!0),()=>{l.removeEventListener("resize",u),s()}}function Cg(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=ix(e),c=i||o?[...u?Rr(u):[],...t?Rr(t):[]]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n),o&&b.addEventListener("resize",n)});let f=u&&a?lQ(u,n,o):null,d=-1,p=null;s&&(p=new ResizeObserver(b=>{let[E]=b;E&&E.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var T;(T=p)==null||T.observe(t)})),n()}),u&&!l&&p.observe(u),t&&p.observe(t));let h,g=l?Ua(e):null;l&&y();function y(){let b=Ua(e);g&&!h3(g,b)&&n(),g=b,h=requestAnimationFrame(y)}return n(),()=>{var b;c.forEach(E=>{i&&E.removeEventListener("scroll",n),o&&E.removeEventListener("resize",n)}),f?.(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var m3=s3;var g3=a3,b3=o3;var Ag=(e,t,n)=>{let r=new Map,i=n??{},o={...ox,...i.platform,_c:r};return i3(e,t,{...i,platform:o})};var Yt=G(fe(),1),E3=G(fe(),1),T3=G(qi(),1),cQ=typeof document<"u",fQ=function(){},Ng=cQ?E3.useLayoutEffect:fQ;function wg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!wg(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!wg(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function S3(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function y3(e,t){let n=S3(e);return Math.round(t*n)/n}function sx(e){let t=Yt.useRef(e);return Ng(()=>{t.current=e}),t}function x3(e){e===void 0&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,f]=Yt.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=Yt.useState(r);wg(d,r)||p(r);let[h,g]=Yt.useState(null),[y,b]=Yt.useState(null),E=Yt.useCallback(D=>{D!==x.current&&(x.current=D,g(D))},[]),T=Yt.useCallback(D=>{D!==R.current&&(R.current=D,b(D))},[]),S=o||h,v=s||y,x=Yt.useRef(null),R=Yt.useRef(null),O=Yt.useRef(c),B=l!=null,C=sx(l),V=sx(i),Y=sx(u),q=Yt.useCallback(()=>{if(!x.current||!R.current)return;let D={placement:t,strategy:n,middleware:d};V.current&&(D.platform=V.current),Ag(x.current,R.current,D).then(U=>{let _={...U,isPositioned:Y.current!==!1};L.current&&!wg(O.current,_)&&(O.current=_,T3.flushSync(()=>{f(_)}))})},[d,t,n,V,Y]);Ng(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(D=>({...D,isPositioned:!1})))},[u]);let L=Yt.useRef(!1);Ng(()=>(L.current=!0,()=>{L.current=!1}),[]),Ng(()=>{if(S&&(x.current=S),v&&(R.current=v),S&&v){if(C.current)return C.current(S,v,q);q()}},[S,v,q,C,B]);let H=Yt.useMemo(()=>({reference:x,floating:R,setReference:E,setFloating:T}),[E,T]),I=Yt.useMemo(()=>({reference:S,floating:v}),[S,v]),P=Yt.useMemo(()=>{let D={position:n,left:0,top:0};if(!I.floating)return D;let U=y3(I.floating,c.x),_=y3(I.floating,c.y);return a?{...D,transform:"translate("+U+"px, "+_+"px)",...S3(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:_}},[n,a,I.floating,c.x,c.y]);return Yt.useMemo(()=>({...c,update:q,refs:H,elements:I,floatingStyles:P}),[c,q,H,I,P])}var Rg=(e,t)=>{let n=m3(e);return{name:n.name,fn:n.fn,options:[e,t]}},ax=(e,t)=>{let n=g3(e);return{name:n.name,fn:n.fn,options:[e,t]}};var lx=(e,t)=>{let n=b3(e);return{name:n.name,fn:n.fn,options:[e,t]}};var dQ="data-floating-ui-focusable",_3="active",v3="selected",pQ="ArrowLeft",hQ="ArrowRight",mQ="ArrowUp",gQ="ArrowDown";var bQ=[pQ,hQ],yQ=[mQ,gQ],sxe=[...bQ,...yQ];var EQ={...Q},C3=!1,TQ=0,A3=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+TQ++;function SQ(){let[e,t]=Q.useState(()=>C3?A3():void 0);return Vn(()=>{e==null&&t(A3())},[]),Q.useEffect(()=>{C3=!0},[]),e}var xQ=EQ.useId,mx=xQ||SQ;function _Q(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var vQ=Q.createContext(null),CQ=Q.createContext(null),gx=()=>{var e;return((e=Q.useContext(vQ))==null?void 0:e.id)||null},Dg=()=>Q.useContext(CQ);function Fa(e){return"data-floating-ui-"+e}function Mr(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var N3=Fa("safe-polygon");function ux(e,t,n){if(n&&!Bu(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){let r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function cx(e){return typeof e=="function"?e():e}function F3(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:o,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:u=null,mouseOnly:c=!1,restMs:f=0,move:d=!0}=t,p=Dg(),h=gx(),g=Ns(u),y=Ns(l),b=Ns(n),E=Ns(f),T=Q.useRef(),S=Q.useRef(-1),v=Q.useRef(),x=Q.useRef(-1),R=Q.useRef(!0),O=Q.useRef(!1),B=Q.useRef(()=>{}),C=Q.useRef(!1),V=Gn(()=>{var P;let D=(P=i.current.openEvent)==null?void 0:P.type;return D?.includes("mouse")&&D!=="mousedown"});Q.useEffect(()=>{if(!a)return;function P(D){let{open:U}=D;U||(Mr(S),Mr(x),R.current=!0,C.current=!1)}return o.on("openchange",P),()=>{o.off("openchange",P)}},[a,o]),Q.useEffect(()=>{if(!a||!g.current||!n)return;function P(U){V()&&r(!1,U,"hover")}let D=Tn(s.floating).documentElement;return D.addEventListener("mouseleave",P),()=>{D.removeEventListener("mouseleave",P)}},[s.floating,n,r,a,g,V]);let Y=Q.useCallback(function(P,D,U){D===void 0&&(D=!0),U===void 0&&(U="hover");let _=ux(y.current,"close",T.current);_&&!v.current?(Mr(S),S.current=window.setTimeout(()=>r(!1,P,U),_)):D&&(Mr(S),r(!1,P,U))},[y,r]),q=Gn(()=>{B.current(),v.current=void 0}),L=Gn(()=>{if(O.current){let P=Tn(s.floating).body;P.style.pointerEvents="",P.removeAttribute(N3),O.current=!1}}),H=Gn(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);Q.useEffect(()=>{if(!a)return;function P(ne){if(Mr(S),R.current=!1,c&&!Bu(T.current)||cx(E.current)>0&&!ux(y.current,"open"))return;let A=ux(y.current,"open",T.current);A?S.current=window.setTimeout(()=>{b.current||r(!0,ne,"hover")},A):n||r(!0,ne,"hover")}function D(ne){if(H()){L();return}B.current();let A=Tn(s.floating);if(Mr(x),C.current=!1,g.current&&i.current.floatingContext){n||Mr(S),v.current=g.current({...i.current.floatingContext,tree:p,x:ne.clientX,y:ne.clientY,onClose(){L(),q(),H()||Y(ne,!0,"safe-polygon")}});let se=v.current;A.addEventListener("mousemove",se),B.current=()=>{A.removeEventListener("mousemove",se)};return}(T.current==="touch"?!En(s.floating,ne.relatedTarget):!0)&&Y(ne)}function U(ne){H()||i.current.floatingContext&&(g.current==null||g.current({...i.current.floatingContext,tree:p,x:ne.clientX,y:ne.clientY,onClose(){L(),q(),H()||Y(ne)}})(ne))}function _(){Mr(S)}function te(ne){H()||Y(ne,!1)}if(pt(s.domReference)){let ne=s.domReference,A=s.floating;return n&&ne.addEventListener("mouseleave",U),d&&ne.addEventListener("mousemove",P,{once:!0}),ne.addEventListener("mouseenter",P),ne.addEventListener("mouseleave",D),A&&(A.addEventListener("mouseleave",U),A.addEventListener("mouseenter",_),A.addEventListener("mouseleave",te)),()=>{n&&ne.removeEventListener("mouseleave",U),d&&ne.removeEventListener("mousemove",P),ne.removeEventListener("mouseenter",P),ne.removeEventListener("mouseleave",D),A&&(A.removeEventListener("mouseleave",U),A.removeEventListener("mouseenter",_),A.removeEventListener("mouseleave",te))}}},[s,a,e,c,d,Y,q,L,r,n,b,p,y,g,i,H,E]),Vn(()=>{var P;if(a&&n&&(P=g.current)!=null&&(P=P.__options)!=null&&P.blockPointerEvents&&V()){O.current=!0;let U=s.floating;if(pt(s.domReference)&&U){var D;let _=Tn(s.floating).body;_.setAttribute(N3,"");let te=s.domReference,ne=p==null||(D=p.nodesRef.current.find(A=>A.id===h))==null||(D=D.context)==null?void 0:D.elements.floating;return ne&&(ne.style.pointerEvents=""),_.style.pointerEvents="none",te.style.pointerEvents="auto",U.style.pointerEvents="auto",()=>{_.style.pointerEvents="",te.style.pointerEvents="",U.style.pointerEvents=""}}}},[a,n,h,s,p,g,V]),Vn(()=>{n||(T.current=void 0,C.current=!1,q(),L())},[n,q,L]),Q.useEffect(()=>()=>{q(),Mr(S),Mr(x),L()},[a,s.domReference,q,L]);let I=Q.useMemo(()=>{function P(D){T.current=D.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(D){let{nativeEvent:U}=D;function _(){!R.current&&!b.current&&r(!0,U,"hover")}c&&!Bu(T.current)||n||cx(E.current)===0||C.current&&D.movementX**2+D.movementY**2<2||(Mr(x),T.current==="touch"?_():(C.current=!0,x.current=window.setTimeout(_,cx(E.current))))}}},[c,r,n,b,E]);return Q.useMemo(()=>a?{reference:I}:{},[a,I])}var w3=0;function zu(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(w3);let o=()=>e?.focus({preventScroll:n});i?o():w3=requestAnimationFrame(o)}function AQ(e){return e?.ownerDocument||document}var qu={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function R3(e){return e==="inert"?qu.inert:e==="aria-hidden"?qu["aria-hidden"]:qu.none}var kg=new WeakSet,Mg={},fx=0,NQ=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function H3(e){return e?Mu(e)?e.host:H3(e.parentNode):null}var wQ=(e,t)=>t.map(n=>{if(e.contains(n))return n;let r=H3(n);return e.contains(r)?r:null}).filter(n=>n!=null);function RQ(e,t,n,r){let i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=wQ(t,e),a=new Set,l=new Set(s),u=[];Mg[i]||(Mg[i]=new WeakMap);let c=Mg[i];s.forEach(f),d(t),a.clear();function f(p){!p||a.has(p)||(a.add(p),p.parentNode&&f(p.parentNode))}function d(p){!p||l.has(p)||[].forEach.call(p.children,h=>{if(Ri(h)!=="script")if(a.has(h))d(h);else{let g=o?h.getAttribute(o):null,y=g!==null&&g!=="false",b=R3(o),E=(b.get(h)||0)+1,T=(c.get(h)||0)+1;b.set(h,E),c.set(h,T),u.push(h),E===1&&y&&kg.add(h),T===1&&h.setAttribute(i,""),!y&&o&&h.setAttribute(o,o==="inert"?"":"true")}})}return fx++,()=>{u.forEach(p=>{let h=R3(o),y=(h.get(p)||0)-1,b=(c.get(p)||0)-1;h.set(p,y),c.set(p,b),y||(!kg.has(p)&&o&&p.removeAttribute(o),kg.delete(p)),b||p.removeAttribute(i)}),fx--,fx||(qu.inert=new WeakMap,qu["aria-hidden"]=new WeakMap,qu.none=new WeakMap,kg=new WeakSet,Mg={})}}function k3(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=AQ(e[0]).body;return RQ(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}var bx={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Og=Q.forwardRef(function(t,n){let[r,i]=Q.useState();Vn(()=>{QS()&&i("button")},[]);let o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Fa("focus-guard")]:"",style:bx};return(0,lr.jsx)("span",{...t,...o})}),kQ={clipPath:"inset(50%)",position:"fixed",top:0,left:0},z3=Q.createContext(null),M3=Fa("portal");function MQ(e){e===void 0&&(e={});let{id:t,root:n}=e,r=mx(),i=q3(),[o,s]=Q.useState(null),a=Q.useRef(null);return Vn(()=>()=>{o?.remove(),queueMicrotask(()=>{a.current=null})},[o]),Vn(()=>{if(!r||a.current)return;let l=t?document.getElementById(t):null;if(!l)return;let u=document.createElement("div");u.id=r,u.setAttribute(M3,""),l.appendChild(u),a.current=u,s(u)},[t,r]),Vn(()=>{if(n===null||!r||a.current)return;let l=n||i?.portalNode;l&&!dg(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));let c=document.createElement("div");c.id=r,c.setAttribute(M3,""),l=u||l,l.appendChild(c),a.current=c,s(c)},[t,n,r,i]),o}function Ig(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,o=MQ({id:n,root:r}),[s,a]=Q.useState(null),l=Q.useRef(null),u=Q.useRef(null),c=Q.useRef(null),f=Q.useRef(null),d=s?.modal,p=s?.open,h=!!s&&!s.modal&&s.open&&i&&!!(r||o);return Q.useEffect(()=>{if(!o||!i||d)return;function g(y){o&&Fu(y)&&(y.type==="focusin"?nx:t3)(o)}return o.addEventListener("focusin",g,!0),o.addEventListener("focusout",g,!0),()=>{o.removeEventListener("focusin",g,!0),o.removeEventListener("focusout",g,!0)}},[o,i,d]),Q.useEffect(()=>{o&&(p||nx(o))},[p,o]),(0,lr.jsxs)(z3.Provider,{value:Q.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:f,portalNode:o,setFocusManagerState:a}),[i,o]),children:[h&&o&&(0,lr.jsx)(Og,{"data-type":"outside",ref:l,onFocus:g=>{if(Fu(g,o)){var y;(y=c.current)==null||y.focus()}else{let b=s?s.domReference:null,E=tx(b);E?.focus()}}}),h&&o&&(0,lr.jsx)("span",{"aria-owns":o.id,style:kQ}),o&&hx.createPortal(t,o),h&&o&&(0,lr.jsx)(Og,{"data-type":"outside",ref:u,onFocus:g=>{if(Fu(g,o)){var y;(y=f.current)==null||y.focus()}else{let b=s?s.domReference:null,E=ex(b);E?.focus(),s?.closeOnFocusOut&&s?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}var q3=()=>Q.useContext(z3);function O3(e){return Q.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}var D3=20,ws=[];function yx(){ws=ws.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function OQ(e){yx(),e&&Ri(e)!=="body"&&(ws.push(new WeakRef(e)),ws.length>D3&&(ws=ws.slice(-D3)))}function I3(){yx();let e=ws[ws.length-1];return e?.deref()}function DQ(e){let t=Uu();return $S(e,t)?e:Lu(e,t)[0]||e}function L3(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;let r=Uu(),o=GL(e,r).filter(a=>{let l=a.getAttribute("data-tabindex")||"";return $S(a,r)||a.hasAttribute("data-tabindex")&&!l.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}var IQ=Q.forwardRef(function(t,n){return(0,lr.jsx)("button",{...t,type:"button",ref:n,tabIndex:-1,style:bx})});function Lg(e){let{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:f=!0,outsideElementsInert:d=!1,getInsideElements:p=()=>[]}=e,{open:h,onOpenChange:g,events:y,dataRef:b,elements:{domReference:E,floating:T}}=t,S=Gn(()=>{var he;return(he=b.current.floatingContext)==null?void 0:he.nodeId}),v=Gn(p),x=typeof s=="number"&&s<0,R=ZS(E)&&x,O=NQ(),B=O?o:!0,C=!B||O&&d,V=Ns(i),Y=Ns(s),q=Ns(a),L=Dg(),H=q3(),I=Q.useRef(null),P=Q.useRef(null),D=Q.useRef(!1),U=Q.useRef(!1),_=Q.useRef(-1),te=Q.useRef(-1),ne=H!=null,A=xg(T),re=Gn(function(he){return he===void 0&&(he=A),he?Lu(he,Uu()):[]}),se=Gn(he=>{let Ce=re(he);return V.current.map(Ae=>E&&Ae==="reference"?E:A&&Ae==="floating"?A:Ce).filter(Boolean).flat()});Q.useEffect(()=>{if(r||!u)return;function he(Ae){if(Ae.key==="Tab"){En(A,So(Tn(A)))&&re().length===0&&!R&&_g(Ae);let Ne=se(),me=Di(Ae);V.current[0]==="reference"&&me===E&&(_g(Ae),Ae.shiftKey?zu(Ne[Ne.length-1]):zu(Ne[1])),V.current[1]==="floating"&&me===A&&Ae.shiftKey&&(_g(Ae),zu(Ne[0]))}}let Ce=Tn(A);return Ce.addEventListener("keydown",he),()=>{Ce.removeEventListener("keydown",he)}},[r,E,A,u,V,R,re,se]),Q.useEffect(()=>{if(r||!T)return;function he(Ce){let Ae=Di(Ce),me=re().indexOf(Ae);me!==-1&&(_.current=me)}return T.addEventListener("focusin",he),()=>{T.removeEventListener("focusin",he)}},[r,T,re]),Q.useEffect(()=>{if(r||!f)return;function he(){U.current=!0,setTimeout(()=>{U.current=!1})}function Ce(me){let we=me.relatedTarget,ue=me.currentTarget,St=Di(me);queueMicrotask(()=>{let Ie=S(),j=!(En(E,we)||En(T,we)||En(we,T)||En(H?.portalNode,we)||we!=null&&we.hasAttribute(Fa("focus-guard"))||L&&(Ba(L.nodesRef.current,Ie).find(Se=>{var Xe,wt;return En((Xe=Se.context)==null?void 0:Xe.elements.floating,we)||En((wt=Se.context)==null?void 0:wt.elements.domReference,we)})||JS(L.nodesRef.current,Ie).find(Se=>{var Xe,wt,xt;return[(Xe=Se.context)==null?void 0:Xe.elements.floating,xg((wt=Se.context)==null?void 0:wt.elements.floating)].includes(we)||((xt=Se.context)==null?void 0:xt.elements.domReference)===we})));if(ue===E&&A&&L3(A,V),l&&ue!==E&&!(St!=null&&St.isConnected)&&So(Tn(A))===Tn(A).body){Ut(A)&&A.focus();let Se=_.current,Xe=re(),wt=Xe[Se]||Xe[Xe.length-1]||A;Ut(wt)&&wt.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(R||!u)&&we&&j&&!U.current&&we!==I3()&&(D.current=!0,g(!1,me,"focus-out"))})}let Ae=!!(!L&&H);function Ne(){Mr(te),b.current.insideReactTree=!0,te.current=window.setTimeout(()=>{b.current.insideReactTree=!1})}if(T&&Ut(E))return E.addEventListener("focusout",Ce),E.addEventListener("pointerdown",he),T.addEventListener("focusout",Ce),Ae&&T.addEventListener("focusout",Ne,!0),()=>{E.removeEventListener("focusout",Ce),E.removeEventListener("pointerdown",he),T.removeEventListener("focusout",Ce),Ae&&T.removeEventListener("focusout",Ne,!0)}},[r,E,T,A,u,L,H,g,f,l,re,R,S,V,b]);let xe=Q.useRef(null),Ve=Q.useRef(null),de=O3([xe,H?.beforeInsideRef]),ct=O3([Ve,H?.afterInsideRef]);Q.useEffect(()=>{var he,Ce;if(r||!T)return;let Ae=Array.from((H==null||(he=H.portalNode)==null?void 0:he.querySelectorAll("["+Fa("portal")+"]"))||[]),me=(Ce=(L?JS(L.nodesRef.current,S()):[]).find(St=>{var Ie;return ZS(((Ie=St.context)==null?void 0:Ie.elements.domReference)||null)}))==null||(Ce=Ce.context)==null?void 0:Ce.elements.domReference,we=[T,me,...Ae,...v(),I.current,P.current,xe.current,Ve.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,V.current.includes("reference")||R?E:null].filter(St=>St!=null),ue=u||R?k3(we,!C,C):k3(we);return()=>{ue()}},[r,E,T,u,V,H,R,B,C,L,S,v]),Vn(()=>{if(r||!Ut(A))return;let he=Tn(A),Ce=So(he);queueMicrotask(()=>{let Ae=se(A),Ne=Y.current,me=(typeof Ne=="number"?Ae[Ne]:Ne.current)||A,we=En(A,Ce);!x&&!we&&h&&zu(me,{preventScroll:me===A})})},[r,h,A,x,se,Y]),Vn(()=>{if(r||!A)return;let he=Tn(A),Ce=So(he);OQ(Ce);function Ae(we){let{reason:ue,event:St,nested:Ie}=we;if(["hover","safe-polygon"].includes(ue)&&St.type==="mouseleave"&&(D.current=!0),ue==="outside-press")if(Ie)D.current=!1;else if(ZL(St)||JL(St))D.current=!1;else{let j=!1;document.createElement("div").focus({get preventScroll(){return j=!0,!1}}),j?D.current=!1:D.current=!0}}y.on("openchange",Ae);let Ne=he.createElement("span");Ne.setAttribute("tabindex","-1"),Ne.setAttribute("aria-hidden","true"),Object.assign(Ne.style,bx),ne&&E&&E.insertAdjacentElement("afterend",Ne);function me(){if(typeof q.current=="boolean"){let we=E||I3();return we&&we.isConnected?we:Ne}return q.current.current||Ne}return()=>{y.off("openchange",Ae);let we=So(he),ue=En(T,we)||L&&Ba(L.nodesRef.current,S(),!1).some(Ie=>{var j;return En((j=Ie.context)==null?void 0:j.elements.floating,we)}),St=me();queueMicrotask(()=>{let Ie=DQ(St);q.current&&!D.current&&Ut(Ie)&&(!(Ie!==we&&we!==he.body)||ue)&&Ie.focus({preventScroll:!0}),Ne.remove()})}},[r,T,A,q,b,y,L,ne,E,S]),Q.useEffect(()=>(queueMicrotask(()=>{D.current=!1}),()=>{queueMicrotask(yx)}),[r]),Vn(()=>{if(!r&&H)return H.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:g,domReference:E}),()=>{H.setFocusManagerState(null)}},[r,H,u,h,g,f,E]),Vn(()=>{r||A&&L3(A,V)},[r,A,V]);function Ge(he){return r||!c||!u?null:(0,lr.jsx)(IQ,{ref:he==="start"?I:P,onClick:Ce=>g(!1,Ce.nativeEvent),children:typeof c=="string"?c:"Dismiss"})}let rt=!r&&B&&(u?!R:!0)&&(ne||u);return(0,lr.jsxs)(lr.Fragment,{children:[rt&&(0,lr.jsx)(Og,{"data-type":"inside",ref:de,onFocus:he=>{if(u){let Ae=se();zu(i[0]==="reference"?Ae[0]:Ae[Ae.length-1])}else if(H!=null&&H.preserveTabOrder&&H.portalNode)if(D.current=!1,Fu(he,H.portalNode)){let Ae=ex(E);Ae?.focus()}else{var Ce;(Ce=H.beforeOutsideRef.current)==null||Ce.focus()}}}),!R&&Ge("start"),n,Ge("end"),rt&&(0,lr.jsx)(Og,{"data-type":"inside",ref:ct,onFocus:he=>{if(u)zu(se()[0]);else if(H!=null&&H.preserveTabOrder&&H.portalNode)if(f&&(D.current=!0),Fu(he,H.portalNode)){let Ae=tx(E);Ae?.focus()}else{var Ce;(Ce=H.afterOutsideRef.current)==null||Ce.focus()}}})]})}function P3(e){return Ut(e.target)&&e.target.tagName==="BUTTON"}function LQ(e){return Ut(e.target)&&e.target.tagName==="A"}function B3(e){return Sg(e)}function V3(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:c=!0,stickIfOpen:f=!0}=t,d=Q.useRef(),p=Q.useRef(!1),h=Q.useMemo(()=>({onPointerDown(g){d.current=g.pointerType},onMouseDown(g){let y=d.current;g.button===0&&a!=="click"&&(Bu(y,!0)&&u||(n&&l&&(!(i.current.openEvent&&f)||i.current.openEvent.type==="mousedown")?r(!1,g.nativeEvent,"click"):(g.preventDefault(),r(!0,g.nativeEvent,"click"))))},onClick(g){let y=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}Bu(y,!0)&&u||(n&&l&&(!(i.current.openEvent&&f)||i.current.openEvent.type==="click")?r(!1,g.nativeEvent,"click"):r(!0,g.nativeEvent,"click"))},onKeyDown(g){d.current=void 0,!(g.defaultPrevented||!c||P3(g))&&(g.key===" "&&!B3(o)&&(g.preventDefault(),p.current=!0),!LQ(g)&&g.key==="Enter"&&r(!(n&&l),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!c||P3(g)||B3(o)||g.key===" "&&p.current&&(p.current=!1,r(!(n&&l),g.nativeEvent,"click"))}}),[i,o,a,u,c,r,n,f,l]);return Q.useMemo(()=>s?{reference:h}:{},[s,h])}var PQ={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},BQ={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},U3=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function G3(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:o}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:c=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:p,capture:h}=t,g=Dg(),y=Gn(typeof l=="function"?l:()=>!1),b=typeof l=="function"?y:l,E=Q.useRef(!1),{escapeKey:T,outsidePress:S}=U3(p),{escapeKey:v,outsidePress:x}=U3(h),R=Q.useRef(!1),O=Gn(L=>{var H;if(!n||!s||!a||L.key!=="Escape"||R.current)return;let I=(H=o.current.floatingContext)==null?void 0:H.nodeId,P=g?Ba(g.nodesRef.current,I):[];if(!T&&(L.stopPropagation(),P.length>0)){let D=!0;if(P.forEach(U=>{var _;if((_=U.context)!=null&&_.open&&!U.context.dataRef.current.__escapeKeyBubbles){D=!1;return}}),!D)return}r(!1,QL(L)?L.nativeEvent:L,"escape-key")}),B=Gn(L=>{var H;let I=()=>{var P;O(L),(P=Di(L))==null||P.removeEventListener("keydown",I)};(H=Di(L))==null||H.addEventListener("keydown",I)}),C=Gn(L=>{var H;let I=o.current.insideReactTree;o.current.insideReactTree=!1;let P=E.current;if(E.current=!1,u==="click"&&P||I||typeof b=="function"&&!b(L))return;let D=Di(L),U="["+Fa("inert")+"]",_=Tn(i.floating).querySelectorAll(U),te=pt(D)?D:null;for(;te&&!Mi(te);){let se=wi(te);if(Mi(se)||!pt(se))break;te=se}if(_.length&&pt(D)&&!jL(D)&&!En(D,i.floating)&&Array.from(_).every(se=>!En(te,se)))return;if(Ut(D)&&q){let se=Mi(D),xe=kr(D),Ve=/auto|scroll/,de=se||Ve.test(xe.overflowX),ct=se||Ve.test(xe.overflowY),Ge=de&&D.clientWidth>0&&D.scrollWidth>D.clientWidth,rt=ct&&D.clientHeight>0&&D.scrollHeight>D.clientHeight,he=xe.direction==="rtl",Ce=rt&&(he?L.offsetX<=D.offsetWidth-D.clientWidth:L.offsetX>D.clientWidth),Ae=Ge&&L.offsetY>D.clientHeight;if(Ce||Ae)return}let ne=(H=o.current.floatingContext)==null?void 0:H.nodeId,A=g&&Ba(g.nodesRef.current,ne).some(se=>{var xe;return Tg(L,(xe=se.context)==null?void 0:xe.elements.floating)});if(Tg(L,i.floating)||Tg(L,i.domReference)||A)return;let re=g?Ba(g.nodesRef.current,ne):[];if(re.length>0){let se=!0;if(re.forEach(xe=>{var Ve;if((Ve=xe.context)!=null&&Ve.open&&!xe.context.dataRef.current.__outsidePressBubbles){se=!1;return}}),!se)return}r(!1,L,"outside-press")}),V=Gn(L=>{var H;let I=()=>{var P;C(L),(P=Di(L))==null||P.removeEventListener(u,I)};(H=Di(L))==null||H.addEventListener(u,I)});Q.useEffect(()=>{if(!n||!s)return;o.current.__escapeKeyBubbles=T,o.current.__outsidePressBubbles=S;let L=-1;function H(_){r(!1,_,"ancestor-scroll")}function I(){window.clearTimeout(L),R.current=!0}function P(){L=window.setTimeout(()=>{R.current=!1},Ou()?5:0)}let D=Tn(i.floating);a&&(D.addEventListener("keydown",v?B:O,v),D.addEventListener("compositionstart",I),D.addEventListener("compositionend",P)),b&&D.addEventListener(u,x?V:C,x);let U=[];return d&&(pt(i.domReference)&&(U=Rr(i.domReference)),pt(i.floating)&&(U=U.concat(Rr(i.floating))),!pt(i.reference)&&i.reference&&i.reference.contextElement&&(U=U.concat(Rr(i.reference.contextElement)))),U=U.filter(_=>{var te;return _!==((te=D.defaultView)==null?void 0:te.visualViewport)}),U.forEach(_=>{_.addEventListener("scroll",H)}),()=>{a&&(D.removeEventListener("keydown",v?B:O,v),D.removeEventListener("compositionstart",I),D.removeEventListener("compositionend",P)),b&&D.removeEventListener(u,x?V:C,x),U.forEach(_=>{_.removeEventListener("scroll",H)}),window.clearTimeout(L)}},[o,i,a,b,u,n,r,d,s,T,S,O,v,B,C,x,V]),Q.useEffect(()=>{o.current.insideReactTree=!1},[o,b,u]);let Y=Q.useMemo(()=>({onKeyDown:O,...c&&{[PQ[f]]:L=>{r(!1,L.nativeEvent,"reference-press")},...f!=="click"&&{onClick(L){r(!1,L.nativeEvent,"reference-press")}}}}),[O,r,c,f]),q=Q.useMemo(()=>{function L(H){H.button===0&&(E.current=!0)}return{onKeyDown:O,onMouseDown:L,onMouseUp:L,[BQ[u]]:()=>{o.current.insideReactTree=!0}}},[O,u,o]);return Q.useMemo(()=>s?{reference:Y,floating:q}:{},[s,Y,q])}function UQ(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=mx(),o=Q.useRef({}),[s]=Q.useState(()=>_Q()),a=gx()!=null,[l,u]=Q.useState(r.reference),c=Gn((p,h,g)=>{o.current.openEvent=p?h:void 0,s.emit("openchange",{open:p,event:h,reason:g,nested:a}),n?.(p,h,g)}),f=Q.useMemo(()=>({setPositionReference:u}),[]),d=Q.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return Q.useMemo(()=>({dataRef:o,open:t,onOpenChange:c,elements:d,events:s,floatingId:i,refs:f}),[t,c,d,s,i,f])}function K3(e){var t,n;let{elements:r,...i}=e===void 0?{}:e,{nodeId:o}=i,s=UQ({...i,elements:{reference:(t=r?.reference)!=null?t:null,floating:(n=r?.floating)!=null?n:null}}),a=i.rootContext||s,l=a.elements,[u,c]=Q.useState(null),[f,d]=Q.useState(null),h=l?.domReference||u,g=Q.useRef(null),y=Dg();Vn(()=>{h&&(g.current=h)},[h]);let b=x3({...i,elements:{...l,...f&&{reference:f}}}),E=Q.useCallback(R=>{let O=pt(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(O),b.refs.setReference(O)},[b.refs]),T=Q.useCallback(R=>{(pt(R)||R===null)&&(g.current=R,c(R)),(pt(b.refs.reference.current)||b.refs.reference.current===null||R!==null&&!pt(R))&&b.refs.setReference(R)},[b.refs]),S=Q.useMemo(()=>({...b.refs,setReference:T,setPositionReference:E,domReference:g}),[b.refs,T,E]),v=Q.useMemo(()=>({...b.elements,domReference:h}),[b.elements,h]),x=Q.useMemo(()=>({...b,...a,refs:S,elements:v,nodeId:o}),[b,S,v,o,a]);return Vn(()=>{a.dataRef.current.floatingContext=x;let R=y?.nodesRef.current.find(O=>O.id===o);R&&(R.context=x)}),Q.useMemo(()=>({...b,context:x,refs:S,elements:v}),[b,S,v,x])}function dx(){return $L()&&QS()}function Y3(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:o,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,u=Q.useRef(!1),c=Q.useRef(-1),f=Q.useRef(!0);Q.useEffect(()=>{if(!a)return;let p=yn(s.domReference);function h(){!n&&Ut(s.domReference)&&s.domReference===So(Tn(s.domReference))&&(u.current=!0)}function g(){f.current=!0}function y(){f.current=!1}return p.addEventListener("blur",h),dx()&&(p.addEventListener("keydown",g,!0),p.addEventListener("pointerdown",y,!0)),()=>{p.removeEventListener("blur",h),dx()&&(p.removeEventListener("keydown",g,!0),p.removeEventListener("pointerdown",y,!0))}},[s.domReference,n,a]),Q.useEffect(()=>{if(!a)return;function p(h){let{reason:g}=h;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return i.on("openchange",p),()=>{i.off("openchange",p)}},[i,a]),Q.useEffect(()=>()=>{Mr(c)},[]);let d=Q.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(p){if(u.current)return;let h=Di(p.nativeEvent);if(l&&pt(h)){if(dx()&&!p.relatedTarget){if(!f.current&&!Sg(h))return}else if(!XL(h))return}r(!0,p.nativeEvent,"focus")},onBlur(p){u.current=!1;let h=p.relatedTarget,g=p.nativeEvent,y=pt(h)&&h.hasAttribute(Fa("focus-guard"))&&h.getAttribute("data-type")==="outside";c.current=window.setTimeout(()=>{var b;let E=So(s.domReference?s.domReference.ownerDocument:document);!h&&E===s.domReference||En((b=o.current.floatingContext)==null?void 0:b.refs.floating.current,E)||En(s.domReference,E)||y||r(!1,g,"focus")})}}),[o,s.domReference,r,l]);return Q.useMemo(()=>a?{reference:d}:{},[a,d])}function px(e,t,n){let r=new Map,i=n==="item",o=e;if(i&&e){let{[_3]:s,[v3]:a,...l}=e;o=l}return{...n==="floating"&&{tabIndex:-1,[dQ]:""},...o,...t.map(s=>{let a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[u,c]=l;if(!(i&&[_3,v3].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var f;(f=r.get(u))==null||f.push(c),s[u]=function(){for(var d,p=arguments.length,h=new Array(p),g=0;gy(...h)).find(y=>y!==void 0)}}}else s[u]=c}),s),{})}}function $3(e){e===void 0&&(e=[]);let t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),i=Q.useCallback(a=>px(a,e,"reference"),t),o=Q.useCallback(a=>px(a,e,"floating"),n),s=Q.useCallback(a=>px(a,e,"item"),r);return Q.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:s}),[i,o,s])}var FQ=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function W3(e,t){var n,r;t===void 0&&(t={});let{open:i,elements:o,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,u=mx(),c=((n=o.domReference)==null?void 0:n.id)||u,f=Q.useMemo(()=>{var E;return((E=xg(o.floating))==null?void 0:E.id)||s},[o.floating,s]),d=(r=FQ.get(l))!=null?r:l,h=gx()!=null,g=Q.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:i?f:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":i?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:c},...d==="menu"&&h&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,h,i,c,l]),y=Q.useMemo(()=>{let E={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?E:{...E,...d==="menu"&&{"aria-labelledby":c}}},[d,f,c,l]),b=Q.useCallback(E=>{let{active:T,selected:S}=E,v={role:"option",...T&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...v,"aria-selected":S}}return{}},[f,l]);return Q.useMemo(()=>a?{reference:g,floating:y,item:b}:{},[a,g,y,b])}var Mn=G(fe(),1);function Vu(e){try{return new URL(e).hostname||e}catch{return e}}function j3(e){return e.filter(t=>t.citation!=null).map(t=>({url:t.url??"",domain:t.label??Vu(t.url??""),title:t.citation?.title})).filter(t=>t.url!=="")}function X3(e){let t=new Map;for(let n of e){let r=t.get(n.url);r?!r.title&&n.title&&(r.title=n.title):t.set(n.url,{...n})}return[...t.values()]}var Ex=G(ie(),1),Q3=(0,Mn.createContext)(null),Z3=(0,Mn.createContext)([]);function J3({children:e}){let t=(0,Mn.useRef)(new Map),[n,r]=(0,Mn.useState)([]),i=(0,Mn.useCallback)(()=>{let l=[];for(let u of t.current.values())l.push(...u);r(X3(l))},[]),o=(0,Mn.useCallback)((l,u)=>{t.current.set(l,u),i()},[i]),s=(0,Mn.useCallback)(l=>{t.current.delete(l)&&i()},[i]),a=(0,Mn.useMemo)(()=>({register:o,unregister:s}),[o,s]);return(0,Ex.jsx)(Q3.Provider,{value:a,children:(0,Ex.jsx)(Z3.Provider,{value:n,children:e})})}function e6(){return(0,Mn.useContext)(Q3)}function t6(){return(0,Mn.useContext)(Z3)}function Pg(e){let t={};if(!(e instanceof HTMLElement))return{style:t};let n=getComputedStyle(e);for(let i=0;it.type==="text"?t.value:t.type==="element"?r6(t):"").join("")}function qQ(e){return e?(e.children??[]).filter(t=>t.type==="element"&&t.tagName==="shiny-aside").map(t=>{let n=fd(t,"url"),r=fd(t,"label"),i=r6(t).trim(),o=t.properties?.dataCitation==null?void 0:{title:i===""||i===n?void 0:i,cited_quote:fd(t,"cited-quote")};return{label:r??(o&&n?Vu(n):void 0),url:n,icon:fd(t,"icon"),body:t.children.length>0?bf(t.children):void 0,index:zQ(t,"index"),citation:o,groundingId:fd(t,"dataGroundingId")}}):[]}function Sx(e){try{return`https://icons.duckduckgo.com/ip3/${encodeURIComponent(new URL(e).hostname)}.ico`}catch{return}}function Tx({entry:e,deriveFavicon:t}){let n=e.icon||(t&&e.url?Sx(e.url):void 0),[r,i]=(0,Or.useState)(null);return!n||r===n?null:(0,qe.jsx)("img",{src:n,alt:"",onError:()=>i(n)})}function n6({direction:e}){return(0,qe.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",style:e==="prev"?{transform:"scaleX(-1)"}:void 0,children:(0,qe.jsx)("path",{d:"M4.5 2.5L8 6L4.5 9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var i6=(0,Or.memo)(function({node:t}){let n=qQ(t),r=t?.properties?.[Uf]!=null;return(0,qe.jsx)(VQ,{entries:n,pending:r})}),VQ=(0,Or.memo)(function({entries:t,pending:n=!1}){let r=ou(),i=t.findIndex(O=>O.label),[o,s]=(0,Or.useState)(!1),[a,l]=(0,Or.useState)(0),u=e6(),c=(0,Or.useId)(),f=n?"":JSON.stringify(j3(t)),d=t[a]?.groundingId,{refs:p,floatingStyles:h,context:g,getReferenceProps:y,getFloatingProps:b}=Bg(o,s);if((0,Or.useEffect)(()=>{if(!u||f==="")return;let O=JSON.parse(f);if(O.length!==0)return u.register(c,O),()=>u.unregister(c)},[u,c,f]),(0,Or.useEffect)(()=>{o&&l(i===-1?0:i)},[o,i]),(0,Or.useEffect)(()=>{if(!o||!d)return;let O=p.domReference.current;if(!(O instanceof HTMLElement))return;let B=O.closest("p, li");if(!B)return;let C=[...B.querySelectorAll("[data-aside-grounding]")].filter(V=>V.dataset.asideGrounding?.split(" ").includes(d));for(let V of C)V.dataset.active="";return()=>{for(let V of C)delete V.dataset.active}},[o,d,p.domReference]),n||t.length===0)return null;let E=t.length-1,T=i!==-1&&t.every(O=>O.label===t[i].label),S=E>0&&!T,v=t[a],x=Pg(p.domReference.current),R=i===-1?`Aside ${t[0].index}`:S?`${t[i].label} (+${E} more)`:t[i].label;return(0,qe.jsxs)("span",{className:"shiny-aside-group",children:[(0,qe.jsxs)("button",{ref:p.setReference,type:"button",className:i===-1?"shiny-aside-pill shiny-aside-pill--count":"shiny-aside-pill","aria-label":R,...y(),children:[i!==-1&&(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(Tx,{entry:t[i],deriveFavicon:r}),(0,qe.jsx)("span",{className:"shiny-aside-pill__label",children:t[i].label}),S&&(0,qe.jsxs)("span",{className:"shiny-aside-pill__overflow",children:["+",E]})]}),i===-1&&t[0].index]}),o&&(0,qe.jsx)(Ig,{children:(0,qe.jsx)(Lg,{context:g,modal:!1,initialFocus:-1,returnFocus:!0,children:(0,qe.jsxs)("div",{ref:p.setFloating,className:"shiny-aside-popover",style:{...x.style,...h},"data-bs-theme":x.theme,"aria-label":R,...b(),children:[t.length>1&&(0,qe.jsxs)("div",{className:"shiny-aside-popover__nav",children:[(0,qe.jsxs)("div",{className:"shiny-aside-popover__nav-arrows",children:[(0,qe.jsx)("button",{type:"button","aria-label":"Previous source",onClick:()=>l(O=>(O-1+t.length)%t.length),children:(0,qe.jsx)(n6,{direction:"prev"})}),(0,qe.jsx)("button",{type:"button","aria-label":"Next source",onClick:()=>l(O=>(O+1)%t.length),children:(0,qe.jsx)(n6,{direction:"next"})})]}),(0,qe.jsxs)("span",{className:"shiny-aside-popover__count","aria-hidden":"true",children:[a+1," / ",t.length]}),(0,qe.jsxs)("span",{className:"visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",children:["Source ",a+1," of ",t.length,":"," ",v.label??"Untitled source"]})]}),v.label&&(0,qe.jsx)(qe.Fragment,{children:v.url?(0,qe.jsxs)("a",{className:"shiny-aside-popover__label",href:v.url,...Ni,children:[(0,qe.jsx)(Tx,{entry:v,deriveFavicon:r}),(0,qe.jsx)("span",{className:"shiny-aside-popover__label-text",children:v.label})]}):(0,qe.jsxs)("div",{className:"shiny-aside-popover__label",children:[(0,qe.jsx)(Tx,{entry:v,deriveFavicon:r}),(0,qe.jsx)("span",{className:"shiny-aside-popover__label-text",children:v.label})]})}),v.body&&(0,qe.jsx)("div",{className:"shiny-aside-popover__body",children:(0,qe.jsx)(Kt,{content:v.body,contentType:"html",streaming:!1})})]})})})]})});var Ug=G(fe(),1);var xx=G(ie(),1);function o6({className:e,expanded:t}){return(0,xx.jsx)("svg",{className:e,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",...t?{"data-expanded":""}:{},children:(0,xx.jsx)("path",{d:"M4.5 2.5L8 6L4.5 9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var At=G(ie(),1);function dd(e,t){let n=e.properties?.[t];return typeof n=="string"?n:void 0}function s6(e){if(!e)return[];try{let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=new Set;return t.filter(r=>{if(!r||typeof r.url!="string")return!1;let i=r.url;return n.has(i)?!1:(n.add(i),!0)})}catch{return[]}}function GQ(e){if(!e)return[];let t=s6(dd(e,"citedSources")),n=(e.children??[]).filter(o=>o.type==="element"),r=[],i=[];for(let o of n)if(o.tagName==="shiny-web-search"){let s={kind:"search",query:dd(o,"query")??"",sources:null,citedSources:[]};r.push(s),i.push(s)}else if(o.tagName==="shiny-web-search-results"){let s=s6(dd(o,"sources")),a=i.shift();a?a.sources=s:r.push({kind:"search",query:"",sources:s,citedSources:[]})}else if(o.tagName==="shiny-web-fetch"){let s=dd(o,"url");s&&r.push({kind:"fetch",url:s,status:dd(o,"status")})}for(let o=r.length-1;o>=0;o-=1){let s=r[o];if(s.kind==="search"&&s.sources===null){s.citedSources=t;break}}return r}function KQ(e){return e.domain||Vu(e.url)}function YQ(e){return`https://icons.duckduckgo.com/ip3/${encodeURIComponent(e)}.ico`}var a6=(0,Ug.memo)(function({node:t}){let[n,r]=(0,Ug.useState)(!1),i=ou(),o=GQ(t);if(o.length===0)return null;let s=o.some(a=>a.kind==="search")?"Searched the web":"Read the web";return(0,At.jsxs)("div",{className:"shiny-web-activity",children:[(0,At.jsxs)("button",{className:"shiny-web-activity__header","aria-expanded":n,onClick:()=>r(a=>!a),children:[(0,At.jsx)(o6,{className:"shiny-web-activity__chevron",expanded:n}),s]}),n&&(0,At.jsx)("div",{className:"shiny-web-activity__timeline",children:o.map((a,l)=>a.kind==="search"?(0,At.jsx)("div",{className:"shiny-web-activity__node shiny-web-activity__search",children:(()=>{let u=a.sources??a.citedSources,c=a.sources===null&&a.citedSources.length>0;return(0,At.jsxs)(At.Fragment,{children:[(0,At.jsxs)("div",{className:"shiny-web-activity__qrow",children:[(0,At.jsx)("span",{className:"shiny-web-activity__query",children:a.query}),a.sources!==null&&a.sources.length>0&&(0,At.jsxs)("span",{className:"shiny-web-activity__count",children:[a.sources.length," result",a.sources.length!==1?"s":""]}),c&&(0,At.jsx)("span",{className:"shiny-web-activity__count",children:"Cited sources"})]}),u.length>0&&(0,At.jsx)("div",{className:"shiny-web-activity__results",children:u.map((f,d)=>{let p=KQ(f),h=gm(f.url);return(0,At.jsxs)(h?"a":"span",{className:"shiny-web-activity__result",...h?{href:f.url,...Ni}:{},children:[i&&(0,At.jsx)("img",{className:"shiny-web-activity__fav",src:YQ(p),alt:"",loading:"lazy",onError:y=>{y.currentTarget.style.visibility="hidden"}}),(0,At.jsx)("span",{className:"shiny-web-activity__title",children:f.title||p}),(0,At.jsx)("span",{className:"shiny-web-activity__domain",children:p})]},f.url)})})]})})()},`search-${l}-${a.query}`):(0,At.jsxs)("div",{className:"shiny-web-activity__node shiny-web-activity__fetch",children:[(0,At.jsx)("span",{className:"shiny-web-activity__fetch-label",children:"Read"}),a.status!=="error"&&gm(a.url)?(0,At.jsx)("a",{href:a.url,...Ni,children:a.url}):(0,At.jsx)("span",{children:a.url}),(0,At.jsx)("span",{className:`shiny-web-activity__status shiny-web-activity__status--${a.status==="error"?"error":"ok"}`,"aria-label":a.status==="error"?"failed":"succeeded",children:a.status==="error"?"\u2717":"\u2713"})]},`fetch-${l}-${a.url}`))})]})});var Gu={"shiny-tool-request":CL,"shiny-tool-result":AL,"shiny-aside":nd,"shiny-aside-group":i6,"shiny-web-activity":a6,"shiny-web-search":nd,"shiny-web-search-results":nd,"shiny-web-fetch":nd};var Ha=G(fe(),1);var Fg=G(fe(),1);function Ku(){let[e,t]=(0,Fg.useState)(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return(0,Fg.useEffect)(()=>{let n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=i=>t(i.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}var $Q=200;function _x(e,t){let n=Ku(),[r,i]=(0,Ha.useState)({key:t,value:e}),[o,s]=(0,Ha.useState)(!1),a=(0,Ha.useRef)({key:t,value:e});return(0,Ha.useLayoutEffect)(()=>{if(a.current={key:t,value:e},t===r.key)return;if(n){i({key:t,value:e}),s(!1);return}s(!0);let l=setTimeout(()=>{i(a.current),s(!1)},$Q);return()=>clearTimeout(l)},[t,e,r.key,n]),{visible:r.value,fading:o}}function l6(e){return _x(e,e)}var ur=G(ie(),1),WQ={__html:Ru},u6=2500;function jQ(e){let[t,n]=(0,on.useState)(null),r=(0,on.useRef)(0),i=(0,on.useRef)(null),o=(0,on.useRef)(null);return(0,on.useEffect)(()=>{if(!e)return;let s=Date.now(),a=s-r.current;if(a>=u6||!t)n(e),r.current=s,i.current=null;else if(i.current=e,!o.current){let l=u6-a;o.current=setTimeout(()=>{o.current=null,i.current&&(n(i.current),r.current=Date.now(),i.current=null)},l)}return()=>{o.current&&(clearTimeout(o.current),o.current=null)}},[e,t]),t}function XQ(){return(0,ur.jsx)("span",{className:"shiny-chat-thinking-glyph","aria-hidden":"true"})}var c6=(0,on.memo)(function({thinking:t,messageId:n}){let[r,i]=(0,on.useState)(!1),[o,s]=(0,on.useState)(!1),a=(0,on.useRef)(t.streaming),l=wR(),{scrollRef:u,contentRef:c,scrollToBottom:f}=Ph({resize:"smooth"}),d=(0,on.useRef)(!1);(0,on.useEffect)(()=>{let E=u.current;if(!E||!r||!t.streaming)return;let T=E.scrollHeight>E.clientHeight;T&&!d.current&&f(),d.current=T},[t.content,r,t.streaming,f,u]);let p=jQ(t.streaming?t.topic:null);(0,on.useEffect)(()=>{if(a.current&&!t.streaming){if(!o){let E=setTimeout(()=>i(!1),600);return()=>clearTimeout(E)}a.current=t.streaming}a.current=t.streaming},[t.streaming,o]);let h=(0,on.useCallback)(()=>{i(E=>(E?l?.():t.streaming&&(d.current=!1,f()),!E)),t.streaming||s(!0)},[t.streaming,l,f]),g=QQ(t,p),{visible:y,fading:b}=l6(g);return!t.streaming&&!t.content.trim()?null:(0,ur.jsxs)("div",{className:"shiny-chat-thinking","data-streaming":t.streaming||void 0,children:[(0,ur.jsxs)("button",{id:`thinking-header-${n}`,className:"shiny-chat-thinking-header",onClick:h,"aria-expanded":r,"aria-controls":`thinking-content-${n}`,children:[(0,ur.jsx)(XQ,{}),(0,ur.jsx)("span",{className:"shiny-chat-thinking-label","data-fading":b||void 0,children:y}),t.streaming&&(0,ur.jsx)("svg",{className:"shiny-chat-thinking-dot",width:"8",height:"8",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,ur.jsx)("circle",{cx:"4",cy:"4",r:"4"})}),(0,ur.jsx)("span",{className:"shiny-chat-thinking-disclosure",dangerouslySetInnerHTML:WQ})]}),(0,ur.jsx)("div",{className:"shiny-chat-thinking-content",id:`thinking-content-${n}`,role:"region","aria-labelledby":`thinking-header-${n}`,"aria-hidden":r?void 0:"true",inert:!r||void 0,"data-expanded":r||void 0,children:(0,ur.jsx)("div",{className:"shiny-chat-thinking-content-inner",ref:u,children:(0,ur.jsx)("div",{ref:c,children:(0,ur.jsx)(Kt,{content:t.content,contentType:"markdown",role:"assistant",streaming:t.streaming,tagToComponentMap:Gu})})})})]})});function QQ(e,t){if(e.streaming)return t??"Thinking";if(e.durationMs!=null){let n=Math.round(e.durationMs/1e3);return n<1?"Thought for less than a second":`Thought for ${n}s`}return"Thinking"}var Dr=G(fe(),1);function f6(e){return e.customDisplay===!0&&e.status!=="running"}var d6=40;function ZQ(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;let n=[];for(let[i,o]of Object.entries(t))if(!(i.startsWith("_")||i.startsWith("."))&&(typeof o=="string"||typeof o=="number"||typeof o=="boolean")&&(n.push(`${i}: ${o}`),n.length===3))break;if(n.length===0)return null;let r=n.join(", ");return r.length>d6?`${r.slice(0,d6-1)}\u2026`:r}function vx(e,t,n){if(e.label)return{text:e.label};if(!n&&e.title&&e.title!==t)return{text:e.title};if(n&&t)return null;let r=ZQ(e.arguments);return r?{text:r,code:!0}:n?null:{text:e.toolName,code:!0}}function JQ(e){if(!(!e.icon||e.icon===e.definitionIcon))return e.icon}function p6(e,t){if(e.status==="running")return{kind:"status",status:"running"};let n=JQ(e);if(n)return{kind:"icon",icon:n};if(t){let r=e.icon||e.definitionIcon;if(r)return{kind:"icon",icon:r}}return{kind:"status",status:e.status}}function h6(e){return e.anyRunning?{kind:"status",status:"running"}:e.heterogeneous?{kind:"default"}:e.identity.icon?{kind:"icon",icon:e.identity.icon}:{kind:"default"}}function m6(e,t){return{title:e.title,verb:t?e.settled?"Used ":"Using ":"",toolName:e.toolName}}function g6(e){return e.title!=null?`title:${e.title}`:`tool:${e.verb}|${e.toolName}`}var eZ=60,tZ=3;function nZ(e){return(e.title?e.title.replace(/<[^>]*>/g,""):`Used ${e.toolName}`).length+(e.count>1?`\xD7${e.count}`.length:0)}function b6(e){let t=[],n=0;for(let o of e){let s=nZ(o)+(t.length?2:0),a=t.length>=tZ||n+s>eZ;if(t.length&&a)break;t.push(o),n+=s}let r=e.length-t.length,i=t.some(o=>o.title!==void 0);return{shown:t.map((o,s)=>({segment:o,showVerb:i||s===0})),overflowText:r>0?`, and ${r} ${r===1?"other":"others"}`:null}}function y6(e){let t=e.calls.filter(i=>!f6(i)),n=e.calls.filter(f6).map(i=>({key:i.localId,call:i,value:i.value??"",valueType:i.valueType??"html",showRequest:!1})).sort((i,o)=>(i.call.resolveBlock??0)-(o.call.resolveBlock??0)||(i.call.resolveIndex??0)-(o.call.resolveIndex??0));if(t.length===0)return{row:null,standalonePayloads:n};let r=n.length===0?{title:e.title,titleSettled:e.titleSettled,icon:e.icon,count:e.count,segments:e.segments}:iu(t);return{row:{calls:t,identity:r,single:t.length===1?t[0]:null,anyRunning:t.some(i=>i.status==="running"),failedCount:t.filter(i=>i.status==="error").length,heterogeneous:r.segments.length>1,hasExpandedCall:t.some(i=>i.expanded),segmentTitles:new Map(r.segments.map(i=>[i.toolName,i.title]))},standalonePayloads:n}}var ve=G(ie(),1),rZ='
Running\u2026
',iZ='',T6={__html:Ru};function S6(e){let[t,n]=(0,Dr.useState)(e??!1),r=(0,Dr.useRef)(e??!1);return(0,Dr.useEffect)(()=>{e&&!r.current&&n(!0),r.current=e??!1},[e]),[t,n]}function oZ(e){return e==="running"?rZ:e==="error"?og:iZ}function x6(e){return e.kind==="icon"?e.icon:e.kind==="status"?oZ(e.status):sg}function _6(e,t){return e.status==="running"?(0,ve.jsx)(lg,{toolName:e.toolName,toolTitle:e.title??e.definitionTitle,intent:e.intent,arguments:e.arguments??"{}"}):(0,ve.jsx)(cg,{toolName:e.toolName,toolTitle:e.title??e.definitionTitle,intent:e.intent,status:e.status,value:e.value??"",valueType:e.valueType??"markdown",requestCall:e.requestCall,showRequest:e.showRequest,fullScreen:e.fullScreen,expanded:t||e.expanded,icon:e.icon,footer:e.footer,label:e.label})}function E6({segment:e,showVerb:t}){let n=m6(e,t),{visible:r,fading:i}=_x(n,g6(n)),o={className:"shiny-chat-tool-group__title","data-fading":i||void 0};return(0,ve.jsxs)(ve.Fragment,{children:[r.title!=null?(0,ve.jsx)("span",{...o,dangerouslySetInnerHTML:{__html:r.title}}):(0,ve.jsxs)("span",{...o,children:[r.verb,(0,ve.jsx)("code",{className:"shiny-chat-tool-group__toolname",children:r.toolName})]}),e.count>1&&(0,ve.jsx)("span",{className:"shiny-chat-tool-group__count","aria-label":`${e.count} calls`,children:`\xD7${e.count}`})]})}function sZ({segments:e}){if(e.length===1)return(0,ve.jsx)(E6,{segment:e[0],showVerb:!0});let{shown:t,overflowText:n}=b6(e);return(0,ve.jsxs)("span",{className:"shiny-chat-tool-group__segments",children:[t.map(({segment:r,showVerb:i},o)=>(0,ve.jsxs)(Dr.Fragment,{children:[o>0&&", ",(0,ve.jsx)("span",{className:"shiny-chat-tool-group__segment",children:(0,ve.jsx)(E6,{segment:r,showVerb:i})})]},r.toolName)),n&&(0,ve.jsx)("span",{className:"shiny-chat-tool-group__overflow",children:n})]})}function aZ({item:e,segmentTitle:t,heterogeneous:n}){let[r,i]=S6(e.expanded),o=vx(e,t,!1),s=e.status==="error"?" text-danger":e.status==="running"?" running":"",a=x6(p6(e,n)),l=`tool-call${(0,Dr.useId)()}`;return(0,ve.jsxs)("li",{className:"shiny-chat-tool-call-row",role:"listitem",children:[(0,ve.jsxs)("button",{type:"button",className:"shiny-chat-tool-call-row__summary","aria-expanded":r,"aria-controls":l,onClick:()=>i(u=>!u),children:[(0,ve.jsx)("span",{className:`shiny-chat-tool-call-row__status${s}`,dangerouslySetInnerHTML:{__html:a}}),o&&(0,ve.jsx)("span",{className:"shiny-chat-tool-call-row__label",children:o.code?(0,ve.jsx)("code",{children:o.text}):o.text}),(0,ve.jsx)("span",{className:"shiny-chat-tool-spacer"}),r&&e.intent&&(0,ve.jsx)("span",{className:"shiny-chat-tool-row__intent",children:e.intent}),e.valuePreview&&(0,ve.jsx)("span",{className:"shiny-chat-tool-call-row__preview",children:e.valuePreview}),e.status==="error"&&(0,ve.jsx)("span",{className:"shiny-chat-tool-group__failed",children:"failed"}),(0,ve.jsx)("span",{className:"shiny-chat-tool-call-row__chevron",dangerouslySetInnerHTML:T6})]}),(0,ve.jsx)("div",{id:l,className:"shiny-chat-tool-call-row__detail",hidden:!r,children:r&&_6(e,!0)})]})}var v6=(0,Dr.memo)(function({group:t}){let{row:n,standalonePayloads:r}=y6(t),[i,o]=S6(n?.hasExpandedCall),s=`tool-group${(0,Dr.useId)()}`;return(0,ve.jsxs)(ve.Fragment,{children:[n&&(0,ve.jsx)(lZ,{row:n,expanded:i,setExpanded:o,bodyId:s}),r.map(a=>(0,ve.jsx)("div",{className:"shiny-chat-tool-custom-display",children:(0,ve.jsx)(FS,{value:a.value,valueType:a.valueType,showRequest:a.showRequest})},a.key))]})});function lZ({row:e,expanded:t,setExpanded:n,bodyId:r}){let{identity:i,single:o,anyRunning:s,failedCount:a,heterogeneous:l}=e,u=o&&vx(o,i.title,!0),c=x6(h6(e));return(0,ve.jsxs)("div",{className:`shiny-chat-tool-group shiny-chat-tool-group--${o?"single":"multi"}`,children:[(0,ve.jsxs)("button",{type:"button",className:"shiny-chat-tool-group__row","aria-expanded":t,"aria-controls":r,onClick:()=>n(f=>!f),children:[(0,ve.jsx)("span",{className:`shiny-chat-tool-group__glyph${s?" running":""}`,dangerouslySetInnerHTML:{__html:c}}),(0,ve.jsxs)("span",{className:"shiny-chat-tool-group__titlewrap",children:[(0,ve.jsx)(sZ,{segments:i.segments}),u&&(0,ve.jsxs)("span",{className:"shiny-chat-tool-group__label",children:[": ",u.code?(0,ve.jsx)("code",{children:u.text}):u.text]})]}),(0,ve.jsx)("span",{className:"shiny-chat-tool-spacer"}),o&&t&&o.intent&&(0,ve.jsx)("span",{className:"shiny-chat-tool-row__intent",children:o.intent}),o?.valuePreview&&(0,ve.jsx)("span",{className:"shiny-chat-tool-call-row__preview",children:o.valuePreview}),a>0&&(0,ve.jsx)("span",{className:"shiny-chat-tool-group__failed",children:o?"failed":`${a} failed`}),(0,ve.jsx)("span",{className:"shiny-chat-tool-group__chevron",dangerouslySetInnerHTML:T6})]}),o?(0,ve.jsx)("div",{id:r,className:"shiny-chat-tool-call-row__detail",hidden:!t,children:t&&_6(o,!0)}):(0,ve.jsx)("ul",{id:r,className:"shiny-chat-tool-group__calls",role:"list",hidden:!t,children:e.calls.map(f=>(0,ve.jsx)(aZ,{item:f,segmentTitle:e.segmentTitles.get(f.toolName),heterogeneous:l},f.localId))})]})}var A6=G(ie(),1);function C6({name:e}){return(0,A6.jsxs)("span",{className:"command-chip",children:["/",e]})}var Hg={image_types:["image/png","image/jpeg","image/gif","image/webp"],pdf_type:"application/pdf",text_extensions:{md:"text/markdown",markdown:"text/markdown",txt:"text/plain",csv:"text/csv",json:"application/json",py:"text/x-python",js:"text/javascript",ts:"text/typescript",r:"text/x-r",yaml:"text/yaml",yml:"text/yaml",toml:"text/x-toml",qmd:"text/markdown",rmd:"text/markdown",ipynb:"application/x-ipynb+json",rst:"text/x-rst",tex:"text/x-tex",sql:"text/x-sql",sh:"text/x-sh",html:"text/html",htm:"text/html",css:"text/css",xml:"application/xml",ini:"text/x-ini",cfg:"text/x-ini",log:"text/plain"}};var N6=new TextDecoder("utf-8"),cZ=Hg.image_types,Cx=Hg.pdf_type,Ax=Hg.text_extensions,w6=Array.from(new Set(Object.values(Ax))),Nx={"image/png":{family:"image",downscale:!0},"image/jpeg":{family:"image",downscale:!0},"image/gif":{family:"image",downscale:!0},"image/webp":{family:"image",downscale:!0},[Cx]:{family:"document",downscale:!1},...Object.fromEntries(w6.map(e=>[e,{family:"text",downscale:!1}]))},R6=Object.keys(Nx);function k6(e){let t=new Set(e);for(let[n,r]of Object.entries(Ax))t.has(r)&&t.add(`.${n}`);return[...t].join(",")}var fZ=1568;function za(e){return Nx[e]?.family??null}function M6(e){return cZ.includes(e)}function dZ(e,t,n){let r=Math.max(e,t);if(r<=n)return null;let i=n/r;return{width:Math.round(e*i),height:Math.round(t*i)}}var O6=300,D6=1e3;function wx(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r=999.95&&rt+n.size,0)}function pZ(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}async function hZ(e,t){if(typeof document>"u"||typeof Image>"u")return{dataUrl:e,wasDownscaled:!1};let n=await new Promise(a=>{let l=new Image;l.onload=()=>a(l),l.onerror=()=>a(null),l.src=e});if(!n||!n.naturalWidth||!n.naturalHeight)return{dataUrl:e,wasDownscaled:!1};let r=dZ(n.naturalWidth,n.naturalHeight,fZ);if(!r)return{dataUrl:e,wasDownscaled:!1};let i=document.createElement("canvas");i.width=r.width,i.height=r.height;let o=i.getContext("2d");if(!o)return{dataUrl:e,wasDownscaled:!1};o.drawImage(n,0,0,r.width,r.height);let s=t==="image/gif"?"image/png":t;return{dataUrl:i.toDataURL(s),wasDownscaled:!0}}function U6(e){let t=e.lastIndexOf(".");return t<=0?"":e.slice(t+1).toLowerCase()}function qg(e,t){let n=U6(e);return n?n.toUpperCase():t===Cx?"PDF":"FILE"}function F6(e){return new File([e],"Pasted Text",{type:"text/plain"})}function mZ(e){if(M6(e.type)||e.type===Cx)return e.type;let t=U6(e.name);return t?Ax[t]??null:w6.includes(e.type)?e.type:null}async function H6(e,t){let n=mZ(e);if(n===null||!t.includes(n))return null;let r=za(n);if(r===null)return null;let i=Nx[n],o=await pZ(e);if(i?.downscale&&M6(n)){let{dataUrl:s,wasDownscaled:a}=await hZ(o,n),l=a&&n==="image/gif"?"image/png":n;return{file:{id:Yr(),type:l,family:r,dataUrl:s,name:e.name,size:zg(s)},wasDownscaled:a,wasConverted:l!==n}}return{file:{id:Yr(),type:n,family:r,dataUrl:o,name:e.name,size:zg(o)},wasDownscaled:!1,wasConverted:!1}}var Vg=G(fe(),1);var Rs=G(ie(),1),Gg=(0,Vg.memo)(function({dataUrl:t,name:n,size:r,onRemove:i,onActivate:o,rootRef:s,rootProps:a}){let l=(0,Vg.useMemo)(()=>I6(t,O6).trim(),[t]);return(0,Rs.jsxs)("div",{ref:s,className:"shiny-chat-text-preview",title:n||void 0,...a,...o?{role:"button",tabIndex:0,onClick:o,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())}}:void 0,children:[(0,Rs.jsx)("div",{className:"shiny-chat-text-preview-body",children:l||"(empty file)"}),(0,Rs.jsxs)("div",{className:"shiny-chat-text-preview-footer",children:[n&&(0,Rs.jsx)("span",{className:"shiny-chat-text-preview-name",children:n}),(0,Rs.jsx)("span",{className:"shiny-chat-text-preview-size",children:pd(r)})]}),i&&(0,Rs.jsx)("button",{type:"button",tabIndex:0,"aria-label":n?`Remove ${n}`:"Remove attachment",onClick:i,children:"\xD7"})]})});var cr=G(fe(),1),q6=G(qi(),1);var xo=G(ie(),1),z6='button, [tabindex="0"], a[href], input, select, textarea, iframe';function V6({src:e,name:t,mime:n,onClose:r}){let i=za(n),o=i==="image",s=i==="text",[a,l]=(0,cr.useState)(null),u=(0,cr.useRef)(null),c=(0,cr.useRef)(null),f=(0,cr.useMemo)(()=>s?L6(e):"",[s,e]);(0,cr.useLayoutEffect)(()=>{c.current=document.activeElement instanceof HTMLElement?document.activeElement:null,u.current?.querySelector(z6)?.focus()},[]),(0,cr.useEffect)(()=>{let p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p,c.current?.focus()}},[]);let d=(0,cr.useCallback)(p=>{if(p.key==="Escape"){r();return}if(p.key!=="Tab")return;let h=u.current;if(!h)return;let g=h.querySelectorAll(z6);if(g.length===0)return;let y=g[0],b=g[g.length-1];p.shiftKey&&document.activeElement===y?(p.preventDefault(),b.focus()):!p.shiftKey&&document.activeElement===b&&(p.preventDefault(),y.focus())},[r]);return(0,cr.useEffect)(()=>{if(o||s)return;let p=URL.createObjectURL(P6(e));return l(p),()=>URL.revokeObjectURL(p)},[e,o,s]),(0,q6.createPortal)((0,xo.jsxs)("div",{ref:u,className:"shiny-chat-lightbox",role:"dialog","aria-modal":"true","aria-label":t||"Attachment preview",onClick:r,onKeyDown:d,children:[(0,xo.jsxs)("div",{className:"shiny-chat-lightbox-content",onClick:p=>p.stopPropagation(),children:[o?(0,xo.jsx)("img",{className:"shiny-chat-lightbox-img",src:e,alt:t||"Attached image"}):s?(0,xo.jsx)("pre",{className:"shiny-chat-lightbox-text",tabIndex:0,"aria-label":t||"File content",children:f||"(empty file)"}):a&&(0,xo.jsx)("iframe",{className:"shiny-chat-lightbox-frame",src:a,title:t||"PDF preview"}),t&&(0,xo.jsx)("div",{className:"shiny-chat-lightbox-name",children:t})]}),(0,xo.jsx)("button",{type:"button",className:"shiny-chat-lightbox-close","aria-label":"Close preview",onClick:r,children:"\xD7"})]}),document.body)}var mr=G(fe(),1);var B0=G(fe(),1),Us=G(fe(),1),y5=G(qi(),1),E5=G(Kg(),1),Io=G(ie(),1);function On(e){this.content=e}On.prototype={constructor:On,find:function(e){for(var t=0;t>1}};On.from=function(e){if(e instanceof On)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new On(t)};var kx=On;function nP(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){let s=i.text,a=o.text,l=0;for(;s[l]==a[l];l++)n++;return l&&l0&&d>0&&u[f-1]==c[d-1];)f--,d--,n--,r--;return f&&d&&f=56320&&e<57344}function oP(e){return e>=55296&&e<56320}var J=class e{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;rt&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,t-c),Math.min(l.content.size,n-c),r,i+c)}a=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",s=!0;return this.nodesBetween(t,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(t,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);ot)for(let o=0,s=0;st&&((sn)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,o)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=t)return o==t?Yg(n+1,o):Yg(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;nr.type.rank-i.type.rank),n}};$e.none=[];var Ga=class extends Error{},le=class e{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=aP(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(sP(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new e(J.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new e(t,r,i)}};le.empty=new le(J.empty,0,0);function sP(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(sP(o.content,t-i-1,n-i-1)))}function aP(e,t,n,r,i,o){let{index:s,offset:a}=e.findIndex(t),l=e.maybeChild(s);if(a==t||l.isText)return o&&r<=0&&i<=0&&!o.canReplace(s,s,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=aP(l.content,t-a-1,n,s==0?r-1:0,s==e.childCount-1?i-1:0,l);return u&&e.replaceChild(s,l.copy(u))}function CZ(e,t,n){if(n.openStart>e.depth)throw new Ga("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Ga("Inconsistent open depths");return lP(e,t,n,0)}function lP(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function hd(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(qa(e.nodeAfter,r),o++));for(let a=o;ai&&Ox(e,t,i+1),s=r.depth>i&&Ox(n,r,i+1),a=[];return hd(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(uP(o,s),qa(Va(o,cP(e,t,n,r,i+1)),a)):(o&&qa(Va(o,Xg(e,t,i+1)),a),hd(t,n,i,a),s&&qa(Va(s,Xg(n,r,i+1)),a)),hd(r,null,i,a),new J(a)}function Xg(e,t,n){let r=[];if(hd(null,e,n,r),e.depth>n){let i=Ox(e,t,n+1);qa(Va(i,Xg(e,t,n+1)),r)}return hd(t,null,n,r),new J(r)}function AZ(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(J.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}var Qg=class e{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ka(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new e(n,r,o)}static resolveCached(t,n){let r=$6.get(t);if(r)for(let o=0;ot&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),fP(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=J.empty,i=0,o=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=J.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};fr.prototype.text=void 0;var Ix=class e extends fr{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):fP(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}};function fP(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var Ya=class e{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Lx(t,n);if(r.next==null)return e.empty;let i=dP(r);r.next&&r.err("Unexpected trailing text");let o=LZ(IZ(i));return PZ(o,r),o}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(r.next[s].next);return o}).join(` -`)}};Ya.empty=new Ya(!0);var Lx=class{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}};function dP(e){let t=[];do t.push(RZ(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function RZ(e){let t=[];do t.push(kZ(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function kZ(e){let t=DZ(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=MZ(e,t);else break;return t}function W6(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function MZ(e,t){let n=W6(e),r=n;return e.eat(",")&&(e.next!="}"?r=W6(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function OZ(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(t)&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function DZ(e){if(e.eat("(")){let t=dP(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=OZ(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function IZ(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,l){let u={term:l,to:a};return t[s].push(u),u}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;i(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u{e[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=t[r.join(",")]=new Ya(r.indexOf(e.length-1)>-1);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:mP(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new fr(this,this.computeAttrs(t),J.from(n),$e.setFrom(r))}createChecked(t=null,n,r){return n=J.from(n),this.checkContent(n),new fr(this,this.computeAttrs(t),n,$e.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=J.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(J.empty,!0);return o?new fr(this,t,n.append(o),$e.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;nr[o]=new e(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function BZ(e,t,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}var Px=class{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?BZ(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}},gd=class e{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=bP(t,i.attrs),this.excluded=null;let o=hP(this.attrs);this.instance=o?new $e(this,o):null}create(t=null){return!t&&this.instance?this.instance:new $e(this,mP(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,s)=>r[o]=new e(o,i++,n,s)),r}removeFromSet(t){for(var n=0;n-1}},Wu=class{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=kx.from(t.nodes),n.marks=kx.from(t.marks||{}),this.nodes=Zg.compile(this.spec.nodes,this),this.marks=gd.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Ya.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?X6(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:X6(this,s.split(" "))}this.nodeFromJSON=i=>fr.fromJSON(this,i),this.markFromJSON=i=>$e.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof Zg){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Ix(r,r.defaultAttrs,t,$e.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}};function X6(e,t){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function UZ(e){return e.tag!=null}function FZ(e){return e.style!=null}var Ii=class e{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(UZ(i))this.tags.push(i);else if(FZ(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=t.nodes[i.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new Jg(this,n,!1);return r.addAll(t,$e.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new Jg(this,n,!0);return r.addAll(t,$e.none,n.from,n.to),le.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;it.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=Z6(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Z6(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},yP={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},HZ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},EP={ol:!0,ul:!0},bd=1,Bx=2,md=4;function Q6(e,t,n){return t!=null?(t?bd:0)|(t==="full"?Bx:0):e&&e.whitespace=="pre"?bd|Bx:n&~md}var $u=class{constructor(t,n,r,i,o,s){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=$e.none,this.match=o||(s&md?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(J.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&bd)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=J.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!yP.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}},Jg=class{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=Q6(null,n.preserveWhitespace,0)|(r?md:0);i?o=new $u(i.type,i.attrs,$e.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new $u(null,null,$e.none,!0,null,s):o=new $u(t.schema.topNodeType,null,$e.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,o=i.options&Bx?"full":this.localPreserveWS||(i.options&bd)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,` -`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(t,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}o&&this.sync(a)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let s=r?t.childNodes[r]:t.firstChild,a=i==null?null:t.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(s,n);this.findAtPoint(t,o)}findPlace(t,n,r){let i,o;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(t);if(u&&(!i||i.length>u.length+a)&&(i=u,o=l,!u.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(o);for(let s=0;s(s.type?s.type.allowsMarkType(u.type):J6(u.type,t))?(l=u.addToSet(l),!1):!0),this.nodes.push(new $u(t,n,l,i,null,a)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=bd)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function zZ(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&EP.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function qZ(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Z6(e){let t={};for(let n in e)t[n]=e[n];return t}function J6(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=a=>{o.push(a);for(let l=0;l{if(o.length||s.marks.length){let a=0,l=0;for(;a=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&Wg($g(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return typeof n=="string"?{dom:t.createTextNode(n)}:Wg(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=eP(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return eP(t.marks)}};function eP(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function $g(e){return e.document||window.document}var tP=new WeakMap;function VZ(e){let t=tP.get(e);return t===void 0&&tP.set(e,t=GZ(e)),t}function GZ(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?e.createElementNS(n,i):e.createElement(i),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),u[f]):f=="style"&&l.style?l.style.cssText=u[f]:l.setAttribute(f,u[f])}}for(let f=c;fc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof d=="string")l.appendChild(e.createTextNode(d));else{let{dom:p,contentDOM:h}=Wg(e,d,n,r);if(l.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:l,contentDOM:a}}var xP=65535,_P=Math.pow(2,16);function KZ(e,t){return e+t*_P}function TP(e){return e&xP}function YZ(e){return(e-(e&xP))/_P}var vP=1,CP=2,e0=4,AP=8,Td=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&AP)>0}get deletedBefore(){return(this.delInfo&(vP|e0))>0}get deletedAfter(){return(this.delInfo&(CP|e0))>0}get deletedAcross(){return(this.delInfo&e0)>0}},vo=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(t){let n=0,r=TP(t);if(!this.inverted)for(let i=0;it)break;let u=this.ranges[a+o],c=this.ranges[a+s],f=l+u;if(t<=f){let d=u?t==l?-1:t==f?1:n:n,p=l+i+(d<0?0:c);if(r)return p;let h=t==(n<0?l:f)?null:KZ(a/3,t-l),g=t==l?CP:t==f?vP:e0;return(n<0?t!=l:t!=f)&&(g|=AP),new Td(p,g,h)}i+=c-u}return r?t+i:new Td(t+i,0,null)}touches(t,n){let r=0,i=TP(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;at)break;let u=this.ranges[a+o],c=l+u;if(t<=c&&a==i*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=t.getMirror(n);this.appendMap(t._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;ro&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Sn.fromReplace(t,this.from,this.to,o)}invert(){return new Co(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};sn.jsonID("addMark",xd);var Co=class e extends sn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new le(Vx(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Sn.fromReplace(t,this.from,this.to,r)}invert(){return new xd(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};sn.jsonID("removeMark",Co);var _d=class e extends sn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Sn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Sn.fromReplace(t,this.pos,this.pos+1,new le(J.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new e(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,le.fromJSON(t,n.slice),n.insert,!!n.structure)}};sn.jsonID("replaceAround",$t);function zx(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function $Z(e,t,n,r){let i=[],o=[],s,a;e.doc.nodesBetween(t,n,(l,u,c)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let d=Math.max(u,t),p=Math.min(u+l.nodeSize,n),h=r.addToSet(f);for(let g=0;ge.step(l)),o.forEach(l=>e.step(l))}function WZ(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof gd){let u=s.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(a+s.nodeSize,n);for(let c=0;ce.step(new Co(s.from,s.to,s.style)))}function Gx(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let l=0;l=0;l--)e.step(s[l])}function jZ(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Ao(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,i=0,o=0;;--r){let s=e.$from.node(r),a=e.$from.index(r)+i,l=e.$to.indexAfter(r)-o;if(rn;h--)g||r.index(h)>0?(g=!0,c=J.from(r.node(h).copy(c)),f++):l--;let d=J.empty,p=0;for(let h=o,g=!1;h>n;h--)g||i.after(h+1)=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=J.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new $t(i,o,i,o,new le(r,0,0),n.length,!0))}function eJ(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&tJ(e.doc,e.mapping.slice(o).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!h?u=!1:!p&&h&&(u=!0)}u===!1&&wP(e,s,a,o),Gx(e,e.mapping.slice(o).map(a,1),r,void 0,u===null);let c=e.mapping.slice(o),f=c.map(a,1),d=c.map(a+s.nodeSize,1);return e.step(new $t(f,d,f+1,d-1,new le(J.from(r.create(l,null,s.marks)),0,0),1,!0)),u===!0&&NP(e,s,a,o),!1}})}function NP(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function wP(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=e.mapping.slice(r).map(n+1+o);e.replaceWith(s,s+1,t.type.schema.text(` -`))}})}function tJ(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function nJ(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new $t(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new le(J.from(s),0,0),1,!0))}function Ir(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=n-2;u>o;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[c+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let g=r&&r[c]||f;if(!f.canReplace(d+1,f.childCount)||!g.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function rJ(e,t,n=1,r){let i=e.doc.resolve(t),o=J.empty,s=J.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){o=J.from(i.node(a).copy(o));let c=r&&r[u];s=J.from(c?c.type.create(c.attrs,s):i.node(a).copy(s))}e.step(new xn(t,t,new le(o.append(s),n,n),!0))}function ui(e,t){let n=e.resolve(t),r=n.index();return RP(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function iJ(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&RP(o,s)&&r.node(i).canReplace(a,a+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function oJ(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let c=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);c&&!f?r=!1:!c&&f&&(r=!0)}let a=e.steps.length;if(r===!1){let c=e.doc.resolve(t+n);wP(e,c.node(),c.before(),a)}s.inlineContent&&Gx(e,t+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=e.mapping.slice(a),u=l.map(t-n);if(e.step(new xn(u,l.map(t+n,-1),le.empty,!0)),r===!0){let c=e.doc.resolve(u);NP(e,c.node(),c.before(),e.steps.length)}return e}function sJ(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),u=r.node(s),c=!1;if(o==1)c=u.canReplace(l,l,i);else{let f=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(l,l,f[0])}if(c)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Cd(e,t,n=t,r=le.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return MP(i,o,r)?new xn(t,n,r):new qx(i,o,r).fit()}function MP(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var qx=class{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=J.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=J.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new le(o,s,a);return t>-1?new $t(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new xn(r.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Fx(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,f=null;if(n==1&&(s?u.matchType(s.type)||(f=u.fillBefore(J.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Fx(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new le(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Fx(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new le(yd(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new le(yd(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g1||l==0||g.content.size)&&(f=y,c.push(OP(g.mark(d.allowedMarks(g.marks)),u==1?l:0,u==a.childCount?p:-1)))}let h=u==a.childCount;h||(p=-1),this.placed=Ed(this.placed,n,J.from(c)),this.frontier[n].match=f,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;a--){let{match:l,type:u}=this.frontier[a],c=Hx(t,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Ed(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=Ed(this.placed,this.depth,J.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=Ed(this.placed,this.frontier.length,n))}};function yd(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(yd(e.firstChild.content,t-1,n)))}function Ed(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ed(e.lastChild.content,t-1,n)))}function Fx(e,t){for(let n=0;n1&&(r=r.replaceChild(0,OP(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(J.empty,!0)))),e.copy(r)}function Hx(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!aJ(n,o.content,s)?a:null}function aJ(e,t,n){for(let r=n;r0;d--,p--){let h=i.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(d)>-1?a=d:i.before(d)==p&&s.splice(1,0,-d)}let l=s.indexOf(a),u=[],c=r.openStart;for(let d=r.content,p=0;;p++){let h=d.firstChild;if(u.push(h),p==r.openStart)break;d=h.content}for(let d=c-1;d>=0;d--){let p=u[d],h=lJ(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(a)-1)))c=d;else if(h||!p.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+c+1)%(r.openStart+1),h=u[p];if(h)for(let g=0;g=0&&(e.replace(t,n,r),!(e.steps.length>f));d--){let p=s[d];p<0||(t=i.before(p),n=o.after(p))}}function DP(e,t,n,r,i){if(tr){let o=i.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(J.empty,!0))}return e}function cJ(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=sJ(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new le(J.from(r),0,0))}function fJ(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let s=r.sharedDepth(n),a=!1;for(let l=r.depth;l>s;l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=i.depth;l>s;l--)i.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&t==r.start(l);l--)t=r.before(l);for(let l=i.depth;l>0&&n==i.start(l);l--)n=i.before(l);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let o=IP(r,i);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return e.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n)}function IP(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(ot.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}var t0=class e extends sn{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Sn.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Sn.fromReplace(t,this.pos,this.pos+1,new le(J.from(i),0,n.isLeaf?0:1))}getMap(){return vo.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new e(n.pos,n.attr,n.value)}};sn.jsonID("attr",t0);var n0=class e extends sn{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Sn.ok(r)}getMap(){return vo.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new e(n.attr,n.value)}};sn.jsonID("docAttr",n0);var Xu=class extends Error{};Xu=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Xu.prototype=Object.create(Error.prototype);Xu.prototype.constructor=Xu;Xu.prototype.name="TransformError";var Qu=class{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Sd}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Xu(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r{t=Math.min(t,a),n=Math.max(n,l)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=le.empty){let i=Cd(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new le(J.from(r),0,0))}delete(t,n){return this.replace(t,n,le.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return uJ(this,t,n,r),this}replaceRangeWith(t,n,r){return cJ(this,t,n,r),this}deleteRange(t,n){return fJ(this,t,n),this}lift(t,n){return XZ(this,t,n),this}join(t,n=1){return oJ(this,t,n),this}wrap(t,n){return JZ(this,t,n),this}setBlockType(t,n=t,r,i=null){return eJ(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return nJ(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new t0(t,n,r)),this}setDocAttribute(t,n){return this.step(new n0(t,n)),this}addNodeMark(t,n){return this.step(new _d(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof $e)n.isInSet(r.marks)&&this.step(new ju(t,n));else{let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new ju(t,o)),i=o.removeFromSet(i);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(t,n=1,r){return rJ(this,t,n,r),this}addMark(t,n,r){return $Z(this,t,n,r),this}removeMark(t,n,r){return WZ(this,t,n,r),this}clearIncompatible(t,n,r){return Gx(this,t,n,r),this}};var Kx=Object.create(null),Oe=class{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new i0(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;o--){let s=n<0?Zu(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Zu(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Kn(t.node(0))}static atStart(t){return Zu(t,t,0,0,1)||new Kn(t)}static atEnd(t){return Zu(t,t,t.content.size,t.childCount,-1)||new Kn(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Kx[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Kx)throw new RangeError("Duplicate use of selection JSON ID "+t);return Kx[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Te.between(this.$anchor,this.$head).getBookmark()}};Oe.prototype.visible=!0;var i0=class{constructor(t,n){this.$from=t,this.$to=n}},LP=!1;function PP(e){!LP&&!e.parent.inlineContent&&(LP=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var Te=class e extends Oe{constructor(t,n=t){PP(t),PP(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Oe.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(t,n=le.empty){if(super.replace(t,n),n==le.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new o0(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=Oe.findFrom(n,r,!0)||Oe.findFrom(n,-r,!0);if(o)n=o.$head;else return Oe.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Oe.findFrom(t,-r,!0)||Oe.findFrom(t,r,!0)).$anchor,t.pos0?0:1);i>0?s=0;s+=i){let a=t.child(s);if(a.isAtom){if(!o&&ge.isSelectable(a))return ge.create(e,n-(i<0?a.nodeSize:0))}else{let l=Zu(e,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function BP(e,t,n){let r=e.steps.length-1;if(r{s==null&&(s=c)}),e.setSelection(Oe.near(e.doc.resolve(s),n))}var UP=1,r0=2,FP=4,Wx=class extends Qu{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=r0,this}ensureMarks(t){return $e.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&r0)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~r0,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||$e.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,o)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Oe.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=FP,this}get scrolledIntoView(){return(this.updated&FP)>0}};function HP(e,t){return!t||!e?e:e.bind(t)}var Wa=class{constructor(t,n,r){this.name=t,this.init=HP(n.init,r),this.apply=HP(n.apply,r)}},pJ=[new Wa("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Wa("selection",{init(e,t){return e.selection||Oe.atStart(t.doc)},apply(e){return e.selection}}),new Wa("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Wa("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Ad=class{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=pJ.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Wa(r.key,r.spec.state,r))})}},s0=class e{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;rr.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new Ad(t.schema,t.plugins),o=new e(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=fr.fromJSON(t.schema,n.doc);else if(s.name=="selection")o.selection=Oe.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=u.fromJSON.call(l,t,n[a],o);return}}o[s.name]=s.init(t,o)}}),o}};function zP(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=zP(i,t,{})),n[r]=i}return n}var Qe=class{constructor(t){this.spec=t,this.props={},t.props&&zP(t.props,this,this.props),this.key=t.key?t.key.key:qP("plugin")}getState(t){return t[this.key]}},Yx=Object.create(null);function qP(e){return e in Yx?e+"$"+ ++Yx[e]:(Yx[e]=0,e+"$")}var Et=class{constructor(t="key"){this.key=qP(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}};var GP=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function KP(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}var Xx=(e,t,n)=>{let r=KP(e,n);if(!r)return!1;let i=Zx(r);if(!i){let s=r.blockRange(),a=s&&Ao(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(e4(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Ju(o,"end")||ge.isSelectable(o)))for(let s=r.depth;;s--){let a=Cd(e.doc,r.before(s),r.after(s),le.empty);if(a&&a.slice.size1)break}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},YP=(e,t,n)=>{let r=KP(e,n);if(!r)return!1;let i=Zx(r);return i?WP(e,i,t):!1},$P=(e,t,n)=>{let r=jP(e,n);if(!r)return!1;let i=t_(r);return i?WP(e,i,t):!1};function WP(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let s=t.nodeAfter,a=s,l=t.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=Cd(e.doc,o,l,le.empty);if(!u||u.from!=o||u instanceof xn&&u.slice.size>=l-o)return!1;if(n){let c=e.tr.step(u);c.setSelection(Te.create(c.doc,o)),n(c.scrollIntoView())}return!0}function Ju(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Qx=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=Zx(r)}let s=o&&o.nodeBefore;return!s||!ge.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ge.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Zx(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function jP(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset{let r=jP(e,n);if(!r)return!1;let i=t_(r);if(!i)return!1;let o=i.nodeAfter;if(e4(e,i,t,1))return!0;if(r.parent.content.size==0&&(Ju(o,"start")||ge.isSelectable(o))){let s=Cd(e.doc,r.before(),r.after(),le.empty);if(s&&s.slice.size{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let n=e.selection,r=n instanceof ge,i;if(r){if(n.node.isTextblock||!ui(e.doc,n.from))return!1;i=n.from}else if(i=$a(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(ge.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},QP=(e,t)=>{let n=e.selection,r;if(n instanceof ge){if(n.node.isTextblock||!ui(e.doc,n.to))return!1;r=n.to}else if(r=$a(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},ZP=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Ao(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},n_=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(` -`).scrollIntoView()),!0)};function r_(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=r_(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Oe.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},o_=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Kn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=r_(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Ir(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ao(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function hJ(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof ge&&t.selection.node.isBlock)return!r.parentOffset||!Ir(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,a,l=!1,u=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){l=r.end(p)==r.pos+(r.depth-p),u=r.start(p)==r.pos-(r.depth-p),a=r_(r.node(p-1).contentMatchAt(r.indexAfter(p-1)));let g=e&&e(i.parent,l,r);o.unshift(g||(l&&a?{type:a}:null)),s=p;break}else{if(p==1)return!1;o.unshift(null)}let c=t.tr;(t.selection instanceof Te||t.selection instanceof Kn)&&c.deleteSelection();let f=c.mapping.map(r.pos),d=Ir(c.doc,f,o.length,o);if(d||(o[0]=a?{type:a}:null,d=Ir(c.doc,f,o.length,o)),!d)return!1;if(c.split(f,o.length,o),!l&&u&&r.node(s).type!=a){let p=c.mapping.map(r.before(s)),h=c.doc.resolve(p);a&&r.node(s-1).canReplaceWith(h.index(),h.index()+1,a)&&c.setNodeMarkup(c.mapping.map(r.before(s)),a)}return n&&n(c.scrollIntoView()),!0}}var mJ=hJ();var JP=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(ge.create(e.doc,i))),!0)},gJ=(e,t)=>(t&&t(e.tr.setSelection(new Kn(e.doc))),!0);function bJ(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||ui(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function e4(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&bJ(e,t,n))return!0;let u=!l&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let p=t.pos+o.nodeSize,h=J.empty;for(let b=s.length-1;b>=0;b--)h=J.from(s[b].create(null,h));h=J.from(i.copy(h));let g=e.tr.step(new $t(t.pos-1,p,t.pos,p,new le(h,1,0),s.length,!0)),y=g.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&ui(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let c=o.type.spec.isolating||r>0&&l?null:Oe.findFrom(t,1),f=c&&c.$from.blockRange(c.$to),d=f&&Ao(f);if(d!=null&&d>=t.depth)return n&&n(e.tr.lift(f,d).scrollIntoView()),!0;if(u&&Ju(o,"start",!0)&&Ju(i,"end")){let p=i,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let g=o,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let b=J.empty;for(let T=h.length-1;T>=0;T--)b=J.from(h[T].copy(b));let E=e.tr.step(new $t(t.pos-h.length,t.pos+o.nodeSize,t.pos+y,t.pos+o.nodeSize-y,new le(b,h.length,0),0,!0));n(E.scrollIntoView())}return!0}}return!1}function t4(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(Te.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}var a_=t4(-1),l_=t4(1);function n4(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&vd(s,e,t);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function u_(e,t=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)i=!0;else{let c=n.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let l=s.resolve(t.start-2);o=new Ka(l,l,t.depth),t.endIndex=0;c--)o=J.from(n[c].type.create(n[c].attrs,o));e.step(new $t(t.start-(r?2:0),t.end,t.start,t.end,new le(o,0,0),n.length,!0));let s=0;for(let c=0;cs.childCount>0&&s.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?SJ(t,n,e,o):xJ(t,n,o):!0:!1}}function SJ(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);og;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?J.empty:J.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new $t(f-(a?1:0),d+(l?1:0),f+1,d-1,new le((a?J.empty:J.from(i.copy(J.empty))).append(l?J.empty:J.from(i.copy(J.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}function o4(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==e);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=e)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=J.from(u?e.create():null),f=new le(J.from(e.create(null,J.from(a.type.create(null,c)))),u?3:1,0),d=o.start,p=o.end;n(t.tr.step(new $t(d-(u?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}var _n=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},rc=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},g_=null,wo=function(e,t,n){let r=g_||(g_=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},_J=function(){g_=null},tl=function(e,t,n,r){return n&&(s4(e,t,n,r,-1)||s4(e,t,n,r,1))},vJ=/^(img|br|input|textarea|hr)$/i;function s4(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Xr(e))){let s=e.parentNode;if(!s||s.nodeType!=1||Id(e)||vJ.test(e.nodeName)||e.contentEditable=="false")return!1;t=_n(e)+(i<0?0:1),e=s}else if(e.nodeType==1){let s=e.childNodes[t+(i<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((o=s.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)t+=i;else return!1;else e=s,t=i<0?Xr(e):0}else return!1}}function Xr(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function CJ(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=Xr(e)}else if(e.parentNode&&!Id(e))t=_n(e),e=e.parentNode;else return null}}function AJ(e,t){for(;;){if(e.nodeType==3&&t2),jr=ic||(Li?/Mac/.test(Li.platform):!1),H4=Li?/Win/.test(Li.platform):!1,Ro=/Android \d/.test(Ls),Ld=!!a4&&"webkitFontSmoothing"in a4.documentElement.style,kJ=Ld?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function MJ(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function No(e,t){return typeof e=="number"?e:e[t]}function OJ(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function l4(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(s.nodeType!=1){s=rc(s);continue}let a=s,l=a==o.body,u=l?MJ(o):OJ(a),c=0,f=0;if(t.topu.bottom-No(r,"bottom")&&(f=t.bottom-t.top>u.bottom-u.top?t.top+No(i,"top")-u.top:t.bottom-u.bottom+No(i,"bottom")),t.leftu.right-No(r,"right")&&(c=t.right-u.right+No(i,"right")),c||f)if(l)o.defaultView.scrollBy(c,f);else{let p=a.scrollLeft,h=a.scrollTop;f&&(a.scrollTop+=f),c&&(a.scrollLeft+=c);let g=a.scrollLeft-p,y=a.scrollTop-h;t={left:t.left-g,top:t.top-y,right:t.right-g,bottom:t.bottom-y}}let d=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s=d=="absolute"?s.offsetParent:rc(s)}}function DJ(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,s=n+1;s=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:z4(e.dom)}}function z4(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=rc(r));return t}function IJ({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;q4(n,r==0?0:r-t)}function q4(e,t){for(let n=0;n=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let g=h.left>t.left?h.left-t.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!l&&h.left<=t.left&&h.right>=t.left&&(l=c,u={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?PJ(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:V4(n,i)}function PJ(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o=(s.left+s.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function L_(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function BJ(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function FJ(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let a=e.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right-1?i:e.docView.posFromDOM(t,n,-1)}function G4(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&i++}let u;Ld&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=FJ(e,r,i,t))}a==null&&(a=UJ(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function u4(e){return e.top=0&&i==r.nodeValue.length?(l--,c=1):n<0?l--:u++,Nd(Ms(wo(r,l,u),c),c<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Xr(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return f_(l.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Xr(r))){let l=r.childNodes[i-1],u=l.nodeType==3?wo(l,Xr(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return Nd(Ms(u,1),!1)}if(o==null&&i=0)}function Nd(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function f_(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Y4(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function qJ(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return Y4(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=K4(e,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=wo(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;uc.top+1&&(n=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}var VJ=/[\u0590-\u08ac]/;function GJ(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return a?!VJ.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:Y4(e,t,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:f}=e.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:h,focusOffset:g}=e.domSelectionRange(),y=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&u==g;try{a.collapse(c,f),l&&(l!=c||u!=f)&&a.extend&&a.extend(l,u)}catch{}return d!=null&&(a.caretBidiLevel=d),y}):r.pos==r.start()||r.pos==r.end()}var c4=null,f4=null,d4=!1;function KJ(e,t,n){return c4==t&&f4==n?d4:(c4=t,f4=n,d4=n=="up"||n=="down"?qJ(e,t,n):GJ(e,t,n))}var Zr=0,p4=1,Xa=2,Pi=3,nl=class{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Zr,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n_n(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;nt||s instanceof u0){i=t-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof a0&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?_n(o.dom)+1:0}}else{let o,s=!0;for(;o=r=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,c);t=s;for(let f=a;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=_n(d.dom)+1;break}t-=d.size}i==-1&&(i=0)}if(i>-1&&(u>n||a==this.children.length-1)){n=u;for(let c=a+1;ch&&sn){let h=a;a=l,l=h}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(p)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i=r:tr){let a=r+o.border,l=s-o.border;if(t>=a&&n<=l){this.dirty=t==r||n==s?Xa:p4,t==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Pi:o.markDirty(t-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Xa:Pi}r=s}this.dirty=Xa}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?Xa:p4;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Zr&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},T_=class extends nl{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}},oc=class e extends nl{constructor(t,n,r,i,o){super(t,[],r,i),this.mark=n,this.spec=o}static create(t,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=_o.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Pi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Pi&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Zr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=v_(o,0,t,r));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),c=u&&u.dom,f=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=_o.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let d=c;return c=j4(c,r,n),u?l=new S_(t,n,r,i,c,f||null,d,u,o,s+1):n.isText?new l0(t,n,r,i,c,d,o):new e(t,n,r,i,c,f||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>J.empty)}return t}matchesNode(t,n,r){return this.dirty==Zr&&t.eq(this.node)&&c0(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new __(this,s&&s.node,t);jJ(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,t,c):u.type.side>=0&&!f&&l.syncToMarks(c==this.node.childCount?$e.none:this.node.child(c).marks,r,t,c),l.placeWidget(u,t,i)},(u,c,f,d)=>{l.syncToMarks(u.marks,r,t,d);let p;l.findNodeMatch(u,c,f,d)||a&&t.state.selection.from>i&&t.state.selection.to-1&&l.updateNodeAt(u,c,f,p,t)||l.updateNextNode(u,c,f,t,d,i)||l.addNode(u,c,f,t,i),i+=u.nodeSize}),l.syncToMarks([],r,t,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Xa)&&(s&&this.protectLocalComposition(t,s),$4(this.contentDOM,this.children,t),ic&&XJ(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Te)||rn+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=QJ(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new T_(this,o,n,i);t.input.compositionNodes.push(s),this.children=v_(this.children,r,r+i.length,t,s)}update(t,n,r,i){return this.dirty==Pi||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Zr}updateOuterDeco(t){if(c0(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=W4(this.dom,this.nodeDOM,x_(this.outerDeco,this.node,n),x_(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function h4(e,t,n,r,i){j4(r,t,e);let o=new Is(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var l0=class e extends Is{constructor(t,n,r,i,o,s,a){super(t,n,r,i,o,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==Pi||this.dirty!=Zr&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Zr||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=Zr,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Pi)}get domAtom(){return!1}isText(t){return this.node.text==t}},u0=class extends nl{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Zr&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},S_=class extends Is{constructor(t,n,r,i,o,s,a,l,u,c){super(t,n,r,i,o,s,a,u,c),this.spec=l}update(t,n,r,i){if(this.dirty==Pi)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}};function $4(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o>1,a=Math.min(s,t.length);for(;o-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=oc.create(this.top,t[s],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,s++}}findNodeMatch(t,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof oc)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function WJ(e,t){return e.type.side-t.type.side}function jJ(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let u=0;uo;)a.push(i[s++]);let h=o+d.nodeSize;if(d.isText){let y=h;s!y.inline):a.slice();r(d,g,t.forChild(o,d),p),o=h}}function XJ(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function QJ(e,t,n,r){for(let i=0,o=0;i=n){if(o>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let u=a=0&&u+t.length+a>=n)return a+u;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}function v_(e,t,n,r,i){let o=[];for(let s=0,a=0;s=n||c<=t?o.push(l):(un&&o.push(l.slice(n-u,l.size,r)))}return o}function P_(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,u;if(y0(n)){for(l=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&ge.isSelectable(f)&&i.parent&&!(f.isInline&&NJ(n.focusNode,n.focusOffset,i.dom))){let d=i.posBefore;u=new ge(s==d?a:r.resolve(d))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,d=s;for(let p=0;p{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!X4(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function JJ(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,_n(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&dr&&Ds<=11&&(n.disabled=!0,n.disabled=!1)}function Q4(e,t){if(t instanceof ge){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(E4(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else E4(e)}function E4(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function B_(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Te.between(t,n,r)}function T4(e){return e.editable&&!e.hasFocus()?!1:Z4(e)}function Z4(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function eee(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return tl(t.node,t.offset,n.anchorNode,n.anchorOffset)}function C_(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&Oe.findFrom(o,t)}function Os(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function S4(e,t,n){let r=e.state.selection;if(r instanceof Te)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return Os(e,new Te(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=C_(e.state,t);return i&&i instanceof ge?Os(e,i):!1}else if(!(jr&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?ge.isSelectable(o)?Os(e,new ge(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):Ld?Os(e,new Te(e.state.doc.resolve(t<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ge&&r.node.isInline)return Os(e,new Te(t>0?r.$to:r.$from));{let i=C_(e.state,t);return i?Os(e,i):!1}}}function f0(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Rd(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function tc(e,t){return t<0?tee(e):nee(e)}function tee(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Qr&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Rd(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(J4(n))break;{let a=n.previousSibling;for(;a&&Rd(a,-1);)i=n.parentNode,o=_n(a),a=a.previousSibling;if(a)n=a,r=f0(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?A_(e,n,r):i&&A_(e,i,o)}function nee(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=f0(n),o,s;for(;;)if(r{e.state==i&&Mo(e)},50)}function x4(e,t){let n=e.state.doc.resolve(t);if(!(an||H4)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function _4(e,t,n){let r=e.state.selection;if(r instanceof Te&&!r.empty||n.indexOf("s")>-1||jr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=C_(e.state,t);if(s&&s instanceof ge)return Os(e,s)}if(!i.parent.inlineContent){let s=t<0?i:o,a=r instanceof Kn?Oe.near(s,t):Oe.findFrom(s,t);return a?Os(e,a):!1}return!1}function v4(e,t){if(!(e.state.selection instanceof Te))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=e.state.tr;return t<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),e.dispatch(s),!0}return!1}function C4(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function oee(e){if(!In||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;C4(e,r,"true"),setTimeout(()=>C4(e,r,"false"),20)}return!1}function see(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function aee(e,t){let n=t.keyCode,r=see(t);if(n==8||jr&&n==72&&r=="c")return v4(e,-1)||tc(e,-1);if(n==46&&!t.shiftKey||jr&&n==68&&r=="c")return v4(e,1)||tc(e,1);if(n==13||n==27)return!0;if(n==37||jr&&n==66&&r=="c"){let i=n==37?x4(e,e.state.selection.from)=="ltr"?-1:1:-1;return S4(e,i,r)||tc(e,i)}else if(n==39||jr&&n==70&&r=="c"){let i=n==39?x4(e,e.state.selection.from)=="ltr"?1:-1:1;return S4(e,i,r)||tc(e,i)}else{if(n==38||jr&&n==80&&r=="c")return _4(e,-1,r)||tc(e,-1);if(n==40||jr&&n==78&&r=="c")return oee(e)||_4(e,1,r)||tc(e,1);if(r==(jr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function U_(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=e.someProp("clipboardSerializer")||_o.fromSchema(e.state.schema),a=oB(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u=l.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=iB[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let h=a.createElement(c[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),f++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,` - -`);return{dom:l,text:d,slice:t}}function eB(e,t,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!t)return null;let l=!!t&&(r||o||!n);if(l){if(e.someProp("transformPastedText",d=>{t=d(t,o||r,e)}),o)return a=new le(J.from(e.state.schema.text(t.replace(/\r\n?/g,` -`))),0,0),e.someProp("transformPasted",d=>{a=d(a,e,!0)}),a;let f=e.someProp("clipboardTextParser",d=>d(t,i,r,e));if(f)a=f;else{let d=i.marks(),{schema:p}=e.state,h=_o.fromSchema(p);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(h.serializeNode(p.text(g,d)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),s=fee(n),Ld&&dee(s);let u=s&&s.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Ii.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!lee.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)a=pee(A4(a,+c[1],+c[2]),c[4]);else if(a=le.maxOpen(uee(a.content,i),!0),a.openStart||a.openEnd){let f=0,d=0;for(let p=a.content.firstChild;f{a=f(a,e,l)}),a}var lee=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function uee(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),u;if(!l)return s=null;if(u=s.length&&o.length&&nB(l,o,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=rB(s[s.length-1],o.length));let c=tB(a,l);s.push(c),i=i.matchType(c.type),o=l}}),s)return J.from(s)}return e}function tB(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,J.from(e));return e}function nB(e,t,n,r,i){if(i1&&(o=0),i=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(J.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function A4(e,t,n){return tn})),p_.createHTML(e)):e}function fee(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=oB().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&iB[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"").reverse().join("")),n.innerHTML=cee(e),i)for(let o=0;o=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=J.from(l.create(r[a+1],i)),o++,s++}return new le(i,o,s)}var Yn={},$n={},hee={touchstart:!0,touchmove:!0},w_=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function mee(e){for(let t in Yn){let n=Yn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{bee(e,r)&&!F_(e,r)&&(e.editable||!(r.type in $n))&&n(e,r)},hee[t]?{passive:!0}:void 0)}In&&e.dom.addEventListener("input",()=>null),R_(e)}function ko(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function gee(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function R_(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>F_(e,r))})}function F_(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function bee(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function yee(e,t){!F_(e,t)&&Yn[t.type]&&(e.editable||!(t.type in $n))&&Yn[t.type](e,t)}$n.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!lB(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Ro&&an&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),ic&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,ja(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||aee(e,n)?n.preventDefault():ko(e,"key")};$n.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};$n.keypress=(e,t)=>{let n=t;if(lB(e)||!n.charCode||n.ctrlKey&&!n.altKey||jr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Te)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",s=>s(e,r.$from.pos,r.$to.pos,i,o))&&e.dispatch(o()),n.preventDefault()}};function Pd(e){return{left:e.clientX,top:e.clientY}}function Eee(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function H_(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,a=>s>o.depth?a(e,n,o.nodeAfter,o.before(s),i,!0):a(e,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Bd(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function Tee(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&ge.isSelectable(r)?(Bd(e,new ge(n),"pointer"),!0):!1}function See(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof ge&&(r=n.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(ge.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Bd(e,ge.create(e.state.doc,i),"pointer"),!0):!1}function xee(e,t,n,r,i){return H_(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?See(e,n):Tee(e,n))}function _ee(e,t,n,r){return H_(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function vee(e,t,n,r){return H_(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||Cee(e,n,r)}function Cee(e,t,n){if(n.button!=0)return!1;let r=sB(e,t,!0),i=e.state.doc;return r?(Bd(e,r,"pointer"),r instanceof Te&&i.eq(e.state.doc)&&(e.input.mouseDown=new M_(e,r)),!0):!1}function sB(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?Te.create(r,0,r.content.size):null;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)return Te.create(r,a+1,a+1+s.content.size);if(n&&ge.isSelectable(s))return ge.create(r,a)}return null}function z_(e){return p0(e)}var aB=jr?"metaKey":"ctrlKey";Yn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=z_(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&Eee(n,e.input.lastClick)&&!n[aB]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let s=e.posAtCoords(Pd(n));s&&(o=="singleClick"?e.input.mouseDown=new k_(e,s,n,!!r):(o=="doubleClick"?_ee:vee)(e,s.pos,s.inside,n)?n.preventDefault():ko(e,"pointer"))};var d0=class{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},k_=class extends d0{constructor(t,n,r,i){super(t),this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!r[aB],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),s=n.inside;else{let c=t.state.doc.resolve(n.pos);o=c.parent,s=c.depth?c.before():0}let a=i?null:r.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=t.state;r.button==0&&(o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof ge&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Qr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),ko(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Mo(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Pd(t))),this.updateAllowDefault(t),this.allowDefault||!n?ko(this.view,"pointer"):xee(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||In&&this.mightDrag&&!this.mightDrag.node.isAtom||an&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Bd(this.view,Oe.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):ko(this.view,"pointer")}move(t){this.updateAllowDefault(t),ko(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},M_=class extends d0{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),ko(this.view,"pointer");let n=this.view.posAtCoords(Pd(t)),r=n&&sB(this.view,n.inside,!1);if(!r)return;let{doc:i}=this.view.state,o=this.startSelection,[s,a]=r.from{e.input.lastTouch=Date.now(),z_(e),ko(e,"pointer")};Yn.touchmove=e=>{e.input.lastTouch=Date.now(),ko(e,"pointer")};Yn.contextmenu=e=>z_(e);function lB(e,t){return e.composing?!0:In&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Aee=Ro?5e3:-1;$n.compositionstart=$n.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Te&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||an&&H4&&Nee(e)))e.markCursor=e.state.storedMarks||n.marks(),p0(e,!0),e.markCursor=null;else if(p0(e,!t.selection.empty),Qr&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=e.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}e.input.composing=!0}uB(e,Aee)};function Nee(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}$n.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,uB(e,20))};function uB(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>p0(e),t))}function cB(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function wee(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=CJ(t.focusNode,t.focusOffset),r=AJ(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function p0(e,t=!1){if(!(Ro&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),cB(e),t||e.docView&&e.docView.dirty){let n=P_(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Ree(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var kd=dr&&Ds<15||ic&&kJ<604;Yn.copy=$n.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=kd?null:n.clipboardData,s=r.content(),{dom:a,text:l}=U_(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):Ree(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function kee(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Mee(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Md(e,r.value,null,i,t):Md(e,r.textContent,r.innerHTML,i,t)},50)}function Md(e,t,n,r,i){let o=eB(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,i,o||le.empty)))return!0;if(!o)return!1;let s=kee(o),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function fB(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}$n.paste=(e,t)=>{let n=t;if(e.composing&&!Ro)return;let r=kd?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Md(e,fB(r),r.getData("text/html"),i,n)?n.preventDefault():Mee(e,n)};var h0=class{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}},Oee=jr?"altKey":"ctrlKey";function dB(e,t){let n;return e.someProp("dragCopies",r=>{n=n||r(t)}),n!=null?!n:!t[Oee]}Yn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Pd(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ge?i.to-1:i.to))){if(r&&r.mightDrag)s=ge.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=e.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=e.docView&&(s=ge.create(e.state.doc,f.posBefore))}}let a=(s||e.state.selection).content(),{dom:l,text:u,slice:c}=U_(e,a);(!n.dataTransfer.files.length||!an||F4>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(kd?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",kd||n.dataTransfer.setData("text/plain",u),e.dragging=new h0(c,dB(e,n),s)};Yn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};$n.dragover=$n.dragenter=(e,t)=>t.preventDefault();$n.drop=(e,t)=>{try{Dee(e,t,e.dragging)}finally{e.dragging=null}};function Dee(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Pd(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",p=>{o=p(o,e,!1)}):o=eB(e,fB(t.dataTransfer),kd?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&dB(e,t));if(e.someProp("handleDrop",p=>p(e,t,o||le.empty,s))){t.preventDefault();return}if(!o)return;t.preventDefault();let a=o?kP(e.state.doc,i.pos,o):i.pos;a==null&&(a=i.pos);let l=e.state.tr;if(s){let{node:p}=n;p?p.replace(l):l.deleteSelection()}let u=l.mapping.map(a),c=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=l.doc;if(c?l.replaceRangeWith(u,u,o.content.firstChild):l.replaceRange(u,u,o),l.doc.eq(f))return;let d=l.doc.resolve(u);if(c&&ge.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new ge(d));else{let p=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((h,g,y,b)=>p=b),l.setSelection(B_(e,d,l.doc.resolve(p)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}Yn.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Mo(e)},20))};Yn.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Yn.beforeinput=(e,t)=>{if(an&&Ro&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,ja(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in $n)Yn[e]=$n[e];function Od(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var m0=class e{constructor(t,n){this.toDOM=t,this.spec=n||Ja,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:s}=t.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Bi(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Od(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}},Za=class e{constructor(t,n){this.attrs=t,this.spec=n||Ja}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Bi(o,s,this)}valid(t,n){return n.from=t&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;st){let a=this.children[s]+1;this.children[s+2].findInner(t-a,n-a,r,i+a,o)}}map(t,n,r){return this==Dn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Ja)}mapInner(t,n,r,i,o){let s;for(let a=0;a{let u=l+r,c;if(c=hB(n,a,u)){for(i||(i=this.children.slice());oa&&f.to=t){this.children[a]==t&&(r=this.children[a+2]);break}let o=t+1,s=o+n.content.size;for(let a=0;ao&&l.type instanceof Za){let u=Math.max(o,l.from)-o,c=Math.min(s,l.to)-o;ui.map(t,n,Ja));return e.from(r)}forChild(t,n){if(n.isLeaf)return pr.empty;let r=[];for(let i=0;in instanceof pr)?t:t.reduce((n,r)=>n.concat(r instanceof pr?r:r.members),[]))}}forEachSet(t){for(let n=0;n{let y=g-h-(p-d);for(let b=0;bE+c-f)continue;let T=a[b]+c-f;p>=T?a[b+1]=d<=T?-2:-1:d>=c&&y&&(a[b]+=y,a[b+1]+=y)}f+=y}),c=n.maps[u].map(c,-1)}let l=!1;for(let u=0;u=r.content.size){l=!0;continue}let d=n.map(e[u+1]+o,-1),p=d-i,{index:h,offset:g}=r.content.findIndex(f),y=r.maybeChild(h);if(y&&g==f&&g+y.nodeSize==p){let b=a[u+2].mapInner(n,y,c+1,e[u]+o+1,s);b!=Dn?(a[u]=f,a[u+1]=p,a[u+2]=b):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=Lee(a,e,t,n,i,o,s),c=b0(u,r,0,s);t=c.local;for(let f=0;fn&&s.to{let u=hB(e,a,l+n);if(u){o=!0;let c=b0(u,a,n+l+1,r);c!=Dn&&i.push(l,l+a.nodeSize,c)}});let s=pB(o?mB(e):e,-n).sort(el);for(let a=0;a0;)t++;e.splice(t,0,n)}function h_(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Dn&&t.push(r)}),e.cursorWrapper&&t.push(pr.create(e.state.doc,[e.cursorWrapper.deco])),g0.from(t)}var Pee={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Bee=dr&&Ds<=11,D_=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}},I_=class{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new D_,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():In&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Bee&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Pee)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(T4(this.view)){if(this.suppressingSelectionUpdates)return Mo(this.view);if(dr&&Ds<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&tl(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let o=t.focusNode;o;o=rc(o))n.add(o);for(let o=t.anchorNode;o;o=rc(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&T4(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(t.editable)for(let c=0;cc.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46||an&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(c=>c.type=="childList"&&c.removedNodes.length))){for(let c of l)if(c.nodeName=="BR"&&c.parentNode){let f=c.nextSibling;for(;f&&f.nodeType==1;){if(f.contentEditable=="false"){c.parentNode.removeChild(c);break}f=f.firstChild}}}else if(Qr&&l.length){let c=l.filter(f=>f.nodeName=="BR");if(c.length==2){let[f,d]=c;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of c){let p=d.parentNode;p&&p.nodeName=="LI"&&(!f||Hee(t,f)!=p)&&d.remove()}}}let u=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||i)&&(o>-1&&(t.docView.markDirty(o,s),Uee(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,zee(t,l)),this.handleDOMChange(o,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||Mo(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let c=0;ci;y--){let b=r.childNodes[y-1],E=b.pmViewDesc;if(b.nodeName=="BR"&&!E){o=y;break}if(!E||E.size)break}let f=e.state.doc,d=e.someProp("domParser")||Ii.fromSchema(e.state.schema),p=f.resolve(s),h=null,g=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:Vee,context:p});if(u&&u[0].pos!=null){let y=u[0].pos,b=u[1]&&u[1].pos;b==null&&(b=y),h={anchor:y+s,head:b+s}}return{doc:g,sel:h,from:s,to:a}}function Vee(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(In&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||In&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}var Gee=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Kee(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let R=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,O=P_(e,R);if(O&&!e.state.selection.eq(O)){if(an&&Ro&&e.input.lastKeyCode===13&&Date.now()-100C(e,ja(13,"Enter"))))return;let B=e.state.tr.setSelection(O);R=="pointer"?B.setMeta("pointer",!0):R=="key"&&B.scrollIntoView(),o&&B.setMeta("composition",o),e.dispatch(B)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l=e.state.selection,u=qee(e,t,n),c=e.state.doc,f=c.slice(u.from,u.to),d,p;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Ro)&&i.some(R=>R.nodeType==1&&!Gee.test(R.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",R=>R(e,ja(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!h)if(r&&l instanceof Te&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let R=O4(e,e.state.doc,u.sel);if(R&&!R.eq(e.state.selection)){let O=e.state.tr.setSelection(R);o&&O.setMeta("composition",o),e.dispatch(O)}}return}e.state.selection.frome.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?h.start=e.state.selection.from:h.endA=e.state.selection.to-2&&e.state.selection.to<=u.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),dr&&Ds<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)==" \xA0"&&(h.start--,h.endA--,h.endB--);let g=u.doc.resolveNoCache(h.start-u.from),y=u.doc.resolveNoCache(h.endB-u.from),b=c.resolve(h.start),E=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=h.endA;if((ic&&e.input.lastIOSEnter>Date.now()-225&&(!E||i.some(R=>R.nodeName=="DIV"||R.nodeName=="P"))||!E&&g.posR(e,ja(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&$ee(c,h.start,h.endA,g,y)&&e.someProp("handleKeyDown",R=>R(e,ja(8,"Backspace")))){Ro&&an&&e.domObserver.suppressSelectionUpdates();return}an&&h.endB==h.start&&(e.input.lastChromeDelete=Date.now()),Ro&&!E&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,y=u.doc.resolveNoCache(h.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(R){return R(e,ja(13,"Enter"))})},20));let T=h.start,S=h.endA,v=R=>{let O=R||e.state.tr.replace(T,S,u.doc.slice(h.start-u.from,h.endB-u.from));if(u.sel){let B=O4(e,O.doc,u.sel);B&&!(an&&e.composing&&B.empty&&(h.start!=h.endB||e.input.lastChromeDeleteMo(e),20));let R=v(e.state.tr.delete(T,S)),O=c.resolve(h.start).marksAcross(c.resolve(h.endA));O&&R.ensureMarks(O),e.dispatch(R)}else if(h.endA==h.endB&&(x=Yee(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start())))){let R=v(e.state.tr);x.type=="add"?R.addMark(T,S,x.mark):R.removeMark(T,S,x.mark),e.dispatch(R)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let R=g.parent.textBetween(g.parentOffset,y.parentOffset),O=()=>v(e.state.tr.insertText(R,T,S));e.someProp("handleTextInput",B=>B(e,T,S,R,O))||e.dispatch(O())}else e.dispatch(v());else e.dispatch(v())}function O4(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:B_(e,t.resolve(n.anchor),t.resolve(n.head))}function Yee(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,s,a,l;for(let c=0;cc.mark(a.addToSet(c.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=c=>c.mark(a.removeFromSet(c.marks));else return null;let u=[];for(let c=0;cn||m_(s,!0,!1)0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Wee(e,t,n,r,i){let o=e.findDiffStart(t,n),s=n+e.size,a=n+t.size;if(o==null)return null;let{a:l,b:u}=e.findDiffEnd(t,s,a);if(i=="end"){let c=Math.max(0,o-Math.min(l,u));r-=l+c-o}if(l=l?o-r:0;o-=c,u=o+(u-l),l=o}else if(u=u?o-r:0;o-=c,l=o+(l-u),u=o}return{start:o,endA:l,endB:u}}var Dd=class{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new w_,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(B4),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=L4(this),I4(this),this.nodeViews=P4(this),this.docView=h4(this.state.doc,D4(this),h_(this),this.dom,this),this.domObserver=new I_(this,(r,i,o,s)=>Kee(this,r,i,o,s)),this.domObserver.start(),mee(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&R_(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(B4),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let i=this.state,o=!1,s=!1;t.storedMarks&&this.composing&&(cB(this),s=!0),this.state=t;let a=i.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=P4(this);Xee(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&R_(this),this.editable=L4(this),I4(this);let l=h_(this),u=D4(this),c=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(t.doc,u,l);(f||!t.selection.eq(i.selection))&&(s=!0);let d=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&DJ(this);if(s){this.domObserver.stop();let p=f&&(dr||an)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&jee(i.selection,t.selection);if(f){let g=an?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=wee(this)),(o||!this.docView.update(t.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=h4(t.doc,u,l,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}let h=this.input.mouseDown;p||!(h&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&eee(this)&&h.delaySelUpdate())?Mo(this,p):(Q4(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&IJ(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ge){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&l4(this,n.getBoundingClientRect(),t)}else l4(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&on.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return HJ(this,t)}coordsAtPos(t,n=1){return K4(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return KJ(this,n||this.state,t)}pasteHTML(t,n){return Md(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Md(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return U_(this,t)}destroy(){this.docView&&(gee(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],h_(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,_J())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return yee(this,t)}domSelectionRange(){let t=this.domSelection();return t?In&&this.root.nodeType===11&&wJ(this.dom.ownerDocument)==this.dom&&Fee(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Dd.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function D4(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Bi.node(0,e.state.doc.content.size,t)]}function I4(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Bi.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function L4(e){return!e.someProp("editable",t=>t(e.state)===!1)}function jee(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function P4(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Xee(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function B4(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Oo={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},T0={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Qee=typeof navigator<"u"&&/Mac/.test(navigator.platform),Zee=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Wt=0;Wt<10;Wt++)Oo[48+Wt]=Oo[96+Wt]=String(Wt);var Wt;for(Wt=1;Wt<=24;Wt++)Oo[Wt+111]="F"+Wt;var Wt;for(Wt=65;Wt<=90;Wt++)Oo[Wt]=String.fromCharCode(Wt+32),T0[Wt]=String.fromCharCode(Wt);var Wt;for(E0 in Oo)T0.hasOwnProperty(E0)||(T0[E0]=Oo[E0]);var E0;function gB(e){var t=Qee&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Zee&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?T0:Oo)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var Jee=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ete=typeof navigator<"u"&&/Win/.test(navigator.platform);function tte(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a{for(var n in t)ite(e,n,{get:t[n],enumerable:!0})};function R0(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var k0=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([s,a])=>[s,(...u)=>{let c=a(...u)(o);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),c}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,u=()=>(!a&&t&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(l),s.every(f=>f===!0)),c={...Object.fromEntries(Object.entries(n).map(([f,d])=>[f,(...h)=>{let g=this.buildProps(l,t),y=d(...h)(g);return s.push(y),c}])),run:u};return c}createCan(e){let{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,o=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...u)=>l(...u)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:R0({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...u)=>l(...u)(s)]))}};return s}},wB={};j_(wB,{blur:()=>ote,clearContent:()=>ste,clearNodes:()=>ate,command:()=>lte,createParagraphNear:()=>ute,cut:()=>cte,deleteCurrentNode:()=>fte,deleteNode:()=>dte,deleteRange:()=>pte,deleteSelection:()=>gte,enter:()=>bte,exitCode:()=>yte,extendMarkRange:()=>Ete,first:()=>Tte,focus:()=>xte,forEach:()=>_te,insertContent:()=>vte,insertContentAt:()=>Nte,joinBackward:()=>kte,joinDown:()=>Rte,joinForward:()=>Mte,joinItemBackward:()=>Ote,joinItemForward:()=>Dte,joinTextblockBackward:()=>Ite,joinTextblockForward:()=>Lte,joinUp:()=>wte,keyboardShortcut:()=>Bte,lift:()=>Ute,liftEmptyBlock:()=>Fte,liftListItem:()=>Hte,newlineInCode:()=>zte,resetAttributes:()=>qte,scrollIntoView:()=>Vte,selectAll:()=>Gte,selectNodeBackward:()=>Kte,selectNodeForward:()=>Yte,selectParentNode:()=>$te,selectTextblockEnd:()=>Wte,selectTextblockStart:()=>jte,setContent:()=>Xte,setMark:()=>gne,setMeta:()=>bne,setNode:()=>yne,setNodeSelection:()=>Ene,setTextDirection:()=>Tne,setTextSelection:()=>Sne,sinkListItem:()=>xne,splitBlock:()=>_ne,splitListItem:()=>vne,toggleList:()=>Ane,toggleMark:()=>Nne,toggleNode:()=>wne,toggleWrap:()=>Rne,undoInputRule:()=>kne,unsetAllMarks:()=>Mne,unsetMark:()=>One,unsetTextDirection:()=>Dne,updateAttributes:()=>Ine,wrapIn:()=>Lne,wrapInList:()=>Pne});var ote=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),ste=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),ate=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{e.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;let{doc:u,mapping:c}=t,f=u.resolve(c.map(l)),d=u.resolve(c.map(l+a.nodeSize)),p=f.blockRange(d);if(!p)return;let h=Ao(p);if(a.type.isTextblock){let{defaultType:g}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(p.start,g)}(h||h===0)&&t.lift(p,h)})}),!0},lte=e=>t=>e(t),ute=()=>({state:e,dispatch:t})=>o_(e,t),cte=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new Te(r.doc.resolve(Math.max(s-1,0)))),!0},fte=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){let a=i.before(o),l=i.after(o);e.delete(a,l).scrollIntoView()}return!0}return!1};function ln(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var dte=e=>({tr:t,state:n,dispatch:r})=>{let i=ln(e,n.schema),o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let l=o.before(s),u=o.after(s);t.delete(l,u).scrollIntoView()}return!0}return!1},pte=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},hte=e=>e.content?/^text(\*|\+)/.test(e.content):!1,yB=(e,t,n)=>{if(!e.parent.isInline||n==="left"&&e.pos>e.start()||n==="right"&&e.pos{let r=yB(e,n,"left"),i=yB(t,n,"right");return{from:r,to:i}},gte=()=>({state:e,dispatch:t})=>{let{$from:n,$to:r}=e.selection;if(e.selection.empty)return!1;let{from:i,to:o}=mte(n,r,e.schema);return t&&(e.tr.deleteRange(i,o).scrollIntoView(),t(e.tr)),!0},bte=()=>({commands:e})=>e.keyboardShortcut("Enter"),yte=()=>({state:e,dispatch:t})=>i_(e,t);function X_(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function A0(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:X_(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function RB(e,t,n={}){return e.find(r=>r.type===t&&A0(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function EB(e,t,n={}){return!!RB(e,t,n)}function kB(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(u=>u.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(u=>u.type===t))return;if(!n){let u=r.node.marks.find(c=>c.type===t);u&&(n=u.attrs)}if(!RB([...r.node.marks],t,n))return;let o=r.index,s=e.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(;o>0&&EB([...e.parent.child(o-1).marks],t,n);)o-=1,s-=e.parent.child(o).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{let o=Do(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){let f=kB(l,o,t);if(f&&f.from<=u&&f.to>=c){let d=Te.create(s,f.from,f.to);n.setSelection(d)}}return!0},Tte=e=>t=>{let n=typeof e=="function"?e(t):e;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let s=()=>{(N0()||TB())&&r.dom.focus(),Ste()&&!N0()&&!TB()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(o&&e===null&&!MB(n.state.selection))return s(),!0;let a=OB(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},_te=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),vte=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),DB=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&DB(r)}return e};function S0(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`${e}`,n=new window.DOMParser().parseFromString(t,"text/html").body;return DB(n)}function zd(e,t,n){if(e instanceof fr||e instanceof J)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return J.fromArray(e.map(a=>t.nodeFromJSON(a)));let s=t.nodeFromJSON(e);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),zd("",t,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="",l=new Wu({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(s=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?Ii.fromSchema(l).parseSlice(S0(e),n.parseOptions):Ii.fromSchema(l).parse(S0(e),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}let o=Ii.fromSchema(t);return n.slice?o.parseSlice(S0(e),n.parseOptions).content:o.parse(S0(e),n.parseOptions)}return zd("",t,n)}function Cte(e,t,n){let r=e.steps.length-1;if(r{s===0&&(s=c)}),e.setSelection(Oe.near(e.doc.resolve(s),n))}var Ate=e=>!("type"in e),Nte=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a,l=y=>{o.emit("contentError",{editor:o,error:y,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{zd(t,o.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(y){l(y)}try{a=zd(t,o.schema,{parseOptions:u,errorOnInvalidContent:(s=n.errorOnInvalidContent)!=null?s:o.options.enableContentCheck})}catch(y){return l(y),!1}let{from:c,to:f}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},d=!0,p=!0;if((Ate(a)?a:[a]).forEach(y=>{y.check(),d=d?y.isText&&y.marks.length===0:!1,p=p?y.isBlock:!1}),c===f&&p){let{parent:y}=r.doc.resolve(c);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(c-=1,f+=1)}let g;if(d){if(Array.isArray(t))g=t.map(y=>y.text||"").join("");else if(t instanceof J){let y="";t.forEach(b=>{b.text&&(y+=b.text)}),g=y}else typeof t=="object"&&t&&t.text?g=t.text:g=t;r.insertText(g,c,f)}else{g=a;let y=r.doc.resolve(c),b=y.node(),E=y.parentOffset===0,T=b.isText||b.isTextblock,S=b.content.size>0;E&&T&&S&&p&&(c=Math.max(0,c-1)),r.replaceWith(c,f,g)}n.updateSelection&&Cte(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:g})}return!0},wte=()=>({state:e,dispatch:t})=>XP(e,t),Rte=()=>({state:e,dispatch:t})=>QP(e,t),kte=()=>({state:e,dispatch:t})=>Xx(e,t),Mte=()=>({state:e,dispatch:t})=>Jx(e,t),Ote=()=>({state:e,dispatch:t,tr:n})=>{try{let r=$a(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Dte=()=>({state:e,dispatch:t,tr:n})=>{try{let r=$a(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Ite=()=>({state:e,dispatch:t})=>YP(e,t),Lte=()=>({state:e,dispatch:t})=>$P(e,t);function IB(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Pte(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a({editor:t,view:n,tr:r,dispatch:i})=>{let o=Pte(e).split(/-(?!$)/),s=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l?.steps.forEach(u=>{let c=u.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function qd(e,t,n={}){let{from:r,to:i,empty:o}=e.selection,s=t?ln(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;let p=Math.max(r,d),h=Math.min(i,d+f.nodeSize);a.push({node:f,from:p,to:h})});let l=i-r,u=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>A0(f.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=l}var Ute=(e,t={})=>({state:n,dispatch:r})=>{let i=ln(e,n.schema);return qd(n,i,t)?ZP(n,r):!1},Fte=()=>({state:e,dispatch:t})=>s_(e,t),Hte=e=>({state:t,dispatch:n})=>{let r=ln(e,t.schema);return i4(r)(t,n)},zte=()=>({state:e,dispatch:t})=>n_(e,t);function M0(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function SB(e,t){let n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}var qte=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=M0(typeof e=="string"?e:e.name,r.schema);if(!a)return!1;a==="node"&&(o=ln(e,r.schema)),a==="mark"&&(s=Do(e,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,f)=>{o&&o===c.type&&(l=!0,i&&n.setNodeMarkup(f,void 0,SB(c.attrs,t))),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&(l=!0,i&&n.addMark(f,f+c.nodeSize,s.create(SB(d.attrs,t))))})})}),l},Vte=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Gte=()=>({tr:e,dispatch:t})=>{if(t){let n=new Kn(e.doc);e.setSelection(n)}return!0},Kte=()=>({state:e,dispatch:t})=>Qx(e,t),Yte=()=>({state:e,dispatch:t})=>e_(e,t),$te=()=>({state:e,dispatch:t})=>JP(e,t),Wte=()=>({state:e,dispatch:t})=>l_(e,t),jte=()=>({state:e,dispatch:t})=>a_(e,t);function $_(e,t,n={},r={}){return zd(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Xte=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{let{doc:l}=o;if(r.preserveWhitespace!=="full"){let u=$_(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return s&&o.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function LB(e,t){let n=Do(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});let a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function Qte(e,t){let n=new Qu(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Zte(e){for(let t=0;t0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function Q_(e){return t=>Jte(t.$from,e)}function pe(e,t,n){return e.config[t]===void 0&&e.parent?pe(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?pe(e.parent,t,n):null}):e.config[t]}function Z_(e){return e.map(t=>{let n={name:t.name,options:t.options,storage:t.storage},r=pe(t,"addExtensions",n);return r?[t,...Z_(r())]:t}).flat(10)}function J_(e,t){let n=_o.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function PB(e){return typeof e=="function"}function Nt(e,t=void 0,...n){return PB(e)?t?e.bind(t)(...n):e(...n):e}function ene(e={}){return Object.keys(e).length===0&&e.constructor===Object}function sc(e){let t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function BB(e){let t=[],{nodeExtensions:n,markExtensions:r}=sc(e),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(u=>u.name!=="text").map(u=>u.name),a=r.map(u=>u.name),l=[...s,...a];return e.forEach(u=>{let c={name:u.name,options:u.options,storage:u.storage,extensions:i},f=pe(u,"addGlobalAttributes",c);if(!f)return;f().forEach(p=>{let h;Array.isArray(p.types)?h=p.types:p.types==="*"?h=l:p.types==="nodes"?h=s:p.types==="marks"?h=a:h=[],h.forEach(g=>{Object.entries(p.attributes).forEach(([y,b])=>{t.push({type:g,name:y,attribute:{...o,...b}})})})})}),i.forEach(u=>{let c={name:u.name,options:u.options,storage:u.storage},f=pe(u,"addAttributes",c);if(!f)return;let d=f();Object.entries(d).forEach(([p,h])=>{let g={...o,...h};typeof g?.default=="function"&&(g.default=g.default()),g?.isRequired&&g?.default===void 0&&delete g.default,t.push({type:u.name,name:p,attribute:g})})}),t}function tne(e){let t=[],n="",r=!1,i=!1,o=0,s=e.length;for(let a=0;a0){o-=1,n+=l;continue}if(l===";"&&o===0){t.push(n),n="";continue}}n+=l}return n&&t.push(n),t}function xB(e){let t=[],n=tne(e||""),r=n.length;for(let i=0;i!!t).reduce((t,n)=>{let r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let a=o?String(o).split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(c=>!l.includes(c));r[i]=[...l,...u].join(" ")}else if(i==="style"){let a=new Map([...xB(r[i]),...xB(o)]);r[i]=Array.from(a.entries()).map(([l,u])=>`${l}: ${u}`).join("; ")}else r[i]=o}),r},{})}function w0(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>Vd(n,r),{})}function nne(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function _B(e,t){return"style"in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((o,s)=>{let a=s.attribute.parseHTML?s.attribute.parseHTML(n):nne(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function vB(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&ene(n)?!1:n!=null))}function CB(e){var t,n;let r={};return!((t=e?.attribute)!=null&&t.isRequired)&&"default"in(e?.attribute||{})&&(r.default=e.attribute.default),((n=e?.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function rne(e,t){var n;let r=BB(e),{nodeExtensions:i,markExtensions:o}=sc(e),s=(n=i.find(u=>pe(u,"topNode")))==null?void 0:n.name,a=Object.fromEntries(i.map(u=>{let c=r.filter(b=>b.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:t},d=e.reduce((b,E)=>{let T=pe(E,"extendNodeSchema",f);return{...b,...T?T(u):{}}},{}),p=vB({...d,content:Nt(pe(u,"content",f)),marks:Nt(pe(u,"marks",f)),group:Nt(pe(u,"group",f)),inline:Nt(pe(u,"inline",f)),atom:Nt(pe(u,"atom",f)),selectable:Nt(pe(u,"selectable",f)),draggable:Nt(pe(u,"draggable",f)),code:Nt(pe(u,"code",f)),whitespace:Nt(pe(u,"whitespace",f)),linebreakReplacement:Nt(pe(u,"linebreakReplacement",f)),defining:Nt(pe(u,"defining",f)),isolating:Nt(pe(u,"isolating",f)),attrs:Object.fromEntries(c.map(CB))}),h=Nt(pe(u,"parseHTML",f));h&&(p.parseDOM=h.map(b=>_B(b,c)));let g=pe(u,"renderHTML",f);g&&(p.toDOM=b=>g({node:b,HTMLAttributes:w0(b,c)}));let y=pe(u,"renderText",f);return y&&(p.toText=y),[u.name,p]})),l=Object.fromEntries(o.map(u=>{let c=r.filter(y=>y.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:t},d=e.reduce((y,b)=>{let E=pe(b,"extendMarkSchema",f);return{...y,...E?E(u):{}}},{}),p=vB({...d,inclusive:Nt(pe(u,"inclusive",f)),excludes:Nt(pe(u,"excludes",f)),group:Nt(pe(u,"group",f)),spanning:Nt(pe(u,"spanning",f)),code:Nt(pe(u,"code",f)),attrs:Object.fromEntries(c.map(CB))}),h=Nt(pe(u,"parseHTML",f));h&&(p.parseDOM=h.map(y=>_B(y,c)));let g=pe(u,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:w0(y,c)})),[u.name,p]}));return new Wu({topNode:s,nodes:a,marks:l})}function ine(e){let t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function Hd(e){return e.sort((n,r)=>{let i=pe(n,"priority")||100,o=pe(r,"priority")||100;return i>o?-1:ir.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),t}function FB(e,t,n){let{from:r,to:i}=t,{blockSeparator:o=` - -`,textSerializers:s={}}=n||{},a="";return e.nodesBetween(r,i,(l,u,c,f)=>{var d;l.isBlock&&u>r&&(a+=o);let p=s?.[l.type.name];if(p)return c&&(a+=p({node:l,pos:u,parent:c,index:f,range:t})),!1;l.isText&&(a+=(d=l?.text)==null?void 0:d.slice(Math.max(r,u)-u,i-u))}),a}function one(e,t){let n={from:0,to:e.content.size};return FB(e,n,t)}function HB(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function sne(e,t){let n=ln(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,a=>{o.push(a)});let s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function ane(e,t){let n=M0(typeof t=="string"?t:t.name,e.schema);return n==="node"?sne(e,t):n==="mark"?LB(e,t):{}}function lne(e,t=JSON.stringify){let n={};return e.filter(r=>{let i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function une(e){let t=lne(e);return t.length===1?t:t.filter((n,r)=>!t.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function cne(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{let{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{let u=t.slice(o).map(a,-1),c=t.slice(o).map(l),f=t.invert().map(u,-1),d=t.invert().map(c);r.push({oldRange:{from:f,to:d},newRange:{from:u,to:c}})})}),une(r)}function Ud(e,t){return t.nodes[e]||t.marks[e]||null}function C0(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}var fne=(e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,s,a)=>{var l,u;let c=((u=(l=i.type.spec).toText)==null?void 0:u.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,r-o))}),n};function W_(e,t,n={}){let{empty:r,ranges:i}=e.selection,o=t?Do(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>A0(f.attrs,n,{strict:!1}));let s=0,a=[];if(i.forEach(({$from:f,$to:d})=>{let p=f.pos,h=d.pos;e.doc.nodesBetween(p,h,(g,y)=>{if(o&&g.inlineContent&&!g.type.allowsMarkType(o))return!1;if(!g.isText&&!g.marks.length)return;let b=Math.max(p,y),E=Math.min(h,y+g.nodeSize),T=E-b;s+=T,a.push(...g.marks.map(S=>({mark:S,from:b,to:E})))})}),s===0)return!1;let l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>A0(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+u:l)>=s}function dne(e,t,n={}){if(!t)return qd(e,null,n)||W_(e,null,n);let r=M0(t,e.schema);return r==="node"?qd(e,t,n):r==="mark"?W_(e,t,n):!1}function AB(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function G_(e,t){let{nodeExtensions:n}=sc(t),r=n.find(s=>s.name===e);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=Nt(pe(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function ev(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return!/\S/.test((r=e.text)!=null?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(o=>{i!==!1&&(ev(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}var zB=class qB{constructor(t){this.position=t}static fromJSON(t){return new qB(t.position)}toJSON(){return{position:this.position}}};function pne(e,t){let n=t.mapping.mapResult(e.position);return{position:new zB(n.pos),mapResult:n}}function hne(e){return new zB(e)}function mne(e,t,n){var r;let{selection:i}=t,o=null;if(MB(i)&&(o=i.$cursor),o){let a=(r=e.storedMarks)!=null?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(u=>u.type.excludes(n)))}let{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(a.pos,l.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){let p=!d||d.type.allowsMarkType(n),h=!!n.isInSet(c.marks)||!c.marks.some(g=>g.type.excludes(n));u=p&&h}return!u}),u})}var gne=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:a}=o,l=Do(e,r.schema);if(i)if(s){let u=LB(r,l);n.addStoredMark(l.create({...u,...t}))}else a.forEach(u=>{let c=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(c,f,(d,p)=>{let h=Math.max(p,c),g=Math.min(p+d.nodeSize,f);d.marks.find(b=>b.type===l)?d.marks.forEach(b=>{l===b.type&&n.addMark(h,g,l.create({...b.attrs,...t}))}):n.addMark(h,g,l.create(t))})});return mne(r,n,l)},bne=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),yne=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let o=ln(e,n.schema),s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>u_(o,{...s,...t})(n)?!0:a.clearNodes()).command(({state:a})=>u_(o,{...s,...t})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Ene=e=>({tr:t,dispatch:n})=>{if(n){let{doc:r}=t,i=rl(e,0,r.content.size),o=ge.create(r,i);t.setSelection(o)}return!0},Tne=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=r,s,a;return typeof t=="number"?(s=t,a=t):t&&"from"in t&&"to"in t?(s=t.from,a=t.to):(s=o.from,a=o.to),i&&n.doc.nodesBetween(s,a,(l,u)=>{l.isText||n.setNodeMarkup(u,void 0,{...l.attrs,dir:e})}),!0},Sne=e=>({tr:t,dispatch:n})=>{if(n){let{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,s=Te.atStart(r).from,a=Te.atEnd(r).to,l=rl(i,s,a),u=rl(o,s,a),c=Te.create(r,l,u);t.setSelection(c)}return!0},xne=e=>({state:t,dispatch:n})=>{let r=ln(e,t.schema);return o4(r)(t,n)};function NB(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(i=>t?.includes(i.type.name));e.tr.ensureMarks(r)}}var _ne=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=t,{$from:a,$to:l}=o,u=i.extensionManager.attributes,c=C0(u,a.node().type.name,a.node().attrs);if(o instanceof ge&&o.node.isBlock)return!a.parentOffset||!Ir(s,a.pos)?!1:(r&&(e&&NB(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;let f=l.parentOffset===l.parent.content.size,d=a.depth===0?void 0:Zte(a.node(-1).contentMatchAt(a.indexAfter(-1))),p=f&&d?[{type:d,attrs:c}]:void 0,h=Ir(t.doc,t.mapping.map(a.pos),1,p);if(!p&&!h&&Ir(t.doc,t.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(h=!0,p=d?[{type:d,attrs:c}]:void 0),r){if(h&&(o instanceof Te&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,p),d&&!f&&!a.parentOffset&&a.parent.type!==d)){let g=t.mapping.map(a.before()),y=t.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,d)&&t.setNodeMarkup(t.mapping.map(a.before()),d)}e&&NB(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return h},vne=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let a=ln(e,r.schema),{$from:l,$to:u}=r.selection,c=r.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(u))return!1;let f=l.node(-1);if(f.type!==a)return!1;let d=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let b=J.empty,E=l.index(-1)?1:l.index(-2)?2:3;for(let O=l.depth-E;O>=l.depth-3;O-=1)b=J.from(l.node(O).copy(b));let T=l.indexAfter(-1){if(R>-1)return!1;O.isTextblock&&O.content.size===0&&(R=B+1)}),R>-1&&n.setSelection(Te.near(n.doc.resolve(R))),n.scrollIntoView()}return!0}let p=u.pos===l.end()?f.contentMatchAt(0).defaultType:null,h={...C0(d,f.type.name,f.attrs),...t},g={...C0(d,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,u.pos);let y=p?[{type:a,attrs:h},{type:p,attrs:g}]:[{type:a,attrs:h}];if(!Ir(n.doc,l.pos,2))return!1;if(i){let{selection:b,storedMarks:E}=r,{splittableMarks:T}=o.extensionManager,S=E||b.$to.parentOffset&&b.$from.marks();if(n.split(l.pos,2,y).scrollIntoView(),!S||!i)return!0;let v=S.filter(x=>T.includes(x.type.name));n.ensureMarks(v)}return!0},K_=(e,t)=>{let n=Q_(s=>s.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&ui(e.doc,n.pos)&&e.join(n.pos),!0},Y_=(e,t)=>{let n=Q_(s=>s.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&ui(e.doc,r)&&e.join(r),!0};function Cne(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return Te.between(r,i)}var Ane=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:u,can:c})=>{let{extensions:f,splittableMarks:d}=i.extensionManager,p=ln(e,s.schema),h=ln(t,s.schema),{selection:g,storedMarks:y}=s,{$from:b,$to:E}=g,T=b.blockRange(E),S=y||g.$to.parentOffset&&g.$from.marks();if(!T)return!1;let v=Q_(q=>G_(q.type.name,f))(g),x=g.from===0&&g.to===s.doc.content.size,R=s.doc.content.content,O=R.length===1?R[0]:null,B=x&&O&&G_(O.type.name,f)?{node:O,pos:0,depth:0}:null,C=v??B,V=!!v&&T.depth>=1&&T.depth-v.depth<=1,Y=!!B;if((V||Y)&&C){if(C.node.type===p)return x&&Y?l().command(({tr:q,dispatch:L})=>{let H=Cne(q);return H?(q.setSelection(H),L&&L(q),!0):!1}).liftListItem(h).run():u.liftListItem(h);if(G_(C.node.type.name,f)&&p.validContent(C.node.content))return l().command(()=>(o.setNodeMarkup(C.pos,p),!0)).command(()=>K_(o,p)).command(()=>Y_(o,p)).run()}return!n||!S||!a?l().command(()=>c().wrapInList(p,r)?!0:u.clearNodes()).wrapInList(p,r).command(()=>K_(o,p)).command(()=>Y_(o,p)).run():l().command(()=>{let q=c().wrapInList(p,r),L=S.filter(H=>d.includes(H.type.name));return o.ensureMarks(L),q?!0:u.clearNodes()}).wrapInList(p,r).command(()=>K_(o,p)).command(()=>Y_(o,p)).run()},Nne=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=Do(e,r.schema);return W_(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},wne=(e,t,n={})=>({state:r,commands:i})=>{let o=ln(e,r.schema),s=ln(t,r.schema),a=qd(r,o,n),l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(s,l):i.setNode(o,{...l,...n})},Rne=(e,t={})=>({state:n,commands:r})=>{let i=ln(e,n.schema);return qd(n,i,t)?r.lift(i):r.wrapIn(i,t)},kne=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){let l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,e.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},Mne=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:o}=t,{empty:s,ranges:a}=o;if(s)return!0;let{nonClearableMarks:l}=r.extensionManager;if(n){let u=Object.values(r.schema.marks).filter(c=>i||!l.includes(c.name));a.forEach(c=>{for(let f of u)t.removeMark(c.$from.pos,c.$to.pos,f)})}return!0},One=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Do(e,r.schema),{$from:u,empty:c,ranges:f}=a;if(!i)return!0;if(c&&s){let{from:d,to:p}=a,h=(o=u.marks().find(y=>y.type===l))==null?void 0:o.attrs,g=kB(u,l,h);g&&(d=g.from,p=g.to),n.removeMark(d,p,l)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,l)});return n.removeStoredMark(l),!0},Dne=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,o,s;return typeof e=="number"?(o=e,s=e):e&&"from"in e&&"to"in e?(o=e.from,s=e.to):(o=i.from,s=i.to),r&&t.doc.nodesBetween(o,s,(a,l)=>{if(a.isText)return;let u={...a.attrs};delete u.dir,t.setNodeMarkup(l,void 0,u)}),!0},Ine=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=M0(typeof e=="string"?e:e.name,r.schema);if(!a)return!1;a==="node"&&(o=ln(e,r.schema)),a==="mark"&&(s=Do(e,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{let c=u.$from.pos,f=u.$to.pos,d,p,h,g;n.selection.empty?r.doc.nodesBetween(c,f,(y,b)=>{o&&o===y.type&&(l=!0,h=Math.max(b,c),g=Math.min(b+y.nodeSize,f),d=b,p=y)}):r.doc.nodesBetween(c,f,(y,b)=>{b=c&&b<=f&&(o&&o===y.type&&(l=!0,i&&n.setNodeMarkup(b,void 0,{...y.attrs,...t})),s&&y.marks.length&&y.marks.forEach(E=>{if(s===E.type&&(l=!0,i)){let T=Math.max(b,c),S=Math.min(b+y.nodeSize,f);n.addMark(T,S,s.create({...E.attrs,...t}))}}))}),p&&(d!==void 0&&i&&n.setNodeMarkup(d,void 0,{...p.attrs,...t}),s&&p.marks.length&&p.marks.forEach(y=>{s===y.type&&i&&n.addMark(h,g,s.create({...y.attrs,...t}))}))}),l},Lne=(e,t={})=>({state:n,dispatch:r})=>{let i=ln(e,n.schema);return n4(i,t)(n,r)},Pne=(e,t={})=>({state:n,dispatch:r})=>{let i=ln(e,n.schema);return r4(i,t)(n,r)},Bne=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(r=>r.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(r=>r!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};var Une=(e,t)=>{if(X_(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function x0(e){var t;let{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;let u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(t=u.nodeBefore||u.nodeAfter)!=null&&t.marks.find(d=>d.type.spec.code))return!1;let c=!1,f=fne(u)+o;return s.forEach(d=>{if(c)return;let p=Une(f,d.find);if(!p)return;let h=l.state.tr,g=R0({state:l.state,transaction:h}),y={from:r-(p[0].length-o.length),to:i},{commands:b,chain:E,can:T}=new k0({editor:n,state:g});d.handler({state:g,range:y,match:p,commands:b,chain:E,can:T})===null||!h.steps.length||(d.undoable&&h.setMeta(a,{transform:h,from:r,to:i,text:o}),l.dispatch(h),c=!0)}),c}function Fne(e){let{editor:t,rules:n}=e,r=new Qe({state:{init(){return null},apply(i,o,s){let a=i.getMeta(r);if(a)return a;let l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:c}=l;typeof c=="string"?c=c:c=J_(J.from(c),s.schema);let{from:f}=l,d=f+c.length;x0({editor:t,from:f,to:d,text:c,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return x0({editor:t,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&x0({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?x0({editor:t,from:s.pos,to:s.pos,text:` -`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Hne(e){return Object.prototype.toString.call(e).slice(8,-1)}function _0(e){return Hne(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function VB(e,t){let n={...e};return _0(e)&&_0(t)&&Object.keys(t).forEach(r=>{_0(t[r])&&_0(e[r])?n[r]=VB(e[r],t[r]):n[r]=t[r]}),n}var tv=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Nt(pe(this,"addOptions",{name:this.name}))}}get storage(){return{...Nt(pe(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>VB(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},zne=class GB extends tv{constructor(){super(...arguments),this.type="mark"}static create(t={}){let n=typeof t=="function"?t():t;return new GB(n)}static handleExit({editor:t,mark:n}){let{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(u=>u?.type.name===n.name))return!1;let l=s.find(u=>u?.type.name===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){let n=typeof t=="function"?t():t;return super.extend(n)}};function qne(e){return typeof e=="number"}var Vne=(e,t,n)=>{if(X_(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(i=>{let o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function Gne(e){let{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:u,can:c}=new k0({editor:t,state:n}),f=[];return n.doc.nodesBetween(r,i,(p,h)=>{var g,y,b,E,T;if((y=(g=p.type)==null?void 0:g.spec)!=null&&y.code||!(p.isText||p.isTextblock||p.isInline))return;let S=(T=(E=(b=p.content)==null?void 0:b.size)!=null?E:p.nodeSize)!=null?T:0,v=Math.max(r,h),x=Math.min(i,h+S);if(v>=x)return;let R=p.isText?p.text||"":p.textBetween(v-h,x-h,void 0,"\uFFFC");Vne(R,o.find,s).forEach(B=>{if(B.index===void 0)return;let C=v+B.index+1,V=C+B[0].length,Y={from:n.tr.mapping.map(C),to:n.tr.mapping.map(V)},q=o.handler({state:n,range:Y,match:B,commands:l,chain:u,can:c,pasteEvent:s,dropEvent:a});f.push(q)})}),f.every(p=>p!==null)}var v0=null,Kne=e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function Yne(e){let{editor:t,rules:n}=e,r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}let l=({state:c,from:f,to:d,rule:p,pasteEvt:h})=>{let g=c.tr,y=R0({state:c,transaction:g});if(!(!Gne({editor:t,state:y,from:Math.max(f-1,0),to:d.b-1,rule:p,pasteEvent:h,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(c=>new Qe({view(f){let d=h=>{var g;r=(g=f.dom.parentElement)!=null&&g.contains(h.target)?f.dom.parentElement:null,r&&(v0=t)},p=()=>{v0&&(v0=null)};return window.addEventListener("dragstart",d),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",d),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(f,d)=>{if(o=r===f.dom.parentElement,a=d,!o){let p=v0;p?.isEditable&&setTimeout(()=>{let h=p.state.selection;h&&p.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(f,d)=>{var p;let h=(p=d.clipboardData)==null?void 0:p.getData("text/html");return s=d,i=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(f,d,p)=>{let h=f[0],g=h.getMeta("uiEvent")==="paste"&&!i,y=h.getMeta("uiEvent")==="drop"&&!o,b=h.getMeta("applyPasteRules"),E=!!b;if(!g&&!y&&!E)return;if(E){let{text:v}=b;typeof v=="string"?v=v:v=J_(J.from(v),p.schema);let{from:x}=b,R=x+v.length,O=Kne(v);return l({rule:c,state:p,from:x,to:{b:R},pasteEvt:O})}let T=d.doc.content.findDiffStart(p.doc.content),S=d.doc.content.findDiffEnd(p.doc.content);if(!(!qne(T)||!S||T===S.b))return l({rule:c,state:p,from:T,to:S,pasteEvt:s})}}))}var O0=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=UB(e),this.schema=rne(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Ud(t.name,this.schema)},r=pe(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this;return Hd([...this.extensions].reverse()).flatMap(r=>{let i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Ud(r.name,this.schema)},o=[],s=pe(r,"addKeyboardShortcuts",i),a={};if(r.type==="mark"&&pe(r,"exitable",i)&&(a.ArrowRight=()=>zne.handleExit({editor:e,mark:r})),s){let d=Object.fromEntries(Object.entries(s()).map(([p,h])=>[p,()=>h({editor:e})]));a={...a,...d}}let l=bB(a);o.push(l);let u=pe(r,"addInputRules",i);if(AB(r,e.options.enableInputRules)&&u){let d=u();if(d&&d.length){let p=Fne({editor:e,rules:d}),h=Array.isArray(p)?p:[p];o.push(...h)}}let c=pe(r,"addPasteRules",i);if(AB(r,e.options.enablePasteRules)&&c){let d=c();if(d&&d.length){let p=Yne({editor:e,rules:d});o.push(...p)}}let f=pe(r,"addProseMirrorPlugins",i);if(f){let d=f();o.push(...d)}return o})}get attributes(){return BB(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=sc(this.extensions);return Object.fromEntries(t.filter(n=>!!pe(n,"addNodeView")).map(n=>{let r=this.attributes.filter(l=>l.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:ln(n.name,this.schema)},o=pe(n,"addNodeView",i);if(!o)return[];let s=o();if(!s)return[];let a=(l,u,c,f,d)=>{let p=w0(l,r);return s({node:l,view:u,getPos:c,decorations:f,innerDecorations:d,editor:e,extension:n,HTMLAttributes:p})};return[n.name,a]}))}dispatchTransaction(e){let{editor:t}=this;return Hd([...this.extensions].reverse()).reduceRight((r,i)=>{let o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Ud(i.name,this.schema)},s=pe(i,"dispatchTransaction",o);return s?a=>{s.call(o,{transaction:a,next:r})}:r},e)}transformPastedHTML(e){let{editor:t}=this;return Hd([...this.extensions]).reduce((r,i)=>{let o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Ud(i.name,this.schema)},s=pe(i,"transformPastedHTML",o);return s?(a,l)=>{let u=r(a,l);return s.call(o,u)}:r},e||(r=>r))}get markViews(){let{editor:e}=this,{markExtensions:t}=sc(this.extensions);return Object.fromEntries(t.filter(n=>!!pe(n,"addMarkView")).map(n=>{let r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Do(n.name,this.schema)},o=pe(n,"addMarkView",i);if(!o)return[];let s=(a,l,u)=>{let c=w0(a,r);return o()({mark:a,view:l,inline:u,editor:e,extension:n,HTMLAttributes:c,updateAttributes:f=>{ore(a,e,f)}})};return[n.name,s]}))}destroy(){this.extensions.forEach(e=>{let t=e;for(;t.parent;){let n=t.parent;n.child===t&&(n.child=null),t=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{var n,r;let i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Ud(t.name,this.schema)};t.type==="mark"&&(((n=Nt(pe(t,"keepOnSplit",i)))==null||n)&&this.splittableMarks.push(t.name),(r=Nt(pe(t,"clearable",i)))==null||r||this.nonClearableMarks.push(t.name));let o=pe(t,"onBeforeCreate",i),s=pe(t,"onCreate",i),a=pe(t,"onUpdate",i),l=pe(t,"onSelectionUpdate",i),u=pe(t,"onTransaction",i),c=pe(t,"onFocus",i),f=pe(t,"onBlur",i),d=pe(t,"onDestroy",i);o&&this.editor.on("beforeCreate",o),s&&this.editor.on("create",s),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),c&&this.editor.on("focus",c),f&&this.editor.on("blur",f),d&&this.editor.on("destroy",d)})}};O0.resolve=UB;O0.sort=Hd;O0.flatten=Z_;var $ne={};j_($ne,{ClipboardTextSerializer:()=>YB,Commands:()=>$B,Delete:()=>WB,Drop:()=>jB,Editable:()=>XB,FocusEvents:()=>ZB,Keymap:()=>JB,Paste:()=>e5,Tabindex:()=>t5,TextDirection:()=>n5,focusEventsPluginKey:()=>QB});var hr=class KB extends tv{constructor(){super(...arguments),this.type="extension"}static create(t={}){let n=typeof t=="function"?t():t;return new KB(n)}configure(t){return super.configure(t)}extend(t){let n=typeof t=="function"?t():t;return super.extend(n)}},YB=hr.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Qe({key:new Et("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,o=HB(n),{blockSeparator:s}=this.options,a={...s!==void 0?{blockSeparator:s}:{},textSerializers:o};return[...i.ranges].sort((u,c)=>u.$from.pos-c.$from.pos).map(({$from:u,$to:c})=>FB(r,{from:u.pos,to:c.pos},a)).join(s??` - -`)}}})]}}),$B=hr.create({name:"commands",addCommands(){return{...wB}}}),WB=hr.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;let o=()=>{var s,a,l,u;if((u=(l=(a=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,e))!=null?u:e.getMeta("y-sync$"))return;let c=Qte(e.before,[e,...t]);cne(c).forEach(p=>{c.mapping.mapResult(p.oldRange.from).deletedAfter&&c.mapping.mapResult(p.oldRange.to).deletedBefore&&c.before.nodesBetween(p.oldRange.from,p.oldRange.to,(h,g)=>{let y=g+h.nodeSize-2,b=p.oldRange.from<=g&&y<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:h,from:g,to:y,newFrom:c.mapping.map(g),newTo:c.mapping.map(y),deletedRange:p.oldRange,newRange:p.newRange,partial:!b,editor:this.editor,transaction:e,combinedTransform:c})})});let d=c.mapping;c.steps.forEach((p,h)=>{var g,y;if(p instanceof Co){let b=d.slice(h).map(p.from,-1),E=d.slice(h).map(p.to),T=d.invert().map(b,-1),S=d.invert().map(E),v=b>0?(g=c.doc.nodeAt(b-1))==null?void 0:g.marks.some(R=>R.eq(p.mark)):!1,x=(y=c.doc.nodeAt(E))==null?void 0:y.marks.some(R=>R.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:T,to:S},newRange:{from:b,to:E},partial:!!(x||v),editor:this.editor,transaction:e,combinedTransform:c})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(o,0):o()}}),jB=hr.create({name:"drop",addProseMirrorPlugins(){return[new Qe({key:new Et("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),XB=hr.create({name:"editable",addProseMirrorPlugins(){return[new Qe({key:new Et("editable"),props:{editable:()=>this.editor.options.editable}})]}}),QB=new Et("focusEvents"),ZB=hr.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new Qe({key:QB,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),JB=hr.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{let{selection:l,doc:u}=a,{empty:c,$anchor:f}=l,{pos:d,parent:p}=f,h=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,g=h.parent.type.spec.isolating,y=f.pos-f.parentOffset,b=g&&h.parent.childCount===1?y===f.pos:Oe.atStart(u).from===d;return!c||!p.type.isTextblock||p.textContent.length||!b||b&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return N0()||IB()?o:i},addProseMirrorPlugins(){return[new Qe({key:new Et("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(g=>g.getMeta("composition")))return;let r=e.some(g=>g.docChanged)&&!t.doc.eq(n.doc),i=e.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:a}=t.selection,l=Oe.atStart(t.doc).from,u=Oe.atEnd(t.doc).to;if(o||!(s===l&&a===u)||!ev(n.doc))return;let d=n.tr,p=R0({state:n,transaction:d}),{commands:h}=new k0({editor:this.editor,state:p});if(h.clearNodes(),!!d.steps.length)return d}})]}}),e5=hr.create({name:"paste",addProseMirrorPlugins(){return[new Qe({key:new Et("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),t5=hr.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Qe({key:new Et("tabindex"),props:{attributes:()=>{var e;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(e=this.options.value)!=null?e:"0"}}}})]}}),n5=hr.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=sc(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{let n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new Qe({key:new Et("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),Wne=class Fd{constructor(t,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!=null?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new Fd(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new Fd(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new Fd(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+r+(o?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;let l=this.resolvedPos.doc.resolve(a);if(!i&&!s&&l.depth<=this.depth)return;let u=new Fd(l,this.editor,i,i||s?n:null);i&&(u.actualDepth=this.depth+1),t.push(u)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===t)if(Object.keys(n).length>0){let o=i.node.attrs,s=Object.keys(n);for(let a=0;a{r&&i.length>0||(s.node.type.name===t&&o.every(l=>n[l]===s.node.attrs[l])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(t,n,r))))}),i}setAttribute(t){let{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}},jne=`.ProseMirror { +${n}`}var ku=G(ie(),1),bX='
Running\u2026
',lg=(0,CL.memo)(function({toolName:t,toolTitle:n,intent:r,arguments:i}){return(0,ku.jsx)(ag,{toolName:t,toolTitle:n,intent:r,icon:bX,children:(0,ku.jsxs)("div",{className:"shiny-tool-request__arguments",children:[(0,ku.jsx)("strong",{children:"Tool arguments"}),(0,ku.jsx)(Kt,{content:Da(i,"json"),contentType:"markdown",streaming:!1})]})})});var US=G(ie(),1);function AL({"request-id":e,"tool-name":t,"tool-title":n,intent:r,arguments:i}){let{supersededRequests:o}=Oh();return!e||!t||o.has(e)?null:(0,US.jsx)("div",{className:"shiny-tool-request",children:(0,US.jsx)(lg,{toolName:t,toolTitle:n,intent:r,arguments:i??"{}"})})}var ug=G(fe(),1);var Ye=G(ie(),1);function yX({filename:e}){return(0,Ye.jsxs)("div",{className:"shiny-chat-pdf badge fs-6 text-bg-secondary",children:[(0,Ye.jsx)("span",{className:"shiny-chat-pdf__icon me-1",dangerouslySetInnerHTML:{__html:SL}}),(0,Ye.jsx)("span",{className:"shiny-chat-pdf__filename font-monospace",children:e})]})}function EX({value:e,valueType:t}){return t==="html"?(0,Ye.jsx)(Ma,{html:e}):t==="text"?(0,Ye.jsx)("p",{children:e}):t==="markdown"?(0,Ye.jsx)(Kt,{content:e,contentType:"markdown",streaming:!1}):(0,Ye.jsx)(Kt,{content:Da(e,"text"),contentType:"markdown",streaming:!1})}var cg=(0,ug.memo)(function({toolName:t,toolTitle:n,label:r,intent:i,status:o,value:s,valueType:a,requestCall:l,showRequest:u=!1,fullScreen:c=!1,expanded:f=!1,icon:d,footer:p}){let h=(0,ug.useRef)(null),{enterFullscreen:g,overlay:y}=vL(h),b=o==="error";return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsxs)(ag,{toolName:t,toolTitle:n,label:r,intent:i,icon:b?og:d,classStatus:b?"text-danger":"",statusNote:b?"failed":void 0,fullScreen:c,initialExpanded:f,footer:p,onEnterFullscreen:g,cardRef:h,children:[TX(l,u),(0,Ye.jsx)(FS,{value:s,valueType:a,showRequest:u})]}),y]})});function TX(e,t){if(!t||!e)return null;let n=Da(e,""),r=e.split(` +`).length>2;return(0,Ye.jsx)("div",{className:"shiny-tool-result__request",children:r?(0,Ye.jsxs)("details",{children:[(0,Ye.jsx)("summary",{children:"Tool call"}),(0,Ye.jsx)(Kt,{content:n,contentType:"markdown",streaming:!1})]}):(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)("strong",{children:"Tool call"}),(0,Ye.jsx)(Kt,{content:n,contentType:"markdown",streaming:!1})]})})}function FS({value:e,valueType:t,showRequest:n}){let r=e||"[Empty result]",i;if(t==="html")i=(0,Ye.jsx)(Ma,{html:r});else if(t==="text")i=(0,Ye.jsx)("p",{children:r});else if(t==="content_extra")try{let s=JSON.parse(e);i=(0,Ye.jsx)("div",{className:"shiny-chat-content-extra",children:s.map((a,l)=>a.type==="image"?(0,Ye.jsx)("img",{src:a.src,className:"shiny-chat-tool-image"},l):a.type==="pdf"?(0,Ye.jsx)(yX,{filename:a.filename??""},l):a.type==="text"?(0,Ye.jsx)(EX,{value:a.value??"",valueType:a.value_type??"code"},l):null)})}catch{i=(0,Ye.jsx)(Kt,{content:Da(r,"text"),contentType:"markdown",streaming:!1})}else{let s=t!=="markdown"?Da(r,"text"):r;i=(0,Ye.jsx)(Kt,{content:s,contentType:"markdown",streaming:!1})}return!n&&t==="html"?i:(0,Ye.jsxs)("div",{className:"shiny-tool-result__result",children:[n?(0,Ye.jsx)("strong",{children:"Tool result"}):null,i]})}var HS=G(ie(),1);function NL({"request-id":e,"tool-name":t,"tool-title":n,label:r,intent:i,status:o,value:s,"value-type":a,"request-call":l,"show-request":u,"full-screen":c,expanded:f,"custom-display":d,icon:p,footer:h}){return ru(d)||!e||!t?null:(0,HS.jsx)("div",{className:"shiny-tool-result",children:(0,HS.jsx)(cg,{toolName:t,toolTitle:n,label:r,intent:i,status:o??"success",value:s??"",valueType:a??"markdown",requestCall:l,showRequest:ru(u),fullScreen:ru(c),expanded:ru(f),icon:p,footer:h})})}function nd(){return null}var Or=G(fe(),1);var Q=G(fe(),1);function fg(){return typeof window<"u"}function Ri(e){return dg(e)?(e.nodeName||"").toLowerCase():"#document"}function yn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ki(e){var t;return(t=(dg(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dg(e){return fg()?e instanceof Node||e instanceof yn(e).Node:!1}function pt(e){return fg()?e instanceof Element||e instanceof yn(e).Element:!1}function Ut(e){return fg()?e instanceof HTMLElement||e instanceof yn(e).HTMLElement:!1}function Mu(e){return!fg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yn(e).ShadowRoot}function rd(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=kr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function wL(e){return/^(table|td|th)$/.test(Ri(e))}function id(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var SX=/transform|translate|scale|rotate|perspective|filter/,xX=/paint|layout|strict|content/,Ia=e=>!!e&&e!=="none",zS;function pg(e){let t=pt(e)?kr(e):e;return Ia(t.transform)||Ia(t.translate)||Ia(t.scale)||Ia(t.rotate)||Ia(t.perspective)||!Ou()&&(Ia(t.backdropFilter)||Ia(t.filter))||SX.test(t.willChange||"")||xX.test(t.contain||"")}function RL(e){let t=wi(e);for(;Ut(t)&&!Mi(t);){if(pg(t))return t;if(id(t))return null;t=wi(t)}return null}function Ou(){return zS==null&&(zS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),zS}function Mi(e){return/^(html|body|#document)$/.test(Ri(e))}function kr(e){return yn(e).getComputedStyle(e)}function od(e){return pt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wi(e){if(Ri(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Mu(e)&&e.host||ki(e);return Mu(t)?t.host:t}function kL(e){let t=wi(e);return Mi(t)?(e.ownerDocument||e).body:Ut(t)&&rd(t)?t:kL(t)}function Rr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let i=kL(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=yn(i);if(o){let a=hg(s);return t.concat(s,s.visualViewport||[],rd(i)?i:[],a&&n?Rr(a):[])}else return t.concat(i,Rr(i,[],n))}function hg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Pu=G(fe(),1),$L=G(fe(),1);var Du=Math.min,Eo=Math.max,ad=Math.round,ld=Math.floor,Oi=e=>({x:e,y:e}),_X={left:"right",right:"left",bottom:"top",top:"bottom"};function DL(e,t,n){return Eo(e,Du(t,n))}function ud(e,t){return typeof e=="function"?e(t):e}function La(e){return e.split("-")[0]}function cd(e){return e.split("-")[1]}function qS(e){return e==="x"?"y":"x"}function VS(e){return e==="y"?"height":"width"}function To(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function GS(e){return qS(To(e))}function IL(e,t,n){n===void 0&&(n=!1);let r=cd(e),i=GS(e),o=VS(i),s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=sd(s)),[s,sd(s)]}function LL(e){let t=sd(e);return[mg(e),t,mg(t)]}function mg(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var ML=["left","right"],OL=["right","left"],vX=["top","bottom"],CX=["bottom","top"];function AX(e,t,n){switch(e){case"top":case"bottom":return n?t?OL:ML:t?ML:OL;case"left":case"right":return t?vX:CX;default:return[]}}function PL(e,t,n,r){let i=cd(e),o=AX(La(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(mg)))),o}function sd(e){let t=La(e);return _X[t]+e.slice(t.length)}function NX(e){var t,n,r,i;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(i=e.left)!=null?i:0}}function BL(e){return typeof e!="number"?NX(e):{top:e,right:e,bottom:e,left:e}}function Pa(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var wX=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],gg=wX.join(","),FL=typeof Element>"u",Iu=FL?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,bg=!FL&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},yg=function(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",s=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):yg(t.parentNode));return s},RX=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},HL=function(t,n,r){if(yg(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(gg));return n&&Iu.call(t,gg)&&i.unshift(t),i=i.filter(r),i},Eg=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!yg(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=Eg(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var c=Iu.call(s,gg);c&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),d=!yg(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&d){var p=Eg(f===!0?s.children:f.children,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:s,candidates:p})}else o.unshift.apply(o,s.children)}}return i},zL=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},qL=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||RX(t))&&!zL(t)?0:t.tabIndex},kX=function(t,n){var r=qL(t);return r<0&&n&&!zL(t)?0:r},MX=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},VL=function(t){return t.tagName==="INPUT"},OX=function(t){return VL(t)&&t.type==="hidden"},DX=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},IX=function(t,n){for(var r=0;rsummary:first-of-type"),u=l?t.parentElement:t;if(Iu.call(u,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var c=t;t;){var f=t.parentElement,d=bg(t);if(f&&!f.shadowRoot&&i(f)===!0)return UL(t);t.assignedSlot?t=t.assignedSlot:!f&&d!==t.ownerDocument?t=d.host:t=f}t=c}if(UX(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return UL(t);return!1},HX=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r=0)},GL=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=kX(a,s),u=s?GL(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(MX).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},Lu=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Eg([t],n.includeContainer,{filter:YS.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:zX}):r=HL(t,n.includeContainer,YS.bind(null,n)),GL(r)},KL=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Eg([t],n.includeContainer,{filter:KS.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=HL(t,n.includeContainer,KS.bind(null,n)),r},$S=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Iu.call(t,gg)===!1?!1:YS(n,t)};function jS(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function XS(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function QS(){return/apple/i.test(navigator.vendor)}function WS(){let e=/android/i;return e.test(jS())||e.test(XS())}function WL(){return jS().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function jL(){return XS().includes("jsdom/")}var YL="data-floating-ui-focusable",qX="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function So(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function En(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Mu(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Di(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Tg(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function XL(e){return e.matches("html,body")}function Tn(e){return e?.ownerDocument||document}function Sg(e){return Ut(e)&&e.matches(qX)}function ZS(e){return e?e.getAttribute("role")==="combobox"&&Sg(e):!1}function QL(e){if(!e||jL())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function xg(e){return e?e.hasAttribute(YL)?e:e.querySelector("["+YL+"]")||e:null}function Ba(e,t,n){return n===void 0&&(n=!0),e.filter(i=>{var o;return i.parentId===t&&(!n||((o=i.context)==null?void 0:o.open))}).flatMap(i=>[i,...Ba(e,i.id,n)])}function JS(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){let o=e.find(s=>s.id===i);i=o?.parentId,o&&(r=r.concat(o))}return r}function _g(e){e.preventDefault(),e.stopPropagation()}function ZL(e){return"nativeEvent"in e}function JL(e){return e.mozInputSource===0&&e.isTrusted?!0:WS()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function e3(e){return jL()?!1:!WS()&&e.width===0&&e.height===0||WS()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Bu(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var VX=typeof document<"u",GX=function(){},Vn=VX?$L.useLayoutEffect:GX,KX={...Pu};function Ns(e){let t=Pu.useRef(e);return Vn(()=>{t.current=e}),t}var YX=KX.useInsertionEffect,$X=YX||(e=>e());function Gn(e){let t=Pu.useRef(()=>{});return $X(()=>{t.current=e}),Pu.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function t3(e,t){let n=Lu(e,Uu()),r=n.length;if(r===0)return;let i=So(Tn(e)),o=n.indexOf(i),s=o===-1?t===1?0:r-1:o+t;return n[s]}function ex(e){return t3(Tn(e).body,1)||e}function tx(e){return t3(Tn(e).body,-1)||e}function Fu(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!En(n,r)}function n3(e){Lu(e,Uu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function nx(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{let r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}var lr=G(ie(),1);var hx=G(qi(),1);function r3(e,t,n){let{reference:r,floating:i}=e,o=To(t),s=GS(t),a=VS(s),l=La(t),u=o==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[a]/2-i[a]/2,p;switch(l){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}let h=cd(t);return h&&(p[s]+=d*(h==="end"?1:-1)*(n&&u?-1:1)),p}async function i3(e,t){var n;t===void 0&&(t={});let{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=ud(t,e),h=BL(p),y=a[d?f==="floating"?"reference":"floating":f],b=Pa(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),E=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),S=await(o.isElement==null?void 0:o.isElement(T))&&await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1},v=Pa(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:T,strategy:l}):E);return{top:(b.top-v.top+h.top)/S.y,bottom:(v.bottom-b.bottom+h.bottom)/S.y,left:(b.left-v.left+h.left)/S.x,right:(v.right-b.right+h.right)/S.x}}var WX=50,o3=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:i3},l=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=r3(u,r,l),d=r,p=0,h={};for(let g=0;gL<=0)){var V,Y;let L=(((V=o.flip)==null?void 0:V.index)||0)+1,H=R[L];if(H&&(!(f==="alignment"?E!==To(H):!1)||C.every(D=>To(D.placement)===E?D.overflows[0]>0:!0)))return{data:{index:L,overflows:C},reset:{placement:H}};let I=(Y=C.filter(P=>P.overflows[0]<=0).sort((P,D)=>P.overflows[1]-D.overflows[1])[0])==null?void 0:Y.placement;if(!I)switch(p){case"bestFit":{var q;let P=(q=C.filter(D=>{if(x){let U=To(D.placement);return U===E||U==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(U=>U>0).reduce((U,_)=>U+_,0)]).sort((D,U)=>D[1]-U[1])[0])==null?void 0:q[0];P&&(I=P);break}case"initialPlacement":I=a;break}if(i!==I)return{reset:{placement:I}}}return{}}}};var jX=new Set(["left","top"]);async function XX(e,t){let{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=La(n),a=cd(n),l=To(n)==="y",u=jX.has(s)?-1:1,c=o&&l?-1:1,f=ud(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof h=="number"&&(p=a==="end"?h*-1:h),l?{x:p*c,y:d*u}:{x:d*u,y:p*c}}var a3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:i,y:o,placement:s,middlewareData:a}=t,l=await XX(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},l3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:E=>{let{x:T,y:S}=E;return{x:T,y:S}}},...u}=ud(e,t),c={x:n,y:r},f=await o.detectOverflow(t,u),d=To(i),p=qS(d),h=c[p],g=c[d],y=(E,T)=>DL(T+f[E==="y"?"top":"left"],T,T-f[E==="y"?"bottom":"right"]);s&&(h=y(p,h)),a&&(g=y(d,g));let b=l.fn({...t,[p]:h,[d]:g});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:s,[d]:a}}}}}};function f3(e){let t=kr(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ut(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=ad(n)!==o||ad(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function ix(e){return pt(e)?e:e.contextElement}function Hu(e){let t=ix(e);if(!Ut(t))return Oi(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=f3(t),s=(o?ad(n.width):n.width)/r,a=(o?ad(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var QX=Oi(0);function d3(e){let t=yn(e);return!Ou()||!t.visualViewport?QX:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZX(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===yn(e)}function Ua(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),o=ix(e),s=Oi(1);t&&(r?pt(r)&&(s=Hu(r)):s=Hu(e));let a=ZX(o,n,r)?d3(o):Oi(0),l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,f=i.height/s.y;if(o&&r){let d=yn(o),p=pt(r)?yn(r):r,h=d,g=hg(h);for(;g&&p!==h;){let y=Hu(g),b=g.getBoundingClientRect(),E=kr(g),T=b.left+(g.clientLeft+parseFloat(E.paddingLeft))*y.x,S=b.top+(g.clientTop+parseFloat(E.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,f*=y.y,l+=T,u+=S,h=yn(g),g=hg(h)}}return Pa({width:c,height:f,x:l,y:u})}function vg(e,t){let n=od(e).scrollLeft;return t?t.left+n:Ua(ki(e)).left+n}function p3(e,t){let n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-vg(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function JX(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o=i==="fixed",s=ki(r),a=t?id(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=Oi(1),c=Oi(0),f=Ut(r);if((f||!o)&&((Ri(r)!=="body"||rd(s))&&(l=od(r)),f)){let p=Ua(r);u=Hu(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}let d=s&&!f&&!o?p3(s,l):Oi(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:n.y*u.y-l.scrollTop*u.y+c.y+d.y}}function eQ(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function tQ(e){let t=od(e),n=e.ownerDocument.body,r=Eo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Eo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),o=-t.scrollLeft+vg(e),s=-t.scrollTop;return kr(n).direction==="rtl"&&(o+=Eo(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:o,y:s}}var nQ=25;function rQ(e,t,n){n===void 0&&(n="viewport");let r=n==="layoutViewport",i=yn(e),o=ki(e),s=i.visualViewport,a=o.clientWidth,l=o.clientHeight,u=0,c=0;if(s){let d=!Ou()||t==="fixed";r?d||(u=-s.offsetLeft,c=-s.offsetTop):(a=s.width,l=s.height,d&&(u=s.offsetLeft,c=s.offsetTop))}if(vg(o)<=0){let d=o.ownerDocument,p=d.body,h=getComputedStyle(p),g=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,y=Math.abs(o.clientWidth-p.clientWidth-g),b=getComputedStyle(o).scrollbarGutter==="stable both-edges"?y/2:y;b<=nQ&&(a-=b)}return{width:a,height:l,x:u,y:c}}function iQ(e,t){let n=Ua(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Hu(e),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:s,height:a,x:l,y:u}}function u3(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=rQ(e,n,t);else if(t==="document")r=tQ(ki(e));else if(pt(t))r=iQ(t,n);else{let i=d3(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Pa(r)}function oQ(e,t){let n=t.get(e);if(n)return n;let r=Rr(e,[],!1).filter(a=>pt(a)&&Ri(a)!=="body"),i=null,o=kr(e).position==="fixed",s=o?wi(e):e;for(;pt(s)&&!Mi(s);){let a=kr(s),l=pg(s),u=i?i.position:o?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&a.position==="static")?r=r.filter(f=>f!==s):i=a,s=wi(s)}return t.set(e,r),r}function sQ(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,s=[...n==="clippingAncestors"?id(t)?[]:oQ(t,this._c):[].concat(n),r],a=u3(t,s[0],i),l=a.top,u=a.right,c=a.bottom,f=a.left;for(let d=1;d{a(!1,1e-7)},1e3)}R=!1}try{r=new IntersectionObserver(O,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(O,x)}r.observe(e)}let l=yn(e),u=()=>a(n);return l.addEventListener("resize",u),a(!0),()=>{l.removeEventListener("resize",u),s()}}function Cg(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=ix(e),c=i||o?[...u?Rr(u):[],...t?Rr(t):[]]:[];c.forEach(b=>{i&&b.addEventListener("scroll",n),o&&b.addEventListener("resize",n)});let f=u&&a?fQ(u,n,o):null,d=-1,p=null;s&&(p=new ResizeObserver(b=>{let[E]=b;E&&E.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var T;(T=p)==null||T.observe(t)})),n()}),u&&!l&&p.observe(u),t&&p.observe(t));let h,g=l?Ua(e):null;l&&y();function y(){let b=Ua(e);g&&!m3(g,b)&&n(),g=b,h=requestAnimationFrame(y)}return n(),()=>{var b;c.forEach(E=>{i&&E.removeEventListener("scroll",n),o&&E.removeEventListener("resize",n)}),f?.(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var g3=a3;var b3=l3,y3=s3;var Ag=(e,t,n)=>{let r=new Map,i=n??{},o={...ox,...i.platform,_c:r};return o3(e,t,{...i,platform:o})};var Yt=G(fe(),1),T3=G(fe(),1),S3=G(qi(),1),pQ=typeof document<"u",hQ=function(){},Ng=pQ?T3.useLayoutEffect:hQ;function wg(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!wg(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!wg(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function x3(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function E3(e,t){let n=x3(e);return Math.round(t*n)/n}function sx(e){let t=Yt.useRef(e);return Ng(()=>{t.current=e}),t}function _3(e){e===void 0&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[c,f]=Yt.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=Yt.useState(r);wg(d,r)||p(r);let[h,g]=Yt.useState(null),[y,b]=Yt.useState(null),E=Yt.useCallback(D=>{D!==x.current&&(x.current=D,g(D))},[]),T=Yt.useCallback(D=>{D!==R.current&&(R.current=D,b(D))},[]),S=o||h,v=s||y,x=Yt.useRef(null),R=Yt.useRef(null),O=Yt.useRef(c),B=l!=null,C=sx(l),V=sx(i),Y=sx(u),q=Yt.useCallback(()=>{if(!x.current||!R.current)return;let D={placement:t,strategy:n,middleware:d};V.current&&(D.platform=V.current),Ag(x.current,R.current,D).then(U=>{let _={...U,isPositioned:Y.current!==!1};L.current&&!wg(O.current,_)&&(O.current=_,S3.flushSync(()=>{f(_)}))})},[d,t,n,V,Y]);Ng(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(D=>({...D,isPositioned:!1})))},[u]);let L=Yt.useRef(!1);Ng(()=>(L.current=!0,()=>{L.current=!1}),[]),Ng(()=>{if(S&&(x.current=S),v&&(R.current=v),S&&v){if(C.current)return C.current(S,v,q);q()}},[S,v,q,C,B]);let H=Yt.useMemo(()=>({reference:x,floating:R,setReference:E,setFloating:T}),[E,T]),I=Yt.useMemo(()=>({reference:S,floating:v}),[S,v]),P=Yt.useMemo(()=>{let D={position:n,left:0,top:0};if(!I.floating)return D;let U=E3(I.floating,c.x),_=E3(I.floating,c.y);return a?{...D,transform:"translate("+U+"px, "+_+"px)",...x3(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:_}},[n,a,I.floating,c.x,c.y]);return Yt.useMemo(()=>({...c,update:q,refs:H,elements:I,floatingStyles:P}),[c,q,H,I,P])}var Rg=(e,t)=>{let n=g3(e);return{name:n.name,fn:n.fn,options:[e,t]}},ax=(e,t)=>{let n=b3(e);return{name:n.name,fn:n.fn,options:[e,t]}};var lx=(e,t)=>{let n=y3(e);return{name:n.name,fn:n.fn,options:[e,t]}};var mQ="data-floating-ui-focusable",v3="active",C3="selected",gQ="ArrowLeft",bQ="ArrowRight",yQ="ArrowUp",EQ="ArrowDown";var TQ=[gQ,bQ],SQ=[yQ,EQ],fxe=[...TQ,...SQ];var xQ={...Q},A3=!1,_Q=0,N3=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+_Q++;function vQ(){let[e,t]=Q.useState(()=>A3?N3():void 0);return Vn(()=>{e==null&&t(N3())},[]),Q.useEffect(()=>{A3=!0},[]),e}var CQ=xQ.useId,mx=CQ||vQ;function AQ(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var NQ=Q.createContext(null),wQ=Q.createContext(null),gx=()=>{var e;return((e=Q.useContext(NQ))==null?void 0:e.id)||null},Dg=()=>Q.useContext(wQ);function Fa(e){return"data-floating-ui-"+e}function Mr(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var w3=Fa("safe-polygon");function ux(e,t,n){if(n&&!Bu(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){let r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function cx(e){return typeof e=="function"?e():e}function H3(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:o,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:u=null,mouseOnly:c=!1,restMs:f=0,move:d=!0}=t,p=Dg(),h=gx(),g=Ns(u),y=Ns(l),b=Ns(n),E=Ns(f),T=Q.useRef(),S=Q.useRef(-1),v=Q.useRef(),x=Q.useRef(-1),R=Q.useRef(!0),O=Q.useRef(!1),B=Q.useRef(()=>{}),C=Q.useRef(!1),V=Gn(()=>{var P;let D=(P=i.current.openEvent)==null?void 0:P.type;return D?.includes("mouse")&&D!=="mousedown"});Q.useEffect(()=>{if(!a)return;function P(D){let{open:U}=D;U||(Mr(S),Mr(x),R.current=!0,C.current=!1)}return o.on("openchange",P),()=>{o.off("openchange",P)}},[a,o]),Q.useEffect(()=>{if(!a||!g.current||!n)return;function P(U){V()&&r(!1,U,"hover")}let D=Tn(s.floating).documentElement;return D.addEventListener("mouseleave",P),()=>{D.removeEventListener("mouseleave",P)}},[s.floating,n,r,a,g,V]);let Y=Q.useCallback(function(P,D,U){D===void 0&&(D=!0),U===void 0&&(U="hover");let _=ux(y.current,"close",T.current);_&&!v.current?(Mr(S),S.current=window.setTimeout(()=>r(!1,P,U),_)):D&&(Mr(S),r(!1,P,U))},[y,r]),q=Gn(()=>{B.current(),v.current=void 0}),L=Gn(()=>{if(O.current){let P=Tn(s.floating).body;P.style.pointerEvents="",P.removeAttribute(w3),O.current=!1}}),H=Gn(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);Q.useEffect(()=>{if(!a)return;function P(ne){if(Mr(S),R.current=!1,c&&!Bu(T.current)||cx(E.current)>0&&!ux(y.current,"open"))return;let A=ux(y.current,"open",T.current);A?S.current=window.setTimeout(()=>{b.current||r(!0,ne,"hover")},A):n||r(!0,ne,"hover")}function D(ne){if(H()){L();return}B.current();let A=Tn(s.floating);if(Mr(x),C.current=!1,g.current&&i.current.floatingContext){n||Mr(S),v.current=g.current({...i.current.floatingContext,tree:p,x:ne.clientX,y:ne.clientY,onClose(){L(),q(),H()||Y(ne,!0,"safe-polygon")}});let se=v.current;A.addEventListener("mousemove",se),B.current=()=>{A.removeEventListener("mousemove",se)};return}(T.current==="touch"?!En(s.floating,ne.relatedTarget):!0)&&Y(ne)}function U(ne){H()||i.current.floatingContext&&(g.current==null||g.current({...i.current.floatingContext,tree:p,x:ne.clientX,y:ne.clientY,onClose(){L(),q(),H()||Y(ne)}})(ne))}function _(){Mr(S)}function te(ne){H()||Y(ne,!1)}if(pt(s.domReference)){let ne=s.domReference,A=s.floating;return n&&ne.addEventListener("mouseleave",U),d&&ne.addEventListener("mousemove",P,{once:!0}),ne.addEventListener("mouseenter",P),ne.addEventListener("mouseleave",D),A&&(A.addEventListener("mouseleave",U),A.addEventListener("mouseenter",_),A.addEventListener("mouseleave",te)),()=>{n&&ne.removeEventListener("mouseleave",U),d&&ne.removeEventListener("mousemove",P),ne.removeEventListener("mouseenter",P),ne.removeEventListener("mouseleave",D),A&&(A.removeEventListener("mouseleave",U),A.removeEventListener("mouseenter",_),A.removeEventListener("mouseleave",te))}}},[s,a,e,c,d,Y,q,L,r,n,b,p,y,g,i,H,E]),Vn(()=>{var P;if(a&&n&&(P=g.current)!=null&&(P=P.__options)!=null&&P.blockPointerEvents&&V()){O.current=!0;let U=s.floating;if(pt(s.domReference)&&U){var D;let _=Tn(s.floating).body;_.setAttribute(w3,"");let te=s.domReference,ne=p==null||(D=p.nodesRef.current.find(A=>A.id===h))==null||(D=D.context)==null?void 0:D.elements.floating;return ne&&(ne.style.pointerEvents=""),_.style.pointerEvents="none",te.style.pointerEvents="auto",U.style.pointerEvents="auto",()=>{_.style.pointerEvents="",te.style.pointerEvents="",U.style.pointerEvents=""}}}},[a,n,h,s,p,g,V]),Vn(()=>{n||(T.current=void 0,C.current=!1,q(),L())},[n,q,L]),Q.useEffect(()=>()=>{q(),Mr(S),Mr(x),L()},[a,s.domReference,q,L]);let I=Q.useMemo(()=>{function P(D){T.current=D.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(D){let{nativeEvent:U}=D;function _(){!R.current&&!b.current&&r(!0,U,"hover")}c&&!Bu(T.current)||n||cx(E.current)===0||C.current&&D.movementX**2+D.movementY**2<2||(Mr(x),T.current==="touch"?_():(C.current=!0,x.current=window.setTimeout(_,cx(E.current))))}}},[c,r,n,b,E]);return Q.useMemo(()=>a?{reference:I}:{},[a,I])}var R3=0;function zu(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(R3);let o=()=>e?.focus({preventScroll:n});i?o():R3=requestAnimationFrame(o)}function RQ(e){return e?.ownerDocument||document}var qu={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function k3(e){return e==="inert"?qu.inert:e==="aria-hidden"?qu["aria-hidden"]:qu.none}var kg=new WeakSet,Mg={},fx=0,kQ=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function z3(e){return e?Mu(e)?e.host:z3(e.parentNode):null}var MQ=(e,t)=>t.map(n=>{if(e.contains(n))return n;let r=z3(n);return e.contains(r)?r:null}).filter(n=>n!=null);function OQ(e,t,n,r){let i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=MQ(t,e),a=new Set,l=new Set(s),u=[];Mg[i]||(Mg[i]=new WeakMap);let c=Mg[i];s.forEach(f),d(t),a.clear();function f(p){!p||a.has(p)||(a.add(p),p.parentNode&&f(p.parentNode))}function d(p){!p||l.has(p)||[].forEach.call(p.children,h=>{if(Ri(h)!=="script")if(a.has(h))d(h);else{let g=o?h.getAttribute(o):null,y=g!==null&&g!=="false",b=k3(o),E=(b.get(h)||0)+1,T=(c.get(h)||0)+1;b.set(h,E),c.set(h,T),u.push(h),E===1&&y&&kg.add(h),T===1&&h.setAttribute(i,""),!y&&o&&h.setAttribute(o,o==="inert"?"":"true")}})}return fx++,()=>{u.forEach(p=>{let h=k3(o),y=(h.get(p)||0)-1,b=(c.get(p)||0)-1;h.set(p,y),c.set(p,b),y||(!kg.has(p)&&o&&p.removeAttribute(o),kg.delete(p)),b||p.removeAttribute(i)}),fx--,fx||(qu.inert=new WeakMap,qu["aria-hidden"]=new WeakMap,qu.none=new WeakMap,kg=new WeakSet,Mg={})}}function M3(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=RQ(e[0]).body;return OQ(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}var bx={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Og=Q.forwardRef(function(t,n){let[r,i]=Q.useState();Vn(()=>{QS()&&i("button")},[]);let o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Fa("focus-guard")]:"",style:bx};return(0,lr.jsx)("span",{...t,...o})}),DQ={clipPath:"inset(50%)",position:"fixed",top:0,left:0},q3=Q.createContext(null),O3=Fa("portal");function IQ(e){e===void 0&&(e={});let{id:t,root:n}=e,r=mx(),i=V3(),[o,s]=Q.useState(null),a=Q.useRef(null);return Vn(()=>()=>{o?.remove(),queueMicrotask(()=>{a.current=null})},[o]),Vn(()=>{if(!r||a.current)return;let l=t?document.getElementById(t):null;if(!l)return;let u=document.createElement("div");u.id=r,u.setAttribute(O3,""),l.appendChild(u),a.current=u,s(u)},[t,r]),Vn(()=>{if(n===null||!r||a.current)return;let l=n||i?.portalNode;l&&!dg(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));let c=document.createElement("div");c.id=r,c.setAttribute(O3,""),l=u||l,l.appendChild(c),a.current=c,s(c)},[t,n,r,i]),o}function Ig(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,o=IQ({id:n,root:r}),[s,a]=Q.useState(null),l=Q.useRef(null),u=Q.useRef(null),c=Q.useRef(null),f=Q.useRef(null),d=s?.modal,p=s?.open,h=!!s&&!s.modal&&s.open&&i&&!!(r||o);return Q.useEffect(()=>{if(!o||!i||d)return;function g(y){o&&Fu(y)&&(y.type==="focusin"?nx:n3)(o)}return o.addEventListener("focusin",g,!0),o.addEventListener("focusout",g,!0),()=>{o.removeEventListener("focusin",g,!0),o.removeEventListener("focusout",g,!0)}},[o,i,d]),Q.useEffect(()=>{o&&(p||nx(o))},[p,o]),(0,lr.jsxs)(q3.Provider,{value:Q.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:f,portalNode:o,setFocusManagerState:a}),[i,o]),children:[h&&o&&(0,lr.jsx)(Og,{"data-type":"outside",ref:l,onFocus:g=>{if(Fu(g,o)){var y;(y=c.current)==null||y.focus()}else{let b=s?s.domReference:null,E=tx(b);E?.focus()}}}),h&&o&&(0,lr.jsx)("span",{"aria-owns":o.id,style:DQ}),o&&hx.createPortal(t,o),h&&o&&(0,lr.jsx)(Og,{"data-type":"outside",ref:u,onFocus:g=>{if(Fu(g,o)){var y;(y=f.current)==null||y.focus()}else{let b=s?s.domReference:null,E=ex(b);E?.focus(),s?.closeOnFocusOut&&s?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}var V3=()=>Q.useContext(q3);function D3(e){return Q.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}var I3=20,ws=[];function yx(){ws=ws.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function LQ(e){yx(),e&&Ri(e)!=="body"&&(ws.push(new WeakRef(e)),ws.length>I3&&(ws=ws.slice(-I3)))}function L3(){yx();let e=ws[ws.length-1];return e?.deref()}function PQ(e){let t=Uu();return $S(e,t)?e:Lu(e,t)[0]||e}function P3(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;let r=Uu(),o=KL(e,r).filter(a=>{let l=a.getAttribute("data-tabindex")||"";return $S(a,r)||a.hasAttribute("data-tabindex")&&!l.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}var BQ=Q.forwardRef(function(t,n){return(0,lr.jsx)("button",{...t,type:"button",ref:n,tabIndex:-1,style:bx})});function Lg(e){let{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:f=!0,outsideElementsInert:d=!1,getInsideElements:p=()=>[]}=e,{open:h,onOpenChange:g,events:y,dataRef:b,elements:{domReference:E,floating:T}}=t,S=Gn(()=>{var he;return(he=b.current.floatingContext)==null?void 0:he.nodeId}),v=Gn(p),x=typeof s=="number"&&s<0,R=ZS(E)&&x,O=kQ(),B=O?o:!0,C=!B||O&&d,V=Ns(i),Y=Ns(s),q=Ns(a),L=Dg(),H=V3(),I=Q.useRef(null),P=Q.useRef(null),D=Q.useRef(!1),U=Q.useRef(!1),_=Q.useRef(-1),te=Q.useRef(-1),ne=H!=null,A=xg(T),re=Gn(function(he){return he===void 0&&(he=A),he?Lu(he,Uu()):[]}),se=Gn(he=>{let Ce=re(he);return V.current.map(Ae=>E&&Ae==="reference"?E:A&&Ae==="floating"?A:Ce).filter(Boolean).flat()});Q.useEffect(()=>{if(r||!u)return;function he(Ae){if(Ae.key==="Tab"){En(A,So(Tn(A)))&&re().length===0&&!R&&_g(Ae);let Ne=se(),me=Di(Ae);V.current[0]==="reference"&&me===E&&(_g(Ae),Ae.shiftKey?zu(Ne[Ne.length-1]):zu(Ne[1])),V.current[1]==="floating"&&me===A&&Ae.shiftKey&&(_g(Ae),zu(Ne[0]))}}let Ce=Tn(A);return Ce.addEventListener("keydown",he),()=>{Ce.removeEventListener("keydown",he)}},[r,E,A,u,V,R,re,se]),Q.useEffect(()=>{if(r||!T)return;function he(Ce){let Ae=Di(Ce),me=re().indexOf(Ae);me!==-1&&(_.current=me)}return T.addEventListener("focusin",he),()=>{T.removeEventListener("focusin",he)}},[r,T,re]),Q.useEffect(()=>{if(r||!f)return;function he(){U.current=!0,setTimeout(()=>{U.current=!1})}function Ce(me){let we=me.relatedTarget,ue=me.currentTarget,St=Di(me);queueMicrotask(()=>{let Ie=S(),j=!(En(E,we)||En(T,we)||En(we,T)||En(H?.portalNode,we)||we!=null&&we.hasAttribute(Fa("focus-guard"))||L&&(Ba(L.nodesRef.current,Ie).find(Se=>{var Xe,wt;return En((Xe=Se.context)==null?void 0:Xe.elements.floating,we)||En((wt=Se.context)==null?void 0:wt.elements.domReference,we)})||JS(L.nodesRef.current,Ie).find(Se=>{var Xe,wt,xt;return[(Xe=Se.context)==null?void 0:Xe.elements.floating,xg((wt=Se.context)==null?void 0:wt.elements.floating)].includes(we)||((xt=Se.context)==null?void 0:xt.elements.domReference)===we})));if(ue===E&&A&&P3(A,V),l&&ue!==E&&!(St!=null&&St.isConnected)&&So(Tn(A))===Tn(A).body){Ut(A)&&A.focus();let Se=_.current,Xe=re(),wt=Xe[Se]||Xe[Xe.length-1]||A;Ut(wt)&&wt.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(R||!u)&&we&&j&&!U.current&&we!==L3()&&(D.current=!0,g(!1,me,"focus-out"))})}let Ae=!!(!L&&H);function Ne(){Mr(te),b.current.insideReactTree=!0,te.current=window.setTimeout(()=>{b.current.insideReactTree=!1})}if(T&&Ut(E))return E.addEventListener("focusout",Ce),E.addEventListener("pointerdown",he),T.addEventListener("focusout",Ce),Ae&&T.addEventListener("focusout",Ne,!0),()=>{E.removeEventListener("focusout",Ce),E.removeEventListener("pointerdown",he),T.removeEventListener("focusout",Ce),Ae&&T.removeEventListener("focusout",Ne,!0)}},[r,E,T,A,u,L,H,g,f,l,re,R,S,V,b]);let xe=Q.useRef(null),Ve=Q.useRef(null),de=D3([xe,H?.beforeInsideRef]),ct=D3([Ve,H?.afterInsideRef]);Q.useEffect(()=>{var he,Ce;if(r||!T)return;let Ae=Array.from((H==null||(he=H.portalNode)==null?void 0:he.querySelectorAll("["+Fa("portal")+"]"))||[]),me=(Ce=(L?JS(L.nodesRef.current,S()):[]).find(St=>{var Ie;return ZS(((Ie=St.context)==null?void 0:Ie.elements.domReference)||null)}))==null||(Ce=Ce.context)==null?void 0:Ce.elements.domReference,we=[T,me,...Ae,...v(),I.current,P.current,xe.current,Ve.current,H?.beforeOutsideRef.current,H?.afterOutsideRef.current,V.current.includes("reference")||R?E:null].filter(St=>St!=null),ue=u||R?M3(we,!C,C):M3(we);return()=>{ue()}},[r,E,T,u,V,H,R,B,C,L,S,v]),Vn(()=>{if(r||!Ut(A))return;let he=Tn(A),Ce=So(he);queueMicrotask(()=>{let Ae=se(A),Ne=Y.current,me=(typeof Ne=="number"?Ae[Ne]:Ne.current)||A,we=En(A,Ce);!x&&!we&&h&&zu(me,{preventScroll:me===A})})},[r,h,A,x,se,Y]),Vn(()=>{if(r||!A)return;let he=Tn(A),Ce=So(he);LQ(Ce);function Ae(we){let{reason:ue,event:St,nested:Ie}=we;if(["hover","safe-polygon"].includes(ue)&&St.type==="mouseleave"&&(D.current=!0),ue==="outside-press")if(Ie)D.current=!1;else if(JL(St)||e3(St))D.current=!1;else{let j=!1;document.createElement("div").focus({get preventScroll(){return j=!0,!1}}),j?D.current=!1:D.current=!0}}y.on("openchange",Ae);let Ne=he.createElement("span");Ne.setAttribute("tabindex","-1"),Ne.setAttribute("aria-hidden","true"),Object.assign(Ne.style,bx),ne&&E&&E.insertAdjacentElement("afterend",Ne);function me(){if(typeof q.current=="boolean"){let we=E||L3();return we&&we.isConnected?we:Ne}return q.current.current||Ne}return()=>{y.off("openchange",Ae);let we=So(he),ue=En(T,we)||L&&Ba(L.nodesRef.current,S(),!1).some(Ie=>{var j;return En((j=Ie.context)==null?void 0:j.elements.floating,we)}),St=me();queueMicrotask(()=>{let Ie=PQ(St);q.current&&!D.current&&Ut(Ie)&&(!(Ie!==we&&we!==he.body)||ue)&&Ie.focus({preventScroll:!0}),Ne.remove()})}},[r,T,A,q,b,y,L,ne,E,S]),Q.useEffect(()=>(queueMicrotask(()=>{D.current=!1}),()=>{queueMicrotask(yx)}),[r]),Vn(()=>{if(!r&&H)return H.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:g,domReference:E}),()=>{H.setFocusManagerState(null)}},[r,H,u,h,g,f,E]),Vn(()=>{r||A&&P3(A,V)},[r,A,V]);function Ge(he){return r||!c||!u?null:(0,lr.jsx)(BQ,{ref:he==="start"?I:P,onClick:Ce=>g(!1,Ce.nativeEvent),children:typeof c=="string"?c:"Dismiss"})}let rt=!r&&B&&(u?!R:!0)&&(ne||u);return(0,lr.jsxs)(lr.Fragment,{children:[rt&&(0,lr.jsx)(Og,{"data-type":"inside",ref:de,onFocus:he=>{if(u){let Ae=se();zu(i[0]==="reference"?Ae[0]:Ae[Ae.length-1])}else if(H!=null&&H.preserveTabOrder&&H.portalNode)if(D.current=!1,Fu(he,H.portalNode)){let Ae=ex(E);Ae?.focus()}else{var Ce;(Ce=H.beforeOutsideRef.current)==null||Ce.focus()}}}),!R&&Ge("start"),n,Ge("end"),rt&&(0,lr.jsx)(Og,{"data-type":"inside",ref:ct,onFocus:he=>{if(u)zu(se()[0]);else if(H!=null&&H.preserveTabOrder&&H.portalNode)if(f&&(D.current=!0),Fu(he,H.portalNode)){let Ae=tx(E);Ae?.focus()}else{var Ce;(Ce=H.afterOutsideRef.current)==null||Ce.focus()}}})]})}function B3(e){return Ut(e.target)&&e.target.tagName==="BUTTON"}function UQ(e){return Ut(e.target)&&e.target.tagName==="A"}function U3(e){return Sg(e)}function G3(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:c=!0,stickIfOpen:f=!0}=t,d=Q.useRef(),p=Q.useRef(!1),h=Q.useMemo(()=>({onPointerDown(g){d.current=g.pointerType},onMouseDown(g){let y=d.current;g.button===0&&a!=="click"&&(Bu(y,!0)&&u||(n&&l&&(!(i.current.openEvent&&f)||i.current.openEvent.type==="mousedown")?r(!1,g.nativeEvent,"click"):(g.preventDefault(),r(!0,g.nativeEvent,"click"))))},onClick(g){let y=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}Bu(y,!0)&&u||(n&&l&&(!(i.current.openEvent&&f)||i.current.openEvent.type==="click")?r(!1,g.nativeEvent,"click"):r(!0,g.nativeEvent,"click"))},onKeyDown(g){d.current=void 0,!(g.defaultPrevented||!c||B3(g))&&(g.key===" "&&!U3(o)&&(g.preventDefault(),p.current=!0),!UQ(g)&&g.key==="Enter"&&r(!(n&&l),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!c||B3(g)||U3(o)||g.key===" "&&p.current&&(p.current=!1,r(!(n&&l),g.nativeEvent,"click"))}}),[i,o,a,u,c,r,n,f,l]);return Q.useMemo(()=>s?{reference:h}:{},[s,h])}var FQ={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},HQ={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},F3=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function K3(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:o}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:c=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:p,capture:h}=t,g=Dg(),y=Gn(typeof l=="function"?l:()=>!1),b=typeof l=="function"?y:l,E=Q.useRef(!1),{escapeKey:T,outsidePress:S}=F3(p),{escapeKey:v,outsidePress:x}=F3(h),R=Q.useRef(!1),O=Gn(L=>{var H;if(!n||!s||!a||L.key!=="Escape"||R.current)return;let I=(H=o.current.floatingContext)==null?void 0:H.nodeId,P=g?Ba(g.nodesRef.current,I):[];if(!T&&(L.stopPropagation(),P.length>0)){let D=!0;if(P.forEach(U=>{var _;if((_=U.context)!=null&&_.open&&!U.context.dataRef.current.__escapeKeyBubbles){D=!1;return}}),!D)return}r(!1,ZL(L)?L.nativeEvent:L,"escape-key")}),B=Gn(L=>{var H;let I=()=>{var P;O(L),(P=Di(L))==null||P.removeEventListener("keydown",I)};(H=Di(L))==null||H.addEventListener("keydown",I)}),C=Gn(L=>{var H;let I=o.current.insideReactTree;o.current.insideReactTree=!1;let P=E.current;if(E.current=!1,u==="click"&&P||I||typeof b=="function"&&!b(L))return;let D=Di(L),U="["+Fa("inert")+"]",_=Tn(i.floating).querySelectorAll(U),te=pt(D)?D:null;for(;te&&!Mi(te);){let se=wi(te);if(Mi(se)||!pt(se))break;te=se}if(_.length&&pt(D)&&!XL(D)&&!En(D,i.floating)&&Array.from(_).every(se=>!En(te,se)))return;if(Ut(D)&&q){let se=Mi(D),xe=kr(D),Ve=/auto|scroll/,de=se||Ve.test(xe.overflowX),ct=se||Ve.test(xe.overflowY),Ge=de&&D.clientWidth>0&&D.scrollWidth>D.clientWidth,rt=ct&&D.clientHeight>0&&D.scrollHeight>D.clientHeight,he=xe.direction==="rtl",Ce=rt&&(he?L.offsetX<=D.offsetWidth-D.clientWidth:L.offsetX>D.clientWidth),Ae=Ge&&L.offsetY>D.clientHeight;if(Ce||Ae)return}let ne=(H=o.current.floatingContext)==null?void 0:H.nodeId,A=g&&Ba(g.nodesRef.current,ne).some(se=>{var xe;return Tg(L,(xe=se.context)==null?void 0:xe.elements.floating)});if(Tg(L,i.floating)||Tg(L,i.domReference)||A)return;let re=g?Ba(g.nodesRef.current,ne):[];if(re.length>0){let se=!0;if(re.forEach(xe=>{var Ve;if((Ve=xe.context)!=null&&Ve.open&&!xe.context.dataRef.current.__outsidePressBubbles){se=!1;return}}),!se)return}r(!1,L,"outside-press")}),V=Gn(L=>{var H;let I=()=>{var P;C(L),(P=Di(L))==null||P.removeEventListener(u,I)};(H=Di(L))==null||H.addEventListener(u,I)});Q.useEffect(()=>{if(!n||!s)return;o.current.__escapeKeyBubbles=T,o.current.__outsidePressBubbles=S;let L=-1;function H(_){r(!1,_,"ancestor-scroll")}function I(){window.clearTimeout(L),R.current=!0}function P(){L=window.setTimeout(()=>{R.current=!1},Ou()?5:0)}let D=Tn(i.floating);a&&(D.addEventListener("keydown",v?B:O,v),D.addEventListener("compositionstart",I),D.addEventListener("compositionend",P)),b&&D.addEventListener(u,x?V:C,x);let U=[];return d&&(pt(i.domReference)&&(U=Rr(i.domReference)),pt(i.floating)&&(U=U.concat(Rr(i.floating))),!pt(i.reference)&&i.reference&&i.reference.contextElement&&(U=U.concat(Rr(i.reference.contextElement)))),U=U.filter(_=>{var te;return _!==((te=D.defaultView)==null?void 0:te.visualViewport)}),U.forEach(_=>{_.addEventListener("scroll",H)}),()=>{a&&(D.removeEventListener("keydown",v?B:O,v),D.removeEventListener("compositionstart",I),D.removeEventListener("compositionend",P)),b&&D.removeEventListener(u,x?V:C,x),U.forEach(_=>{_.removeEventListener("scroll",H)}),window.clearTimeout(L)}},[o,i,a,b,u,n,r,d,s,T,S,O,v,B,C,x,V]),Q.useEffect(()=>{o.current.insideReactTree=!1},[o,b,u]);let Y=Q.useMemo(()=>({onKeyDown:O,...c&&{[FQ[f]]:L=>{r(!1,L.nativeEvent,"reference-press")},...f!=="click"&&{onClick(L){r(!1,L.nativeEvent,"reference-press")}}}}),[O,r,c,f]),q=Q.useMemo(()=>{function L(H){H.button===0&&(E.current=!0)}return{onKeyDown:O,onMouseDown:L,onMouseUp:L,[HQ[u]]:()=>{o.current.insideReactTree=!0}}},[O,u,o]);return Q.useMemo(()=>s?{reference:Y,floating:q}:{},[s,Y,q])}function zQ(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=mx(),o=Q.useRef({}),[s]=Q.useState(()=>AQ()),a=gx()!=null,[l,u]=Q.useState(r.reference),c=Gn((p,h,g)=>{o.current.openEvent=p?h:void 0,s.emit("openchange",{open:p,event:h,reason:g,nested:a}),n?.(p,h,g)}),f=Q.useMemo(()=>({setPositionReference:u}),[]),d=Q.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return Q.useMemo(()=>({dataRef:o,open:t,onOpenChange:c,elements:d,events:s,floatingId:i,refs:f}),[t,c,d,s,i,f])}function Y3(e){var t,n;let{elements:r,...i}=e===void 0?{}:e,{nodeId:o}=i,s=zQ({...i,elements:{reference:(t=r?.reference)!=null?t:null,floating:(n=r?.floating)!=null?n:null}}),a=i.rootContext||s,l=a.elements,[u,c]=Q.useState(null),[f,d]=Q.useState(null),h=l?.domReference||u,g=Q.useRef(null),y=Dg();Vn(()=>{h&&(g.current=h)},[h]);let b=_3({...i,elements:{...l,...f&&{reference:f}}}),E=Q.useCallback(R=>{let O=pt(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(O),b.refs.setReference(O)},[b.refs]),T=Q.useCallback(R=>{(pt(R)||R===null)&&(g.current=R,c(R)),(pt(b.refs.reference.current)||b.refs.reference.current===null||R!==null&&!pt(R))&&b.refs.setReference(R)},[b.refs]),S=Q.useMemo(()=>({...b.refs,setReference:T,setPositionReference:E,domReference:g}),[b.refs,T,E]),v=Q.useMemo(()=>({...b.elements,domReference:h}),[b.elements,h]),x=Q.useMemo(()=>({...b,...a,refs:S,elements:v,nodeId:o}),[b,S,v,o,a]);return Vn(()=>{a.dataRef.current.floatingContext=x;let R=y?.nodesRef.current.find(O=>O.id===o);R&&(R.context=x)}),Q.useMemo(()=>({...b,context:x,refs:S,elements:v}),[b,S,v,x])}function dx(){return WL()&&QS()}function $3(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:o,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,u=Q.useRef(!1),c=Q.useRef(-1),f=Q.useRef(!0);Q.useEffect(()=>{if(!a)return;let p=yn(s.domReference);function h(){!n&&Ut(s.domReference)&&s.domReference===So(Tn(s.domReference))&&(u.current=!0)}function g(){f.current=!0}function y(){f.current=!1}return p.addEventListener("blur",h),dx()&&(p.addEventListener("keydown",g,!0),p.addEventListener("pointerdown",y,!0)),()=>{p.removeEventListener("blur",h),dx()&&(p.removeEventListener("keydown",g,!0),p.removeEventListener("pointerdown",y,!0))}},[s.domReference,n,a]),Q.useEffect(()=>{if(!a)return;function p(h){let{reason:g}=h;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return i.on("openchange",p),()=>{i.off("openchange",p)}},[i,a]),Q.useEffect(()=>()=>{Mr(c)},[]);let d=Q.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(p){if(u.current)return;let h=Di(p.nativeEvent);if(l&&pt(h)){if(dx()&&!p.relatedTarget){if(!f.current&&!Sg(h))return}else if(!QL(h))return}r(!0,p.nativeEvent,"focus")},onBlur(p){u.current=!1;let h=p.relatedTarget,g=p.nativeEvent,y=pt(h)&&h.hasAttribute(Fa("focus-guard"))&&h.getAttribute("data-type")==="outside";c.current=window.setTimeout(()=>{var b;let E=So(s.domReference?s.domReference.ownerDocument:document);!h&&E===s.domReference||En((b=o.current.floatingContext)==null?void 0:b.refs.floating.current,E)||En(s.domReference,E)||y||r(!1,g,"focus")})}}),[o,s.domReference,r,l]);return Q.useMemo(()=>a?{reference:d}:{},[a,d])}function px(e,t,n){let r=new Map,i=n==="item",o=e;if(i&&e){let{[v3]:s,[C3]:a,...l}=e;o=l}return{...n==="floating"&&{tabIndex:-1,[mQ]:""},...o,...t.map(s=>{let a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[u,c]=l;if(!(i&&[v3,C3].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof c=="function"){var f;(f=r.get(u))==null||f.push(c),s[u]=function(){for(var d,p=arguments.length,h=new Array(p),g=0;gy(...h)).find(y=>y!==void 0)}}}else s[u]=c}),s),{})}}function W3(e){e===void 0&&(e=[]);let t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),i=Q.useCallback(a=>px(a,e,"reference"),t),o=Q.useCallback(a=>px(a,e,"floating"),n),s=Q.useCallback(a=>px(a,e,"item"),r);return Q.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:s}),[i,o,s])}var qQ=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function j3(e,t){var n,r;t===void 0&&(t={});let{open:i,elements:o,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,u=mx(),c=((n=o.domReference)==null?void 0:n.id)||u,f=Q.useMemo(()=>{var E;return((E=xg(o.floating))==null?void 0:E.id)||s},[o.floating,s]),d=(r=qQ.get(l))!=null?r:l,h=gx()!=null,g=Q.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:i?f:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":i?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:c},...d==="menu"&&h&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,h,i,c,l]),y=Q.useMemo(()=>{let E={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?E:{...E,...d==="menu"&&{"aria-labelledby":c}}},[d,f,c,l]),b=Q.useCallback(E=>{let{active:T,selected:S}=E,v={role:"option",...T&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...v,"aria-selected":S}}return{}},[f,l]);return Q.useMemo(()=>a?{reference:g,floating:y,item:b}:{},[a,g,y,b])}var Mn=G(fe(),1);function Vu(e){try{return new URL(e).hostname||e}catch{return e}}function X3(e){return e.filter(t=>t.citation!=null).map(t=>({url:t.url??"",domain:t.label??Vu(t.url??""),title:t.citation?.title})).filter(t=>t.url!=="")}function Q3(e){let t=new Map;for(let n of e){let r=t.get(n.url);r?!r.title&&n.title&&(r.title=n.title):t.set(n.url,{...n})}return[...t.values()]}var Ex=G(ie(),1),Z3=(0,Mn.createContext)(null),J3=(0,Mn.createContext)([]);function e6({children:e}){let t=(0,Mn.useRef)(new Map),[n,r]=(0,Mn.useState)([]),i=(0,Mn.useCallback)(()=>{let l=[];for(let u of t.current.values())l.push(...u);r(Q3(l))},[]),o=(0,Mn.useCallback)((l,u)=>{t.current.set(l,u),i()},[i]),s=(0,Mn.useCallback)(l=>{t.current.delete(l)&&i()},[i]),a=(0,Mn.useMemo)(()=>({register:o,unregister:s}),[o,s]);return(0,Ex.jsx)(Z3.Provider,{value:a,children:(0,Ex.jsx)(J3.Provider,{value:n,children:e})})}function t6(){return(0,Mn.useContext)(Z3)}function n6(){return(0,Mn.useContext)(J3)}function Pg(e){let t={};if(!(e instanceof HTMLElement))return{style:t};let n=getComputedStyle(e);for(let i=0;it.type==="text"?t.value:t.type==="element"?i6(t):"").join("")}function KQ(e){return e?(e.children??[]).filter(t=>t.type==="element"&&t.tagName==="shiny-aside").map(t=>{let n=fd(t,"url"),r=fd(t,"label"),i=i6(t).trim(),o=t.properties?.dataCitation==null?void 0:{title:i===""||i===n?void 0:i,cited_quote:fd(t,"cited-quote")};return{label:r??(o&&n?Vu(n):void 0),url:n,icon:fd(t,"icon"),body:t.children.length>0?bf(t.children):void 0,index:GQ(t,"index"),citation:o,groundingId:fd(t,"dataGroundingId")}}):[]}function Sx(e){try{return`https://icons.duckduckgo.com/ip3/${encodeURIComponent(new URL(e).hostname)}.ico`}catch{return}}function Tx({entry:e,deriveFavicon:t}){let n=e.icon||(t&&e.url?Sx(e.url):void 0),[r,i]=(0,Or.useState)(null);return!n||r===n?null:(0,qe.jsx)("img",{src:n,alt:"",onError:()=>i(n)})}function r6({direction:e}){return(0,qe.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",style:e==="prev"?{transform:"scaleX(-1)"}:void 0,children:(0,qe.jsx)("path",{d:"M4.5 2.5L8 6L4.5 9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var o6=(0,Or.memo)(function({node:t}){let n=KQ(t),r=t?.properties?.[Uf]!=null;return(0,qe.jsx)(YQ,{entries:n,pending:r})}),YQ=(0,Or.memo)(function({entries:t,pending:n=!1}){let r=ou(),i=t.findIndex(O=>O.label),[o,s]=(0,Or.useState)(!1),[a,l]=(0,Or.useState)(0),u=t6(),c=(0,Or.useId)(),f=n?"":JSON.stringify(X3(t)),d=t[a]?.groundingId,{refs:p,floatingStyles:h,context:g,getReferenceProps:y,getFloatingProps:b}=Bg(o,s);if((0,Or.useEffect)(()=>{if(!u||f==="")return;let O=JSON.parse(f);if(O.length!==0)return u.register(c,O),()=>u.unregister(c)},[u,c,f]),(0,Or.useEffect)(()=>{o&&l(i===-1?0:i)},[o,i]),(0,Or.useEffect)(()=>{if(!o||!d)return;let O=p.domReference.current;if(!(O instanceof HTMLElement))return;let B=O.closest("p, li");if(!B)return;let C=[...B.querySelectorAll("[data-aside-grounding]")].filter(V=>V.dataset.asideGrounding?.split(" ").includes(d));for(let V of C)V.dataset.active="";return()=>{for(let V of C)delete V.dataset.active}},[o,d,p.domReference]),n||t.length===0)return null;let E=t.length-1,T=i!==-1&&t.every(O=>O.label===t[i].label),S=E>0&&!T,v=t[a],x=Pg(p.domReference.current),R=i===-1?`Aside ${t[0].index}`:S?`${t[i].label} (+${E} more)`:t[i].label;return(0,qe.jsxs)("span",{className:"shiny-aside-group",children:[(0,qe.jsxs)("button",{ref:p.setReference,type:"button",className:i===-1?"shiny-aside-pill shiny-aside-pill--count":"shiny-aside-pill","aria-label":R,...y(),children:[i!==-1&&(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(Tx,{entry:t[i],deriveFavicon:r}),(0,qe.jsx)("span",{className:"shiny-aside-pill__label",children:t[i].label}),S&&(0,qe.jsxs)("span",{className:"shiny-aside-pill__overflow",children:["+",E]})]}),i===-1&&t[0].index]}),o&&(0,qe.jsx)(Ig,{children:(0,qe.jsx)(Lg,{context:g,modal:!1,initialFocus:-1,returnFocus:!0,children:(0,qe.jsxs)("div",{ref:p.setFloating,className:"shiny-aside-popover",style:{...x.style,...h},"data-bs-theme":x.theme,"aria-label":R,...b(),children:[t.length>1&&(0,qe.jsxs)("div",{className:"shiny-aside-popover__nav",children:[(0,qe.jsxs)("div",{className:"shiny-aside-popover__nav-arrows",children:[(0,qe.jsx)("button",{type:"button","aria-label":"Previous source",onClick:()=>l(O=>(O-1+t.length)%t.length),children:(0,qe.jsx)(r6,{direction:"prev"})}),(0,qe.jsx)("button",{type:"button","aria-label":"Next source",onClick:()=>l(O=>(O+1)%t.length),children:(0,qe.jsx)(r6,{direction:"next"})})]}),(0,qe.jsxs)("span",{className:"shiny-aside-popover__count","aria-hidden":"true",children:[a+1," / ",t.length]}),(0,qe.jsxs)("span",{className:"visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",children:["Source ",a+1," of ",t.length,":"," ",v.label??"Untitled source"]})]}),v.label&&(0,qe.jsx)(qe.Fragment,{children:v.url?(0,qe.jsxs)("a",{className:"shiny-aside-popover__label",href:v.url,...Ni,children:[(0,qe.jsx)(Tx,{entry:v,deriveFavicon:r}),(0,qe.jsx)("span",{className:"shiny-aside-popover__label-text",children:v.label})]}):(0,qe.jsxs)("div",{className:"shiny-aside-popover__label",children:[(0,qe.jsx)(Tx,{entry:v,deriveFavicon:r}),(0,qe.jsx)("span",{className:"shiny-aside-popover__label-text",children:v.label})]})}),v.body&&(0,qe.jsx)("div",{className:"shiny-aside-popover__body",children:(0,qe.jsx)(Kt,{content:v.body,contentType:"html",streaming:!1})})]})})})]})});var Ug=G(fe(),1);var xx=G(ie(),1);function s6({className:e,expanded:t}){return(0,xx.jsx)("svg",{className:e,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",...t?{"data-expanded":""}:{},children:(0,xx.jsx)("path",{d:"M4.5 2.5L8 6L4.5 9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var At=G(ie(),1);function dd(e,t){let n=e.properties?.[t];return typeof n=="string"?n:void 0}function a6(e){if(!e)return[];try{let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=new Set;return t.filter(r=>{if(!r||typeof r.url!="string")return!1;let i=r.url;return n.has(i)?!1:(n.add(i),!0)})}catch{return[]}}function $Q(e){if(!e)return[];let t=a6(dd(e,"citedSources")),n=(e.children??[]).filter(o=>o.type==="element"),r=[],i=[];for(let o of n)if(o.tagName==="shiny-web-search"){let s={kind:"search",query:dd(o,"query")??"",sources:null,citedSources:[]};r.push(s),i.push(s)}else if(o.tagName==="shiny-web-search-results"){let s=a6(dd(o,"sources")),a=i.shift();a?a.sources=s:r.push({kind:"search",query:"",sources:s,citedSources:[]})}else if(o.tagName==="shiny-web-fetch"){let s=dd(o,"url");s&&r.push({kind:"fetch",url:s,status:dd(o,"status")})}for(let o=r.length-1;o>=0;o-=1){let s=r[o];if(s.kind==="search"&&s.sources===null){s.citedSources=t;break}}return r}function WQ(e){return e.domain||Vu(e.url)}function jQ(e){return`https://icons.duckduckgo.com/ip3/${encodeURIComponent(e)}.ico`}var l6=(0,Ug.memo)(function({node:t}){let[n,r]=(0,Ug.useState)(!1),i=ou(),o=$Q(t);if(o.length===0)return null;let s=o.some(a=>a.kind==="search")?"Searched the web":"Read the web";return(0,At.jsxs)("div",{className:"shiny-web-activity",children:[(0,At.jsxs)("button",{className:"shiny-web-activity__header","aria-expanded":n,onClick:()=>r(a=>!a),children:[(0,At.jsx)(s6,{className:"shiny-web-activity__chevron",expanded:n}),s]}),n&&(0,At.jsx)("div",{className:"shiny-web-activity__timeline",children:o.map((a,l)=>a.kind==="search"?(0,At.jsx)("div",{className:"shiny-web-activity__node shiny-web-activity__search",children:(()=>{let u=a.sources??a.citedSources,c=a.sources===null&&a.citedSources.length>0;return(0,At.jsxs)(At.Fragment,{children:[(0,At.jsxs)("div",{className:"shiny-web-activity__qrow",children:[(0,At.jsx)("span",{className:"shiny-web-activity__query",children:a.query}),a.sources!==null&&a.sources.length>0&&(0,At.jsxs)("span",{className:"shiny-web-activity__count",children:[a.sources.length," result",a.sources.length!==1?"s":""]}),c&&(0,At.jsx)("span",{className:"shiny-web-activity__count",children:"Cited sources"})]}),u.length>0&&(0,At.jsx)("div",{className:"shiny-web-activity__results",children:u.map((f,d)=>{let p=WQ(f),h=gm(f.url);return(0,At.jsxs)(h?"a":"span",{className:"shiny-web-activity__result",...h?{href:f.url,...Ni}:{},children:[i&&(0,At.jsx)("img",{className:"shiny-web-activity__fav",src:jQ(p),alt:"",loading:"lazy",onError:y=>{y.currentTarget.style.visibility="hidden"}}),(0,At.jsx)("span",{className:"shiny-web-activity__title",children:f.title||p}),(0,At.jsx)("span",{className:"shiny-web-activity__domain",children:p})]},f.url)})})]})})()},`search-${l}-${a.query}`):(0,At.jsxs)("div",{className:"shiny-web-activity__node shiny-web-activity__fetch",children:[(0,At.jsx)("span",{className:"shiny-web-activity__fetch-label",children:"Read"}),a.status!=="error"&&gm(a.url)?(0,At.jsx)("a",{href:a.url,...Ni,children:a.url}):(0,At.jsx)("span",{children:a.url}),(0,At.jsx)("span",{className:`shiny-web-activity__status shiny-web-activity__status--${a.status==="error"?"error":"ok"}`,"aria-label":a.status==="error"?"failed":"succeeded",children:a.status==="error"?"\u2717":"\u2713"})]},`fetch-${l}-${a.url}`))})]})});var Gu={"shiny-tool-request":AL,"shiny-tool-result":NL,"shiny-aside":nd,"shiny-aside-group":o6,"shiny-web-activity":l6,"shiny-web-search":nd,"shiny-web-search-results":nd,"shiny-web-fetch":nd};var Ha=G(fe(),1);var Fg=G(fe(),1);function Ku(){let[e,t]=(0,Fg.useState)(()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return(0,Fg.useEffect)(()=>{let n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=i=>t(i.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}var XQ=200;function _x(e,t){let n=Ku(),[r,i]=(0,Ha.useState)({key:t,value:e}),[o,s]=(0,Ha.useState)(!1),a=(0,Ha.useRef)({key:t,value:e});return(0,Ha.useLayoutEffect)(()=>{if(a.current={key:t,value:e},t===r.key)return;if(n){i({key:t,value:e}),s(!1);return}s(!0);let l=setTimeout(()=>{i(a.current),s(!1)},XQ);return()=>clearTimeout(l)},[t,e,r.key,n]),{visible:r.value,fading:o}}function u6(e){return _x(e,e)}var ur=G(ie(),1),QQ={__html:Ru},c6=2500;function ZQ(e){let[t,n]=(0,on.useState)(null),r=(0,on.useRef)(0),i=(0,on.useRef)(null),o=(0,on.useRef)(null);return(0,on.useEffect)(()=>{if(!e)return;let s=Date.now(),a=s-r.current;if(a>=c6||!t)n(e),r.current=s,i.current=null;else if(i.current=e,!o.current){let l=c6-a;o.current=setTimeout(()=>{o.current=null,i.current&&(n(i.current),r.current=Date.now(),i.current=null)},l)}return()=>{o.current&&(clearTimeout(o.current),o.current=null)}},[e,t]),t}function JQ(){return(0,ur.jsx)("span",{className:"shiny-chat-thinking-glyph","aria-hidden":"true"})}var f6=(0,on.memo)(function({thinking:t,messageId:n}){let[r,i]=(0,on.useState)(!1),[o,s]=(0,on.useState)(!1),a=(0,on.useRef)(t.streaming),l=wR(),{scrollRef:u,contentRef:c,scrollToBottom:f}=Ph({resize:"smooth"}),d=(0,on.useRef)(!1);(0,on.useEffect)(()=>{let E=u.current;if(!E||!r||!t.streaming)return;let T=E.scrollHeight>E.clientHeight;T&&!d.current&&f(),d.current=T},[t.content,r,t.streaming,f,u]);let p=ZQ(t.streaming?t.topic:null);(0,on.useEffect)(()=>{if(a.current&&!t.streaming){if(!o){let E=setTimeout(()=>i(!1),600);return()=>clearTimeout(E)}a.current=t.streaming}a.current=t.streaming},[t.streaming,o]);let h=(0,on.useCallback)(()=>{i(E=>(E?l?.():t.streaming&&(d.current=!1,f()),!E)),t.streaming||s(!0)},[t.streaming,l,f]),g=eZ(t,p),{visible:y,fading:b}=u6(g);return!t.streaming&&!t.content.trim()?null:(0,ur.jsxs)("div",{className:"shiny-chat-thinking","data-streaming":t.streaming||void 0,children:[(0,ur.jsxs)("button",{id:`thinking-header-${n}`,className:"shiny-chat-thinking-header",onClick:h,"aria-expanded":r,"aria-controls":`thinking-content-${n}`,children:[(0,ur.jsx)(JQ,{}),(0,ur.jsx)("span",{className:"shiny-chat-thinking-label","data-fading":b||void 0,children:y}),t.streaming&&(0,ur.jsx)("svg",{className:"shiny-chat-thinking-dot",width:"8",height:"8",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,ur.jsx)("circle",{cx:"4",cy:"4",r:"4"})}),(0,ur.jsx)("span",{className:"shiny-chat-thinking-disclosure",dangerouslySetInnerHTML:QQ})]}),(0,ur.jsx)("div",{className:"shiny-chat-thinking-content",id:`thinking-content-${n}`,role:"region","aria-labelledby":`thinking-header-${n}`,"aria-hidden":r?void 0:"true",inert:!r||void 0,"data-expanded":r||void 0,children:(0,ur.jsx)("div",{className:"shiny-chat-thinking-content-inner",ref:u,children:(0,ur.jsx)("div",{ref:c,children:(0,ur.jsx)(Kt,{content:t.content,contentType:"markdown",role:"assistant",streaming:t.streaming,tagToComponentMap:Gu})})})})]})});function eZ(e,t){if(e.streaming)return t??"Thinking";if(e.durationMs!=null){let n=Math.round(e.durationMs/1e3);return n<1?"Thought for less than a second":`Thought for ${n}s`}return"Thinking"}var Dr=G(fe(),1);function d6(e){return e.customDisplay===!0&&e.status!=="running"}var p6=40;function tZ(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;let n=[];for(let[i,o]of Object.entries(t))if(!(i.startsWith("_")||i.startsWith("."))&&(typeof o=="string"||typeof o=="number"||typeof o=="boolean")&&(n.push(`${i}: ${o}`),n.length===3))break;if(n.length===0)return null;let r=n.join(", ");return r.length>p6?`${r.slice(0,p6-1)}\u2026`:r}function vx(e,t,n){if(e.label)return{text:e.label};if(!n&&e.title&&e.title!==t)return{text:e.title};if(n&&t)return null;let r=tZ(e.arguments);return r?{text:r,code:!0}:n?null:{text:e.toolName,code:!0}}function nZ(e){if(!(!e.icon||e.icon===e.definitionIcon))return e.icon}function h6(e,t){if(e.status==="running")return{kind:"status",status:"running"};let n=nZ(e);if(n)return{kind:"icon",icon:n};if(t){let r=e.icon||e.definitionIcon;if(r)return{kind:"icon",icon:r}}return{kind:"status",status:e.status}}function m6(e){return e.anyRunning?{kind:"status",status:"running"}:e.heterogeneous?{kind:"default"}:e.identity.icon?{kind:"icon",icon:e.identity.icon}:{kind:"default"}}function g6(e,t){return{title:e.title,verb:t?e.settled?"Used ":"Using ":"",toolName:e.toolName}}function b6(e){return e.title!=null?`title:${e.title}`:`tool:${e.verb}|${e.toolName}`}var rZ=60,iZ=3;function oZ(e){return(e.title?e.title.replace(/<[^>]*>/g,""):`Used ${e.toolName}`).length+(e.count>1?`\xD7${e.count}`.length:0)}function y6(e){let t=[],n=0;for(let o of e){let s=oZ(o)+(t.length?2:0),a=t.length>=iZ||n+s>rZ;if(t.length&&a)break;t.push(o),n+=s}let r=e.length-t.length,i=t.some(o=>o.title!==void 0);return{shown:t.map((o,s)=>({segment:o,showVerb:i||s===0})),overflowText:r>0?`, and ${r} ${r===1?"other":"others"}`:null}}function E6(e){let t=e.calls.filter(i=>!d6(i)),n=e.calls.filter(d6).map(i=>({key:i.localId,call:i,value:i.value??"",valueType:i.valueType??"html",showRequest:!1})).sort((i,o)=>(i.call.resolveBlock??0)-(o.call.resolveBlock??0)||(i.call.resolveIndex??0)-(o.call.resolveIndex??0));if(t.length===0)return{row:null,standalonePayloads:n};let r=n.length===0?{title:e.title,titleSettled:e.titleSettled,icon:e.icon,count:e.count,segments:e.segments}:iu(t);return{row:{calls:t,identity:r,single:t.length===1?t[0]:null,anyRunning:t.some(i=>i.status==="running"),failedCount:t.filter(i=>i.status==="error").length,heterogeneous:r.segments.length>1,hasExpandedCall:t.some(i=>i.expanded),segmentTitles:new Map(r.segments.map(i=>[i.toolName,i.title]))},standalonePayloads:n}}var ve=G(ie(),1),sZ='
Running\u2026
',aZ='',S6={__html:Ru};function x6(e){let[t,n]=(0,Dr.useState)(e??!1),r=(0,Dr.useRef)(e??!1);return(0,Dr.useEffect)(()=>{e&&!r.current&&n(!0),r.current=e??!1},[e]),[t,n]}function lZ(e){return e==="running"?sZ:e==="error"?og:aZ}function _6(e){return e.kind==="icon"?e.icon:e.kind==="status"?lZ(e.status):sg}function v6(e,t){return e.status==="running"?(0,ve.jsx)(lg,{toolName:e.toolName,toolTitle:e.title??e.definitionTitle,intent:e.intent,arguments:e.arguments??"{}"}):(0,ve.jsx)(cg,{toolName:e.toolName,toolTitle:e.title??e.definitionTitle,intent:e.intent,status:e.status,value:e.value??"",valueType:e.valueType??"markdown",requestCall:e.requestCall,showRequest:e.showRequest,fullScreen:e.fullScreen,expanded:t||e.expanded,icon:e.icon,footer:e.footer,label:e.label})}function T6({segment:e,showVerb:t}){let n=g6(e,t),{visible:r,fading:i}=_x(n,b6(n)),o={className:"shiny-chat-tool-group__title","data-fading":i||void 0};return(0,ve.jsxs)(ve.Fragment,{children:[r.title!=null?(0,ve.jsx)("span",{...o,dangerouslySetInnerHTML:{__html:r.title}}):(0,ve.jsxs)("span",{...o,children:[r.verb,(0,ve.jsx)("code",{className:"shiny-chat-tool-group__toolname",children:r.toolName})]}),e.count>1&&(0,ve.jsx)("span",{className:"shiny-chat-tool-group__count","aria-label":`${e.count} calls`,children:`\xD7${e.count}`})]})}function uZ({segments:e}){if(e.length===1)return(0,ve.jsx)(T6,{segment:e[0],showVerb:!0});let{shown:t,overflowText:n}=y6(e);return(0,ve.jsxs)("span",{className:"shiny-chat-tool-group__segments",children:[t.map(({segment:r,showVerb:i},o)=>(0,ve.jsxs)(Dr.Fragment,{children:[o>0&&", ",(0,ve.jsx)("span",{className:"shiny-chat-tool-group__segment",children:(0,ve.jsx)(T6,{segment:r,showVerb:i})})]},r.toolName)),n&&(0,ve.jsx)("span",{className:"shiny-chat-tool-group__overflow",children:n})]})}function cZ({item:e,segmentTitle:t,heterogeneous:n}){let[r,i]=x6(e.expanded),o=vx(e,t,!1),s=e.status==="error"?" text-danger":e.status==="running"?" running":"",a=_6(h6(e,n)),l=`tool-call${(0,Dr.useId)()}`;return(0,ve.jsxs)("li",{className:"shiny-chat-tool-call-row",role:"listitem",children:[(0,ve.jsxs)("button",{type:"button",className:"shiny-chat-tool-call-row__summary","aria-expanded":r,"aria-controls":l,onClick:()=>i(u=>!u),children:[(0,ve.jsx)("span",{className:`shiny-chat-tool-call-row__status${s}`,dangerouslySetInnerHTML:{__html:a}}),o&&(0,ve.jsx)("span",{className:"shiny-chat-tool-call-row__label",children:o.code?(0,ve.jsx)("code",{children:o.text}):o.text}),(0,ve.jsx)("span",{className:"shiny-chat-tool-spacer"}),r&&e.intent&&(0,ve.jsx)("span",{className:"shiny-chat-tool-row__intent",children:e.intent}),e.valuePreview&&(0,ve.jsx)("span",{className:"shiny-chat-tool-call-row__preview",children:e.valuePreview}),e.status==="error"&&(0,ve.jsx)("span",{className:"shiny-chat-tool-group__failed",children:"failed"}),(0,ve.jsx)("span",{className:"shiny-chat-tool-call-row__chevron",dangerouslySetInnerHTML:S6})]}),(0,ve.jsx)("div",{id:l,className:"shiny-chat-tool-call-row__detail",hidden:!r,children:r&&v6(e,!0)})]})}var C6=(0,Dr.memo)(function({group:t}){let{row:n,standalonePayloads:r}=E6(t),[i,o]=x6(n?.hasExpandedCall),s=`tool-group${(0,Dr.useId)()}`;return(0,ve.jsxs)(ve.Fragment,{children:[n&&(0,ve.jsx)(fZ,{row:n,expanded:i,setExpanded:o,bodyId:s}),r.map(a=>(0,ve.jsx)("div",{className:"shiny-chat-tool-custom-display",children:(0,ve.jsx)(FS,{value:a.value,valueType:a.valueType,showRequest:a.showRequest})},a.key))]})});function fZ({row:e,expanded:t,setExpanded:n,bodyId:r}){let{identity:i,single:o,anyRunning:s,failedCount:a,heterogeneous:l}=e,u=o&&vx(o,i.title,!0),c=_6(m6(e));return(0,ve.jsxs)("div",{className:`shiny-chat-tool-group shiny-chat-tool-group--${o?"single":"multi"}`,children:[(0,ve.jsxs)("button",{type:"button",className:"shiny-chat-tool-group__row","aria-expanded":t,"aria-controls":r,onClick:()=>n(f=>!f),children:[(0,ve.jsx)("span",{className:`shiny-chat-tool-group__glyph${s?" running":""}`,dangerouslySetInnerHTML:{__html:c}}),(0,ve.jsxs)("span",{className:"shiny-chat-tool-group__titlewrap",children:[(0,ve.jsx)(uZ,{segments:i.segments}),u&&(0,ve.jsxs)("span",{className:"shiny-chat-tool-group__label",children:[": ",u.code?(0,ve.jsx)("code",{children:u.text}):u.text]})]}),(0,ve.jsx)("span",{className:"shiny-chat-tool-spacer"}),o&&t&&o.intent&&(0,ve.jsx)("span",{className:"shiny-chat-tool-row__intent",children:o.intent}),o?.valuePreview&&(0,ve.jsx)("span",{className:"shiny-chat-tool-call-row__preview",children:o.valuePreview}),a>0&&(0,ve.jsx)("span",{className:"shiny-chat-tool-group__failed",children:o?"failed":`${a} failed`}),(0,ve.jsx)("span",{className:"shiny-chat-tool-group__chevron",dangerouslySetInnerHTML:S6})]}),o?(0,ve.jsx)("div",{id:r,className:"shiny-chat-tool-call-row__detail",hidden:!t,children:t&&v6(o,!0)}):(0,ve.jsx)("ul",{id:r,className:"shiny-chat-tool-group__calls",role:"list",hidden:!t,children:e.calls.map(f=>(0,ve.jsx)(cZ,{item:f,segmentTitle:e.segmentTitles.get(f.toolName),heterogeneous:l},f.localId))})]})}var N6=G(ie(),1);function A6({name:e}){return(0,N6.jsxs)("span",{className:"command-chip",children:["/",e]})}var Hg={image_types:["image/png","image/jpeg","image/gif","image/webp"],pdf_type:"application/pdf",text_extensions:{md:"text/markdown",markdown:"text/markdown",txt:"text/plain",csv:"text/csv",json:"application/json",py:"text/x-python",js:"text/javascript",ts:"text/typescript",r:"text/x-r",yaml:"text/yaml",yml:"text/yaml",toml:"text/x-toml",qmd:"text/markdown",rmd:"text/markdown",ipynb:"application/x-ipynb+json",rst:"text/x-rst",tex:"text/x-tex",sql:"text/x-sql",sh:"text/x-sh",html:"text/html",htm:"text/html",css:"text/css",xml:"application/xml",ini:"text/x-ini",cfg:"text/x-ini",log:"text/plain"}};var w6=new TextDecoder("utf-8"),pZ=Hg.image_types,Cx=Hg.pdf_type,Ax=Hg.text_extensions,R6=Array.from(new Set(Object.values(Ax))),Nx={"image/png":{family:"image",downscale:!0},"image/jpeg":{family:"image",downscale:!0},"image/gif":{family:"image",downscale:!0},"image/webp":{family:"image",downscale:!0},[Cx]:{family:"document",downscale:!1},...Object.fromEntries(R6.map(e=>[e,{family:"text",downscale:!1}]))},k6=Object.keys(Nx);function M6(e){let t=new Set(e);for(let[n,r]of Object.entries(Ax))t.has(r)&&t.add(`.${n}`);return[...t].join(",")}var hZ=1568;function za(e){return Nx[e]?.family??null}function O6(e){return pZ.includes(e)}function mZ(e,t,n){let r=Math.max(e,t);if(r<=n)return null;let i=n/r;return{width:Math.round(e*i),height:Math.round(t*i)}}var D6=300,I6=1e3;function wx(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r=999.95&&rt+n.size,0)}function gZ(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}async function bZ(e,t){if(typeof document>"u"||typeof Image>"u")return{dataUrl:e,wasDownscaled:!1};let n=await new Promise(a=>{let l=new Image;l.onload=()=>a(l),l.onerror=()=>a(null),l.src=e});if(!n||!n.naturalWidth||!n.naturalHeight)return{dataUrl:e,wasDownscaled:!1};let r=mZ(n.naturalWidth,n.naturalHeight,hZ);if(!r)return{dataUrl:e,wasDownscaled:!1};let i=document.createElement("canvas");i.width=r.width,i.height=r.height;let o=i.getContext("2d");if(!o)return{dataUrl:e,wasDownscaled:!1};o.drawImage(n,0,0,r.width,r.height);let s=t==="image/gif"?"image/png":t;return{dataUrl:i.toDataURL(s),wasDownscaled:!0}}function F6(e){let t=e.lastIndexOf(".");return t<=0?"":e.slice(t+1).toLowerCase()}function qg(e,t){let n=F6(e);return n?n.toUpperCase():t===Cx?"PDF":"FILE"}function H6(e){return new File([e],"Pasted Text",{type:"text/plain"})}function yZ(e){if(O6(e.type)||e.type===Cx)return e.type;let t=F6(e.name);return t?Ax[t]??null:R6.includes(e.type)?e.type:null}async function z6(e,t){let n=yZ(e);if(n===null||!t.includes(n))return null;let r=za(n);if(r===null)return null;let i=Nx[n],o=await gZ(e);if(i?.downscale&&O6(n)){let{dataUrl:s,wasDownscaled:a}=await bZ(o,n),l=a&&n==="image/gif"?"image/png":n;return{file:{id:Yr(),type:l,family:r,dataUrl:s,name:e.name,size:zg(s)},wasDownscaled:a,wasConverted:l!==n}}return{file:{id:Yr(),type:n,family:r,dataUrl:o,name:e.name,size:zg(o)},wasDownscaled:!1,wasConverted:!1}}var Vg=G(fe(),1);var Rs=G(ie(),1),Gg=(0,Vg.memo)(function({dataUrl:t,name:n,size:r,onRemove:i,onActivate:o,rootRef:s,rootProps:a}){let l=(0,Vg.useMemo)(()=>L6(t,D6).trim(),[t]);return(0,Rs.jsxs)("div",{ref:s,className:"shiny-chat-text-preview",title:n||void 0,...a,...o?{role:"button",tabIndex:0,onClick:o,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())}}:void 0,children:[(0,Rs.jsx)("div",{className:"shiny-chat-text-preview-body",children:l||"(empty file)"}),(0,Rs.jsxs)("div",{className:"shiny-chat-text-preview-footer",children:[n&&(0,Rs.jsx)("span",{className:"shiny-chat-text-preview-name",children:n}),(0,Rs.jsx)("span",{className:"shiny-chat-text-preview-size",children:pd(r)})]}),i&&(0,Rs.jsx)("button",{type:"button",tabIndex:0,"aria-label":n?`Remove ${n}`:"Remove attachment",onClick:i,children:"\xD7"})]})});var cr=G(fe(),1),V6=G(qi(),1);var xo=G(ie(),1),q6='button, [tabindex="0"], a[href], input, select, textarea, iframe';function G6({src:e,name:t,mime:n,onClose:r}){let i=za(n),o=i==="image",s=i==="text",[a,l]=(0,cr.useState)(null),u=(0,cr.useRef)(null),c=(0,cr.useRef)(null),f=(0,cr.useMemo)(()=>s?P6(e):"",[s,e]);(0,cr.useLayoutEffect)(()=>{c.current=document.activeElement instanceof HTMLElement?document.activeElement:null,u.current?.querySelector(q6)?.focus()},[]),(0,cr.useEffect)(()=>{let p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=p,c.current?.focus()}},[]);let d=(0,cr.useCallback)(p=>{if(p.key==="Escape"){r();return}if(p.key!=="Tab")return;let h=u.current;if(!h)return;let g=h.querySelectorAll(q6);if(g.length===0)return;let y=g[0],b=g[g.length-1];p.shiftKey&&document.activeElement===y?(p.preventDefault(),b.focus()):!p.shiftKey&&document.activeElement===b&&(p.preventDefault(),y.focus())},[r]);return(0,cr.useEffect)(()=>{if(o||s)return;let p=URL.createObjectURL(B6(e));return l(p),()=>URL.revokeObjectURL(p)},[e,o,s]),(0,V6.createPortal)((0,xo.jsxs)("div",{ref:u,className:"shiny-chat-lightbox",role:"dialog","aria-modal":"true","aria-label":t||"Attachment preview",onClick:r,onKeyDown:d,children:[(0,xo.jsxs)("div",{className:"shiny-chat-lightbox-content",onClick:p=>p.stopPropagation(),children:[o?(0,xo.jsx)("img",{className:"shiny-chat-lightbox-img",src:e,alt:t||"Attached image"}):s?(0,xo.jsx)("pre",{className:"shiny-chat-lightbox-text",tabIndex:0,"aria-label":t||"File content",children:f||"(empty file)"}):a&&(0,xo.jsx)("iframe",{className:"shiny-chat-lightbox-frame",src:a,title:t||"PDF preview"}),t&&(0,xo.jsx)("div",{className:"shiny-chat-lightbox-name",children:t})]}),(0,xo.jsx)("button",{type:"button",className:"shiny-chat-lightbox-close","aria-label":"Close preview",onClick:r,children:"\xD7"})]}),document.body)}var mr=G(fe(),1);var B0=G(fe(),1),Us=G(fe(),1),E5=G(qi(),1),T5=G(Kg(),1),Io=G(ie(),1);function On(e){this.content=e}On.prototype={constructor:On,find:function(e){for(var t=0;t>1}};On.from=function(e){if(e instanceof On)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new On(t)};var kx=On;function rP(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){let s=i.text,a=o.text,l=0;for(;s[l]==a[l];l++)n++;return l&&l0&&d>0&&u[f-1]==c[d-1];)f--,d--,n--,r--;return f&&d&&f=56320&&e<57344}function sP(e){return e>=55296&&e<56320}var J=class e{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;rt&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,t-c),Math.min(l.content.size,n-c),r,i+c)}a=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",s=!0;return this.nodesBetween(t,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(t,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);ot)for(let o=0,s=0;st&&((sn)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,o)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=t)return o==t?Yg(n+1,o):Yg(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;nr.type.rank-i.type.rank),n}};$e.none=[];var Ga=class extends Error{},le=class e{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=lP(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(aP(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new e(J.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new e(t,r,i)}};le.empty=new le(J.empty,0,0);function aP(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(aP(o.content,t-i-1,n-i-1)))}function lP(e,t,n,r,i,o){let{index:s,offset:a}=e.findIndex(t),l=e.maybeChild(s);if(a==t||l.isText)return o&&r<=0&&i<=0&&!o.canReplace(s,s,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=lP(l.content,t-a-1,n,s==0?r-1:0,s==e.childCount-1?i-1:0,l);return u&&e.replaceChild(s,l.copy(u))}function wZ(e,t,n){if(n.openStart>e.depth)throw new Ga("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Ga("Inconsistent open depths");return uP(e,t,n,0)}function uP(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function hd(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(qa(e.nodeAfter,r),o++));for(let a=o;ai&&Ox(e,t,i+1),s=r.depth>i&&Ox(n,r,i+1),a=[];return hd(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(cP(o,s),qa(Va(o,fP(e,t,n,r,i+1)),a)):(o&&qa(Va(o,Xg(e,t,i+1)),a),hd(t,n,i,a),s&&qa(Va(s,Xg(n,r,i+1)),a)),hd(r,null,i,a),new J(a)}function Xg(e,t,n){let r=[];if(hd(null,e,n,r),e.depth>n){let i=Ox(e,t,n+1);qa(Va(i,Xg(e,t,n+1)),r)}return hd(t,null,n,r),new J(r)}function RZ(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(J.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}var Qg=class e{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ka(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new e(n,r,o)}static resolveCached(t,n){let r=W6.get(t);if(r)for(let o=0;ot&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),dP(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=J.empty,i=0,o=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=J.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};fr.prototype.text=void 0;var Ix=class e extends fr{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):dP(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}};function dP(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var Ya=class e{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Lx(t,n);if(r.next==null)return e.empty;let i=pP(r);r.next&&r.err("Unexpected trailing text");let o=UZ(BZ(i));return FZ(o,r),o}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(r.next[s].next);return o}).join(` +`)}};Ya.empty=new Ya(!0);var Lx=class{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}};function pP(e){let t=[];do t.push(OZ(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function OZ(e){let t=[];do t.push(DZ(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function DZ(e){let t=PZ(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=IZ(e,t);else break;return t}function j6(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function IZ(e,t){let n=j6(e),r=n;return e.eat(",")&&(e.next!="}"?r=j6(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function LZ(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(t)&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function PZ(e){if(e.eat("(")){let t=pP(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=LZ(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function BZ(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,l){let u={term:l,to:a};return t[s].push(u),u}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(o(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=o(s.exprs[l],a);if(l==s.exprs.length-1)return u;i(u,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u{e[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c{u||i.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=t[r.join(",")]=new Ya(r.indexOf(e.length-1)>-1);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:gP(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new fr(this,this.computeAttrs(t),J.from(n),$e.setFrom(r))}createChecked(t=null,n,r){return n=J.from(n),this.checkContent(n),new fr(this,this.computeAttrs(t),n,$e.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=J.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(J.empty,!0);return o?new fr(this,t,n.append(o),$e.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;nr[o]=new e(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function HZ(e,t,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}var Px=class{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?HZ(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}},gd=class e{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=yP(t,i.attrs),this.excluded=null;let o=mP(this.attrs);this.instance=o?new $e(this,o):null}create(t=null){return!t&&this.instance?this.instance:new $e(this,gP(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,s)=>r[o]=new e(o,i++,n,s)),r}removeFromSet(t){for(var n=0;n-1}},Wu=class{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=kx.from(t.nodes),n.marks=kx.from(t.marks||{}),this.nodes=Zg.compile(this.spec.nodes,this),this.marks=gd.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Ya.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?Q6(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Q6(this,s.split(" "))}this.nodeFromJSON=i=>fr.fromJSON(this,i),this.markFromJSON=i=>$e.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof Zg){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Ix(r,r.defaultAttrs,t,$e.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}};function Q6(e,t){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function zZ(e){return e.tag!=null}function qZ(e){return e.style!=null}var Ii=class e{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(zZ(i))this.tags.push(i);else if(qZ(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=t.nodes[i.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new Jg(this,n,!1);return r.addAll(t,$e.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new Jg(this,n,!0);return r.addAll(t,$e.none,n.from,n.to),le.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;it.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=J6(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=J6(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},EP={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},VZ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},TP={ol:!0,ul:!0},bd=1,Bx=2,md=4;function Z6(e,t,n){return t!=null?(t?bd:0)|(t==="full"?Bx:0):e&&e.whitespace=="pre"?bd|Bx:n&~md}var $u=class{constructor(t,n,r,i,o,s){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=$e.none,this.match=o||(s&md?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(J.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&bd)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=J.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!EP.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}},Jg=class{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=Z6(null,n.preserveWhitespace,0)|(r?md:0);i?o=new $u(i.type,i.attrs,$e.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new $u(null,null,$e.none,!0,null,s):o=new $u(t.schema.topNodeType,null,$e.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,o=i.options&Bx?"full":this.localPreserveWS||(i.options&bd)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,` +`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(t,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}o&&this.sync(a)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let s=r?t.childNodes[r]:t.firstChild,a=i==null?null:t.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(s,n);this.findAtPoint(t,o)}findPlace(t,n,r){let i,o;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(t);if(u&&(!i||i.length>u.length+a)&&(i=u,o=l,!u.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(o);for(let s=0;s(s.type?s.type.allowsMarkType(u.type):eP(u.type,t))?(l=u.addToSet(l),!1):!0),this.nodes.push(new $u(t,n,l,i,null,a)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=bd)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function GZ(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&TP.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function KZ(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function J6(e){let t={};for(let n in e)t[n]=e[n];return t}function eP(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=a=>{o.push(a);for(let l=0;l{if(o.length||s.marks.length){let a=0,l=0;for(;a=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&Wg($g(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return typeof n=="string"?{dom:t.createTextNode(n)}:Wg(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=tP(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return tP(t.marks)}};function tP(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function $g(e){return e.document||window.document}var nP=new WeakMap;function YZ(e){let t=nP.get(e);return t===void 0&&nP.set(e,t=$Z(e)),t}function $Z(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?e.createElementNS(n,i):e.createElement(i),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),u[f]):f=="style"&&l.style?l.style.cssText=u[f]:l.setAttribute(f,u[f])}}for(let f=c;fc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof d=="string")l.appendChild(e.createTextNode(d));else{let{dom:p,contentDOM:h}=Wg(e,d,n,r);if(l.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:l,contentDOM:a}}var _P=65535,vP=Math.pow(2,16);function WZ(e,t){return e+t*vP}function SP(e){return e&_P}function jZ(e){return(e-(e&_P))/vP}var CP=1,AP=2,e0=4,NP=8,Td=class{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&NP)>0}get deletedBefore(){return(this.delInfo&(CP|e0))>0}get deletedAfter(){return(this.delInfo&(AP|e0))>0}get deletedAcross(){return(this.delInfo&e0)>0}},vo=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(t){let n=0,r=SP(t);if(!this.inverted)for(let i=0;it)break;let u=this.ranges[a+o],c=this.ranges[a+s],f=l+u;if(t<=f){let d=u?t==l?-1:t==f?1:n:n,p=l+i+(d<0?0:c);if(r)return p;let h=t==(n<0?l:f)?null:WZ(a/3,t-l),g=t==l?AP:t==f?CP:e0;return(n<0?t!=l:t!=f)&&(g|=NP),new Td(p,g,h)}i+=c-u}return r?t+i:new Td(t+i,0,null)}touches(t,n){let r=0,i=SP(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;at)break;let u=this.ranges[a+o],c=l+u;if(t<=c&&a==i*3)return!0;r+=this.ranges[a+s]-u}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=t.getMirror(n);this.appendMap(t._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;ro&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Sn.fromReplace(t,this.from,this.to,o)}invert(){return new Co(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};sn.jsonID("addMark",xd);var Co=class e extends sn{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new le(Vx(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Sn.fromReplace(t,this.from,this.to,r)}invert(){return new xd(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};sn.jsonID("removeMark",Co);var _d=class e extends sn{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Sn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Sn.fromReplace(t,this.pos,this.pos+1,new le(J.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new e(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,le.fromJSON(t,n.slice),n.insert,!!n.structure)}};sn.jsonID("replaceAround",$t);function zx(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function XZ(e,t,n,r){let i=[],o=[],s,a;e.doc.nodesBetween(t,n,(l,u,c)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let d=Math.max(u,t),p=Math.min(u+l.nodeSize,n),h=r.addToSet(f);for(let g=0;ge.step(l)),o.forEach(l=>e.step(l))}function QZ(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof gd){let u=s.marks,c;for(;c=r.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let u=Math.min(a+s.nodeSize,n);for(let c=0;ce.step(new Co(s.from,s.to,s.style)))}function Gx(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let l=0;l=0;l--)e.step(s[l])}function ZZ(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Ao(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,i=0,o=0;;--r){let s=e.$from.node(r),a=e.$from.index(r)+i,l=e.$to.indexAfter(r)-o;if(rn;h--)g||r.index(h)>0?(g=!0,c=J.from(r.node(h).copy(c)),f++):l--;let d=J.empty,p=0;for(let h=o,g=!1;h>n;h--)g||i.after(h+1)=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=J.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new $t(i,o,i,o,new le(r,0,0),n.length,!0))}function rJ(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&iJ(e.doc,e.mapping.slice(o).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!h?u=!1:!p&&h&&(u=!0)}u===!1&&RP(e,s,a,o),Gx(e,e.mapping.slice(o).map(a,1),r,void 0,u===null);let c=e.mapping.slice(o),f=c.map(a,1),d=c.map(a+s.nodeSize,1);return e.step(new $t(f,d,f+1,d-1,new le(J.from(r.create(l,null,s.marks)),0,0),1,!0)),u===!0&&wP(e,s,a,o),!1}})}function wP(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function RP(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=e.mapping.slice(r).map(n+1+o);e.replaceWith(s,s+1,t.type.schema.text(` +`))}})}function iJ(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function oJ(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new $t(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new le(J.from(s),0,0),1,!0))}function Ir(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=n-2;u>o;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[c+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let g=r&&r[c]||f;if(!f.canReplace(d+1,f.childCount)||!g.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function sJ(e,t,n=1,r){let i=e.doc.resolve(t),o=J.empty,s=J.empty;for(let a=i.depth,l=i.depth-n,u=n-1;a>l;a--,u--){o=J.from(i.node(a).copy(o));let c=r&&r[u];s=J.from(c?c.type.create(c.attrs,s):i.node(a).copy(s))}e.step(new xn(t,t,new le(o.append(s),n,n),!0))}function ui(e,t){let n=e.resolve(t),r=n.index();return kP(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function aJ(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&kP(o,s)&&r.node(i).canReplace(a,a+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function lJ(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let c=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);c&&!f?r=!1:!c&&f&&(r=!0)}let a=e.steps.length;if(r===!1){let c=e.doc.resolve(t+n);RP(e,c.node(),c.before(),a)}s.inlineContent&&Gx(e,t+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=e.mapping.slice(a),u=l.map(t-n);if(e.step(new xn(u,l.map(t+n,-1),le.empty,!0)),r===!0){let c=e.doc.resolve(u);wP(e,c.node(),c.before(),e.steps.length)}return e}function uJ(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),u=r.node(s),c=!1;if(o==1)c=u.canReplace(l,l,i);else{let f=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(l,l,f[0])}if(c)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Cd(e,t,n=t,r=le.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return OP(i,o,r)?new xn(t,n,r):new qx(i,o,r).fit()}function OP(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var qx=class{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=J.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=J.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new le(o,s,a);return t>-1?new $t(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new xn(r.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Fx(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,f=null;if(n==1&&(s?u.matchType(s.type)||(f=u.fillBefore(J.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Fx(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new le(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Fx(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new le(yd(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new le(yd(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g1||l==0||g.content.size)&&(f=y,c.push(DP(g.mark(d.allowedMarks(g.marks)),u==1?l:0,u==a.childCount?p:-1)))}let h=u==a.childCount;h||(p=-1),this.placed=Ed(this.placed,n,J.from(c)),this.frontier[n].match=f,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;a--){let{match:l,type:u}=this.frontier[a],c=Hx(t,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Ed(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=Ed(this.placed,this.depth,J.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=Ed(this.placed,this.frontier.length,n))}};function yd(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(yd(e.firstChild.content,t-1,n)))}function Ed(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ed(e.lastChild.content,t-1,n)))}function Fx(e,t){for(let n=0;n1&&(r=r.replaceChild(0,DP(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(J.empty,!0)))),e.copy(r)}function Hx(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!cJ(n,o.content,s)?a:null}function cJ(e,t,n){for(let r=n;r0;d--,p--){let h=i.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(d)>-1?a=d:i.before(d)==p&&s.splice(1,0,-d)}let l=s.indexOf(a),u=[],c=r.openStart;for(let d=r.content,p=0;;p++){let h=d.firstChild;if(u.push(h),p==r.openStart)break;d=h.content}for(let d=c-1;d>=0;d--){let p=u[d],h=fJ(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(a)-1)))c=d;else if(h||!p.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+c+1)%(r.openStart+1),h=u[p];if(h)for(let g=0;g=0&&(e.replace(t,n,r),!(e.steps.length>f));d--){let p=s[d];p<0||(t=i.before(p),n=o.after(p))}}function IP(e,t,n,r,i){if(tr){let o=i.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(J.empty,!0))}return e}function pJ(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=uJ(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new le(J.from(r),0,0))}function hJ(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let s=r.sharedDepth(n),a=!1;for(let l=r.depth;l>s;l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=i.depth;l>s;l--)i.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&t==r.start(l);l--)t=r.before(l);for(let l=i.depth;l>0&&n==i.start(l);l--)n=i.before(l);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let o=LP(r,i);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return e.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n)}function LP(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(ot.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}var t0=class e extends sn{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Sn.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Sn.fromReplace(t,this.pos,this.pos+1,new le(J.from(i),0,n.isLeaf?0:1))}getMap(){return vo.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new e(n.pos,n.attr,n.value)}};sn.jsonID("attr",t0);var n0=class e extends sn{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Sn.ok(r)}getMap(){return vo.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new e(n.attr,n.value)}};sn.jsonID("docAttr",n0);var Xu=class extends Error{};Xu=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Xu.prototype=Object.create(Error.prototype);Xu.prototype.constructor=Xu;Xu.prototype.name="TransformError";var Qu=class{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Sd}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Xu(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r{t=Math.min(t,a),n=Math.max(n,l)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=le.empty){let i=Cd(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new le(J.from(r),0,0))}delete(t,n){return this.replace(t,n,le.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return dJ(this,t,n,r),this}replaceRangeWith(t,n,r){return pJ(this,t,n,r),this}deleteRange(t,n){return hJ(this,t,n),this}lift(t,n){return JZ(this,t,n),this}join(t,n=1){return lJ(this,t,n),this}wrap(t,n){return nJ(this,t,n),this}setBlockType(t,n=t,r,i=null){return rJ(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return oJ(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new t0(t,n,r)),this}setDocAttribute(t,n){return this.step(new n0(t,n)),this}addNodeMark(t,n){return this.step(new _d(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof $e)n.isInSet(r.marks)&&this.step(new ju(t,n));else{let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new ju(t,o)),i=o.removeFromSet(i);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(t,n=1,r){return sJ(this,t,n,r),this}addMark(t,n,r){return XZ(this,t,n,r),this}removeMark(t,n,r){return QZ(this,t,n,r),this}clearIncompatible(t,n,r){return Gx(this,t,n,r),this}};var Kx=Object.create(null),Oe=class{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new i0(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;o--){let s=n<0?Zu(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Zu(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Kn(t.node(0))}static atStart(t){return Zu(t,t,0,0,1)||new Kn(t)}static atEnd(t){return Zu(t,t,t.content.size,t.childCount,-1)||new Kn(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Kx[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Kx)throw new RangeError("Duplicate use of selection JSON ID "+t);return Kx[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Te.between(this.$anchor,this.$head).getBookmark()}};Oe.prototype.visible=!0;var i0=class{constructor(t,n){this.$from=t,this.$to=n}},PP=!1;function BP(e){!PP&&!e.parent.inlineContent&&(PP=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var Te=class e extends Oe{constructor(t,n=t){BP(t),BP(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Oe.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(t,n=le.empty){if(super.replace(t,n),n==le.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new o0(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=Oe.findFrom(n,r,!0)||Oe.findFrom(n,-r,!0);if(o)n=o.$head;else return Oe.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Oe.findFrom(t,-r,!0)||Oe.findFrom(t,r,!0)).$anchor,t.pos0?0:1);i>0?s=0;s+=i){let a=t.child(s);if(a.isAtom){if(!o&&ge.isSelectable(a))return ge.create(e,n-(i<0?a.nodeSize:0))}else{let l=Zu(e,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function UP(e,t,n){let r=e.steps.length-1;if(r{s==null&&(s=c)}),e.setSelection(Oe.near(e.doc.resolve(s),n))}var FP=1,r0=2,HP=4,Wx=class extends Qu{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=r0,this}ensureMarks(t){return $e.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&r0)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~r0,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||$e.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,o)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Oe.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=HP,this}get scrolledIntoView(){return(this.updated&HP)>0}};function zP(e,t){return!t||!e?e:e.bind(t)}var Wa=class{constructor(t,n,r){this.name=t,this.init=zP(n.init,r),this.apply=zP(n.apply,r)}},gJ=[new Wa("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Wa("selection",{init(e,t){return e.selection||Oe.atStart(t.doc)},apply(e){return e.selection}}),new Wa("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Wa("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Ad=class{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=gJ.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Wa(r.key,r.spec.state,r))})}},s0=class e{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;rr.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new Ad(t.schema,t.plugins),o=new e(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=fr.fromJSON(t.schema,n.doc);else if(s.name=="selection")o.selection=Oe.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=u.fromJSON.call(l,t,n[a],o);return}}o[s.name]=s.init(t,o)}}),o}};function qP(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=qP(i,t,{})),n[r]=i}return n}var Qe=class{constructor(t){this.spec=t,this.props={},t.props&&qP(t.props,this,this.props),this.key=t.key?t.key.key:VP("plugin")}getState(t){return t[this.key]}},Yx=Object.create(null);function VP(e){return e in Yx?e+"$"+ ++Yx[e]:(Yx[e]=0,e+"$")}var Et=class{constructor(t="key"){this.key=VP(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}};var KP=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function YP(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}var Xx=(e,t,n)=>{let r=YP(e,n);if(!r)return!1;let i=Zx(r);if(!i){let s=r.blockRange(),a=s&&Ao(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(t4(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Ju(o,"end")||ge.isSelectable(o)))for(let s=r.depth;;s--){let a=Cd(e.doc,r.before(s),r.after(s),le.empty);if(a&&a.slice.size1)break}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},$P=(e,t,n)=>{let r=YP(e,n);if(!r)return!1;let i=Zx(r);return i?jP(e,i,t):!1},WP=(e,t,n)=>{let r=XP(e,n);if(!r)return!1;let i=t_(r);return i?jP(e,i,t):!1};function jP(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let s=t.nodeAfter,a=s,l=t.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=Cd(e.doc,o,l,le.empty);if(!u||u.from!=o||u instanceof xn&&u.slice.size>=l-o)return!1;if(n){let c=e.tr.step(u);c.setSelection(Te.create(c.doc,o)),n(c.scrollIntoView())}return!0}function Ju(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Qx=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=Zx(r)}let s=o&&o.nodeBefore;return!s||!ge.isSelectable(s)?!1:(t&&t(e.tr.setSelection(ge.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Zx(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function XP(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset{let r=XP(e,n);if(!r)return!1;let i=t_(r);if(!i)return!1;let o=i.nodeAfter;if(t4(e,i,t,1))return!0;if(r.parent.content.size==0&&(Ju(o,"start")||ge.isSelectable(o))){let s=Cd(e.doc,r.before(),r.after(),le.empty);if(s&&s.slice.size{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let n=e.selection,r=n instanceof ge,i;if(r){if(n.node.isTextblock||!ui(e.doc,n.from))return!1;i=n.from}else if(i=$a(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(ge.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},ZP=(e,t)=>{let n=e.selection,r;if(n instanceof ge){if(n.node.isTextblock||!ui(e.doc,n.to))return!1;r=n.to}else if(r=$a(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},JP=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Ao(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},n_=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(` +`).scrollIntoView()),!0)};function r_(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=r_(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Oe.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},o_=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Kn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=r_(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Ir(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ao(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function bJ(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof ge&&t.selection.node.isBlock)return!r.parentOffset||!Ir(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,a,l=!1,u=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){l=r.end(p)==r.pos+(r.depth-p),u=r.start(p)==r.pos-(r.depth-p),a=r_(r.node(p-1).contentMatchAt(r.indexAfter(p-1)));let g=e&&e(i.parent,l,r);o.unshift(g||(l&&a?{type:a}:null)),s=p;break}else{if(p==1)return!1;o.unshift(null)}let c=t.tr;(t.selection instanceof Te||t.selection instanceof Kn)&&c.deleteSelection();let f=c.mapping.map(r.pos),d=Ir(c.doc,f,o.length,o);if(d||(o[0]=a?{type:a}:null,d=Ir(c.doc,f,o.length,o)),!d)return!1;if(c.split(f,o.length,o),!l&&u&&r.node(s).type!=a){let p=c.mapping.map(r.before(s)),h=c.doc.resolve(p);a&&r.node(s-1).canReplaceWith(h.index(),h.index()+1,a)&&c.setNodeMarkup(c.mapping.map(r.before(s)),a)}return n&&n(c.scrollIntoView()),!0}}var yJ=bJ();var e4=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(ge.create(e.doc,i))),!0)},EJ=(e,t)=>(t&&t(e.tr.setSelection(new Kn(e.doc))),!0);function TJ(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||ui(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function t4(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&TJ(e,t,n))return!0;let u=!l&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let p=t.pos+o.nodeSize,h=J.empty;for(let b=s.length-1;b>=0;b--)h=J.from(s[b].create(null,h));h=J.from(i.copy(h));let g=e.tr.step(new $t(t.pos-1,p,t.pos,p,new le(h,1,0),s.length,!0)),y=g.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&ui(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let c=o.type.spec.isolating||r>0&&l?null:Oe.findFrom(t,1),f=c&&c.$from.blockRange(c.$to),d=f&&Ao(f);if(d!=null&&d>=t.depth)return n&&n(e.tr.lift(f,d).scrollIntoView()),!0;if(u&&Ju(o,"start",!0)&&Ju(i,"end")){let p=i,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let g=o,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let b=J.empty;for(let T=h.length-1;T>=0;T--)b=J.from(h[T].copy(b));let E=e.tr.step(new $t(t.pos-h.length,t.pos+o.nodeSize,t.pos+y,t.pos+o.nodeSize-y,new le(b,h.length,0),0,!0));n(E.scrollIntoView())}return!0}}return!1}function n4(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(Te.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}var a_=n4(-1),l_=n4(1);function r4(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&vd(s,e,t);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function u_(e,t=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)i=!0;else{let c=n.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let l=s.resolve(t.start-2);o=new Ka(l,l,t.depth),t.endIndex=0;c--)o=J.from(n[c].type.create(n[c].attrs,o));e.step(new $t(t.start-(r?2:0),t.end,t.start,t.end,new le(o,0,0),n.length,!0));let s=0;for(let c=0;cs.childCount>0&&s.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?vJ(t,n,e,o):CJ(t,n,o):!0:!1}}function vJ(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);og;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,u=o.node(-1),c=o.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?J.empty:J.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new $t(f-(a?1:0),d+(l?1:0),f+1,d-1,new le((a?J.empty:J.from(i.copy(J.empty))).append(l?J.empty:J.from(i.copy(J.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}function s4(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==e);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=e)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=J.from(u?e.create():null),f=new le(J.from(e.create(null,J.from(a.type.create(null,c)))),u?3:1,0),d=o.start,p=o.end;n(t.tr.step(new $t(d-(u?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}var _n=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},rc=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},g_=null,wo=function(e,t,n){let r=g_||(g_=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},AJ=function(){g_=null},tl=function(e,t,n,r){return n&&(a4(e,t,n,r,-1)||a4(e,t,n,r,1))},NJ=/^(img|br|input|textarea|hr)$/i;function a4(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Xr(e))){let s=e.parentNode;if(!s||s.nodeType!=1||Id(e)||NJ.test(e.nodeName)||e.contentEditable=="false")return!1;t=_n(e)+(i<0?0:1),e=s}else if(e.nodeType==1){let s=e.childNodes[t+(i<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((o=s.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)t+=i;else return!1;else e=s,t=i<0?Xr(e):0}else return!1}}function Xr(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function wJ(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=Xr(e)}else if(e.parentNode&&!Id(e))t=_n(e),e=e.parentNode;else return null}}function RJ(e,t){for(;;){if(e.nodeType==3&&t2),jr=ic||(Li?/Mac/.test(Li.platform):!1),z4=Li?/Win/.test(Li.platform):!1,Ro=/Android \d/.test(Ls),Ld=!!l4&&"webkitFontSmoothing"in l4.documentElement.style,DJ=Ld?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function IJ(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function No(e,t){return typeof e=="number"?e:e[t]}function LJ(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function u4(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(s.nodeType!=1){s=rc(s);continue}let a=s,l=a==o.body,u=l?IJ(o):LJ(a),c=0,f=0;if(t.topu.bottom-No(r,"bottom")&&(f=t.bottom-t.top>u.bottom-u.top?t.top+No(i,"top")-u.top:t.bottom-u.bottom+No(i,"bottom")),t.leftu.right-No(r,"right")&&(c=t.right-u.right+No(i,"right")),c||f)if(l)o.defaultView.scrollBy(c,f);else{let p=a.scrollLeft,h=a.scrollTop;f&&(a.scrollTop+=f),c&&(a.scrollLeft+=c);let g=a.scrollLeft-p,y=a.scrollTop-h;t={left:t.left-g,top:t.top-y,right:t.right-g,bottom:t.bottom-y}}let d=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s=d=="absolute"?s.offsetParent:rc(s)}}function PJ(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,s=n+1;s=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:q4(e.dom)}}function q4(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=rc(r));return t}function BJ({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;V4(n,r==0?0:r-t)}function V4(e,t){for(let n=0;n=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let g=h.left>t.left?h.left-t.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!l&&h.left<=t.left&&h.right>=t.left&&(l=c,u={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=u,r=0),n&&n.nodeType==3?FJ(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:G4(n,i)}function FJ(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o=(s.left+s.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function L_(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function HJ(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function qJ(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let a=e.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right-1?i:e.docView.posFromDOM(t,n,-1)}function K4(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&i++}let u;Ld&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=qJ(e,r,i,t))}a==null&&(a=zJ(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function c4(e){return e.top=0&&i==r.nodeValue.length?(l--,c=1):n<0?l--:u++,Nd(Ms(wo(r,l,u),c),c<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Xr(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return f_(l.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Xr(r))){let l=r.childNodes[i-1],u=l.nodeType==3?wo(l,Xr(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return Nd(Ms(u,1),!1)}if(o==null&&i=0)}function Nd(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function f_(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function $4(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function KJ(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return $4(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=Y4(e,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=wo(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;uc.top+1&&(n=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}var YJ=/[\u0590-\u08ac]/;function $J(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return a?!YJ.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:$4(e,t,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:f}=e.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:h,focusOffset:g}=e.domSelectionRange(),y=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&u==g;try{a.collapse(c,f),l&&(l!=c||u!=f)&&a.extend&&a.extend(l,u)}catch{}return d!=null&&(a.caretBidiLevel=d),y}):r.pos==r.start()||r.pos==r.end()}var f4=null,d4=null,p4=!1;function WJ(e,t,n){return f4==t&&d4==n?p4:(f4=t,d4=n,p4=n=="up"||n=="down"?KJ(e,t,n):$J(e,t,n))}var Zr=0,h4=1,Xa=2,Pi=3,nl=class{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Zr,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n_n(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;nt||s instanceof u0){i=t-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof a0&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?_n(o.dom)+1:0}}else{let o,s=!0;for(;o=r=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,c);t=s;for(let f=a;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=_n(d.dom)+1;break}t-=d.size}i==-1&&(i=0)}if(i>-1&&(u>n||a==this.children.length-1)){n=u;for(let c=a+1;ch&&sn){let h=a;a=l,l=h}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(p)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i=r:tr){let a=r+o.border,l=s-o.border;if(t>=a&&n<=l){this.dirty=t==r||n==s?Xa:h4,t==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Pi:o.markDirty(t-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Xa:Pi}r=s}this.dirty=Xa}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?Xa:h4;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Zr&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},T_=class extends nl{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}},oc=class e extends nl{constructor(t,n,r,i,o){super(t,[],r,i),this.mark=n,this.spec=o}static create(t,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=_o.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Pi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Pi&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Zr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=v_(o,0,t,r));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),c=u&&u.dom,f=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=_o.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let d=c;return c=X4(c,r,n),u?l=new S_(t,n,r,i,c,f||null,d,u,o,s+1):n.isText?new l0(t,n,r,i,c,d,o):new e(t,n,r,i,c,f||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>J.empty)}return t}matchesNode(t,n,r){return this.dirty==Zr&&t.eq(this.node)&&c0(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new __(this,s&&s.node,t);ZJ(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,t,c):u.type.side>=0&&!f&&l.syncToMarks(c==this.node.childCount?$e.none:this.node.child(c).marks,r,t,c),l.placeWidget(u,t,i)},(u,c,f,d)=>{l.syncToMarks(u.marks,r,t,d);let p;l.findNodeMatch(u,c,f,d)||a&&t.state.selection.from>i&&t.state.selection.to-1&&l.updateNodeAt(u,c,f,p,t)||l.updateNextNode(u,c,f,t,d,i)||l.addNode(u,c,f,t,i),i+=u.nodeSize}),l.syncToMarks([],r,t,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Xa)&&(s&&this.protectLocalComposition(t,s),W4(this.contentDOM,this.children,t),ic&&JJ(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof Te)||rn+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=eee(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new T_(this,o,n,i);t.input.compositionNodes.push(s),this.children=v_(this.children,r,r+i.length,t,s)}update(t,n,r,i){return this.dirty==Pi||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Zr}updateOuterDeco(t){if(c0(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=j4(this.dom,this.nodeDOM,x_(this.outerDeco,this.node,n),x_(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function m4(e,t,n,r,i){X4(r,t,e);let o=new Is(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var l0=class e extends Is{constructor(t,n,r,i,o,s,a){super(t,n,r,i,o,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==Pi||this.dirty!=Zr&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Zr||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=Zr,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Pi)}get domAtom(){return!1}isText(t){return this.node.text==t}},u0=class extends nl{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Zr&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},S_=class extends Is{constructor(t,n,r,i,o,s,a,l,u,c){super(t,n,r,i,o,s,a,u,c),this.spec=l}update(t,n,r,i){if(this.dirty==Pi)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}};function W4(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o>1,a=Math.min(s,t.length);for(;o-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=oc.create(this.top,t[s],n,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,s++}}findNodeMatch(t,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof oc)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function QJ(e,t){return e.type.side-t.type.side}function ZJ(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let u=0;uo;)a.push(i[s++]);let h=o+d.nodeSize;if(d.isText){let y=h;s!y.inline):a.slice();r(d,g,t.forChild(o,d),p),o=h}}function JJ(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function eee(e,t,n,r){for(let i=0,o=0;i=n){if(o>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let u=a=0&&u+t.length+a>=n)return a+u;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}function v_(e,t,n,r,i){let o=[];for(let s=0,a=0;s=n||c<=t?o.push(l):(un&&o.push(l.slice(n-u,l.size,r)))}return o}function P_(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,u;if(y0(n)){for(l=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&ge.isSelectable(f)&&i.parent&&!(f.isInline&&kJ(n.focusNode,n.focusOffset,i.dom))){let d=i.posBefore;u=new ge(s==d?a:r.resolve(d))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,d=s;for(let p=0;p{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!Q4(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function nee(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,_n(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&dr&&Ds<=11&&(n.disabled=!0,n.disabled=!1)}function Z4(e,t){if(t instanceof ge){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(T4(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else T4(e)}function T4(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function B_(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||Te.between(t,n,r)}function S4(e){return e.editable&&!e.hasFocus()?!1:J4(e)}function J4(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function ree(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return tl(t.node,t.offset,n.anchorNode,n.anchorOffset)}function C_(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&Oe.findFrom(o,t)}function Os(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function x4(e,t,n){let r=e.state.selection;if(r instanceof Te)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return Os(e,new Te(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=C_(e.state,t);return i&&i instanceof ge?Os(e,i):!1}else if(!(jr&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?ge.isSelectable(o)?Os(e,new ge(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):Ld?Os(e,new Te(e.state.doc.resolve(t<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ge&&r.node.isInline)return Os(e,new Te(t>0?r.$to:r.$from));{let i=C_(e.state,t);return i?Os(e,i):!1}}}function f0(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Rd(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function tc(e,t){return t<0?iee(e):oee(e)}function iee(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Qr&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Rd(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(eB(n))break;{let a=n.previousSibling;for(;a&&Rd(a,-1);)i=n.parentNode,o=_n(a),a=a.previousSibling;if(a)n=a,r=f0(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?A_(e,n,r):i&&A_(e,i,o)}function oee(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=f0(n),o,s;for(;;)if(r{e.state==i&&Mo(e)},50)}function _4(e,t){let n=e.state.doc.resolve(t);if(!(an||z4)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function v4(e,t,n){let r=e.state.selection;if(r instanceof Te&&!r.empty||n.indexOf("s")>-1||jr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=C_(e.state,t);if(s&&s instanceof ge)return Os(e,s)}if(!i.parent.inlineContent){let s=t<0?i:o,a=r instanceof Kn?Oe.near(s,t):Oe.findFrom(s,t);return a?Os(e,a):!1}return!1}function C4(e,t){if(!(e.state.selection instanceof Te))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=e.state.tr;return t<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),e.dispatch(s),!0}return!1}function A4(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function lee(e){if(!In||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;A4(e,r,"true"),setTimeout(()=>A4(e,r,"false"),20)}return!1}function uee(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function cee(e,t){let n=t.keyCode,r=uee(t);if(n==8||jr&&n==72&&r=="c")return C4(e,-1)||tc(e,-1);if(n==46&&!t.shiftKey||jr&&n==68&&r=="c")return C4(e,1)||tc(e,1);if(n==13||n==27)return!0;if(n==37||jr&&n==66&&r=="c"){let i=n==37?_4(e,e.state.selection.from)=="ltr"?-1:1:-1;return x4(e,i,r)||tc(e,i)}else if(n==39||jr&&n==70&&r=="c"){let i=n==39?_4(e,e.state.selection.from)=="ltr"?1:-1:1;return x4(e,i,r)||tc(e,i)}else{if(n==38||jr&&n==80&&r=="c")return v4(e,-1,r)||tc(e,-1);if(n==40||jr&&n==78&&r=="c")return lee(e)||v4(e,1,r)||tc(e,1);if(r==(jr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function U_(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=e.someProp("clipboardSerializer")||_o.fromSchema(e.state.schema),a=sB(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u=l.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=oB[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let h=a.createElement(c[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),f++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,` + +`);return{dom:l,text:d,slice:t}}function tB(e,t,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!t)return null;let l=!!t&&(r||o||!n);if(l){if(e.someProp("transformPastedText",d=>{t=d(t,o||r,e)}),o)return a=new le(J.from(e.state.schema.text(t.replace(/\r\n?/g,` +`))),0,0),e.someProp("transformPasted",d=>{a=d(a,e,!0)}),a;let f=e.someProp("clipboardTextParser",d=>d(t,i,r,e));if(f)a=f;else{let d=i.marks(),{schema:p}=e.state,h=_o.fromSchema(p);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(h.serializeNode(p.text(g,d)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),s=hee(n),Ld&&mee(s);let u=s&&s.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Ii.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!fee.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)a=gee(N4(a,+c[1],+c[2]),c[4]);else if(a=le.maxOpen(dee(a.content,i),!0),a.openStart||a.openEnd){let f=0,d=0;for(let p=a.content.firstChild;f{a=f(a,e,l)}),a}var fee=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function dee(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),u;if(!l)return s=null;if(u=s.length&&o.length&&rB(l,o,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=iB(s[s.length-1],o.length));let c=nB(a,l);s.push(c),i=i.matchType(c.type),o=l}}),s)return J.from(s)}return e}function nB(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,J.from(e));return e}function rB(e,t,n,r,i){if(i1&&(o=0),i=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(J.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function N4(e,t,n){return tn})),p_.createHTML(e)):e}function hee(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=sB().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&oB[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"").reverse().join("")),n.innerHTML=pee(e),i)for(let o=0;o=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=J.from(l.create(r[a+1],i)),o++,s++}return new le(i,o,s)}var Yn={},$n={},bee={touchstart:!0,touchmove:!0},w_=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function yee(e){for(let t in Yn){let n=Yn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{Tee(e,r)&&!F_(e,r)&&(e.editable||!(r.type in $n))&&n(e,r)},bee[t]?{passive:!0}:void 0)}In&&e.dom.addEventListener("input",()=>null),R_(e)}function ko(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Eee(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function R_(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>F_(e,r))})}function F_(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Tee(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function See(e,t){!F_(e,t)&&Yn[t.type]&&(e.editable||!(t.type in $n))&&Yn[t.type](e,t)}$n.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!uB(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Ro&&an&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),ic&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,ja(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||cee(e,n)?n.preventDefault():ko(e,"key")};$n.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};$n.keypress=(e,t)=>{let n=t;if(uB(e)||!n.charCode||n.ctrlKey&&!n.altKey||jr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof Te)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",s=>s(e,r.$from.pos,r.$to.pos,i,o))&&e.dispatch(o()),n.preventDefault()}};function Pd(e){return{left:e.clientX,top:e.clientY}}function xee(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function H_(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,a=>s>o.depth?a(e,n,o.nodeAfter,o.before(s),i,!0):a(e,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Bd(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n=="pointer"&&r.setMeta("pointer",!0),e.dispatch(r)}function _ee(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&ge.isSelectable(r)?(Bd(e,new ge(n),"pointer"),!0):!1}function vee(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof ge&&(r=n.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(ge.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Bd(e,ge.create(e.state.doc,i),"pointer"),!0):!1}function Cee(e,t,n,r,i){return H_(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?vee(e,n):_ee(e,n))}function Aee(e,t,n,r){return H_(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function Nee(e,t,n,r){return H_(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||wee(e,n,r)}function wee(e,t,n){if(n.button!=0)return!1;let r=aB(e,t,!0),i=e.state.doc;return r?(Bd(e,r,"pointer"),r instanceof Te&&i.eq(e.state.doc)&&(e.input.mouseDown=new M_(e,r)),!0):!1}function aB(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?Te.create(r,0,r.content.size):null;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)return Te.create(r,a+1,a+1+s.content.size);if(n&&ge.isSelectable(s))return ge.create(r,a)}return null}function z_(e){return p0(e)}var lB=jr?"metaKey":"ctrlKey";Yn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=z_(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&xee(n,e.input.lastClick)&&!n[lB]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let s=e.posAtCoords(Pd(n));s&&(o=="singleClick"?e.input.mouseDown=new k_(e,s,n,!!r):(o=="doubleClick"?Aee:Nee)(e,s.pos,s.inside,n)?n.preventDefault():ko(e,"pointer"))};var d0=class{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},k_=class extends d0{constructor(t,n,r,i){super(t),this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!r[lB],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),s=n.inside;else{let c=t.state.doc.resolve(n.pos);o=c.parent,s=c.depth?c.before():0}let a=i?null:r.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=t.state;r.button==0&&(o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof ge&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Qr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),ko(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Mo(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Pd(t))),this.updateAllowDefault(t),this.allowDefault||!n?ko(this.view,"pointer"):Cee(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||In&&this.mightDrag&&!this.mightDrag.node.isAtom||an&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Bd(this.view,Oe.near(this.view.state.doc.resolve(n.pos)),"pointer"),t.preventDefault()):ko(this.view,"pointer")}move(t){this.updateAllowDefault(t),ko(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},M_=class extends d0{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),ko(this.view,"pointer");let n=this.view.posAtCoords(Pd(t)),r=n&&aB(this.view,n.inside,!1);if(!r)return;let{doc:i}=this.view.state,o=this.startSelection,[s,a]=r.from{e.input.lastTouch=Date.now(),z_(e),ko(e,"pointer")};Yn.touchmove=e=>{e.input.lastTouch=Date.now(),ko(e,"pointer")};Yn.contextmenu=e=>z_(e);function uB(e,t){return e.composing?!0:In&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Ree=Ro?5e3:-1;$n.compositionstart=$n.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Te&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||an&&z4&&kee(e)))e.markCursor=e.state.storedMarks||n.marks(),p0(e,!0),e.markCursor=null;else if(p0(e,!t.selection.empty),Qr&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=e.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}e.input.composing=!0}cB(e,Ree)};function kee(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}$n.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,cB(e,20))};function cB(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>p0(e),t))}function fB(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Mee(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=wJ(t.focusNode,t.focusOffset),r=RJ(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function p0(e,t=!1){if(!(Ro&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),fB(e),t||e.docView&&e.docView.dirty){let n=P_(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Oee(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var kd=dr&&Ds<15||ic&&DJ<604;Yn.copy=$n.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=kd?null:n.clipboardData,s=r.content(),{dom:a,text:l}=U_(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):Oee(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Dee(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Iee(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Md(e,r.value,null,i,t):Md(e,r.textContent,r.innerHTML,i,t)},50)}function Md(e,t,n,r,i){let o=tB(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,i,o||le.empty)))return!0;if(!o)return!1;let s=Dee(o),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function dB(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}$n.paste=(e,t)=>{let n=t;if(e.composing&&!Ro)return;let r=kd?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Md(e,dB(r),r.getData("text/html"),i,n)?n.preventDefault():Iee(e,n)};var h0=class{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}},Lee=jr?"altKey":"ctrlKey";function pB(e,t){let n;return e.someProp("dragCopies",r=>{n=n||r(t)}),n!=null?!n:!t[Lee]}Yn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Pd(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ge?i.to-1:i.to))){if(r&&r.mightDrag)s=ge.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=e.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=e.docView&&(s=ge.create(e.state.doc,f.posBefore))}}let a=(s||e.state.selection).content(),{dom:l,text:u,slice:c}=U_(e,a);(!n.dataTransfer.files.length||!an||H4>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(kd?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",kd||n.dataTransfer.setData("text/plain",u),e.dragging=new h0(c,pB(e,n),s)};Yn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};$n.dragover=$n.dragenter=(e,t)=>t.preventDefault();$n.drop=(e,t)=>{try{Pee(e,t,e.dragging)}finally{e.dragging=null}};function Pee(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Pd(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",p=>{o=p(o,e,!1)}):o=tB(e,dB(t.dataTransfer),kd?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&pB(e,t));if(e.someProp("handleDrop",p=>p(e,t,o||le.empty,s))){t.preventDefault();return}if(!o)return;t.preventDefault();let a=o?MP(e.state.doc,i.pos,o):i.pos;a==null&&(a=i.pos);let l=e.state.tr;if(s){let{node:p}=n;p?p.replace(l):l.deleteSelection()}let u=l.mapping.map(a),c=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=l.doc;if(c?l.replaceRangeWith(u,u,o.content.firstChild):l.replaceRange(u,u,o),l.doc.eq(f))return;let d=l.doc.resolve(u);if(c&&ge.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new ge(d));else{let p=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((h,g,y,b)=>p=b),l.setSelection(B_(e,d,l.doc.resolve(p)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}Yn.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Mo(e)},20))};Yn.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Yn.beforeinput=(e,t)=>{if(an&&Ro&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,ja(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in $n)Yn[e]=$n[e];function Od(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var m0=class e{constructor(t,n){this.toDOM=t,this.spec=n||Ja,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:s}=t.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Bi(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Od(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}},Za=class e{constructor(t,n){this.attrs=t,this.spec=n||Ja}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Bi(o,s,this)}valid(t,n){return n.from=t&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;st){let a=this.children[s]+1;this.children[s+2].findInner(t-a,n-a,r,i+a,o)}}map(t,n,r){return this==Dn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Ja)}mapInner(t,n,r,i,o){let s;for(let a=0;a{let u=l+r,c;if(c=mB(n,a,u)){for(i||(i=this.children.slice());oa&&f.to=t){this.children[a]==t&&(r=this.children[a+2]);break}let o=t+1,s=o+n.content.size;for(let a=0;ao&&l.type instanceof Za){let u=Math.max(o,l.from)-o,c=Math.min(s,l.to)-o;ui.map(t,n,Ja));return e.from(r)}forChild(t,n){if(n.isLeaf)return pr.empty;let r=[];for(let i=0;in instanceof pr)?t:t.reduce((n,r)=>n.concat(r instanceof pr?r:r.members),[]))}}forEachSet(t){for(let n=0;n{let y=g-h-(p-d);for(let b=0;bE+c-f)continue;let T=a[b]+c-f;p>=T?a[b+1]=d<=T?-2:-1:d>=c&&y&&(a[b]+=y,a[b+1]+=y)}f+=y}),c=n.maps[u].map(c,-1)}let l=!1;for(let u=0;u=r.content.size){l=!0;continue}let d=n.map(e[u+1]+o,-1),p=d-i,{index:h,offset:g}=r.content.findIndex(f),y=r.maybeChild(h);if(y&&g==f&&g+y.nodeSize==p){let b=a[u+2].mapInner(n,y,c+1,e[u]+o+1,s);b!=Dn?(a[u]=f,a[u+1]=p,a[u+2]=b):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=Uee(a,e,t,n,i,o,s),c=b0(u,r,0,s);t=c.local;for(let f=0;fn&&s.to{let u=mB(e,a,l+n);if(u){o=!0;let c=b0(u,a,n+l+1,r);c!=Dn&&i.push(l,l+a.nodeSize,c)}});let s=hB(o?gB(e):e,-n).sort(el);for(let a=0;a0;)t++;e.splice(t,0,n)}function h_(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Dn&&t.push(r)}),e.cursorWrapper&&t.push(pr.create(e.state.doc,[e.cursorWrapper.deco])),g0.from(t)}var Fee={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Hee=dr&&Ds<=11,D_=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}},I_=class{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new D_,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():In&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Hee&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Fee)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(S4(this.view)){if(this.suppressingSelectionUpdates)return Mo(this.view);if(dr&&Ds<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&tl(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let o=t.focusNode;o;o=rc(o))n.add(o);for(let o=t.anchorNode;o;o=rc(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&S4(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(t.editable)for(let c=0;cc.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46||an&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(c=>c.type=="childList"&&c.removedNodes.length))){for(let c of l)if(c.nodeName=="BR"&&c.parentNode){let f=c.nextSibling;for(;f&&f.nodeType==1;){if(f.contentEditable=="false"){c.parentNode.removeChild(c);break}f=f.firstChild}}}else if(Qr&&l.length){let c=l.filter(f=>f.nodeName=="BR");if(c.length==2){let[f,d]=c;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of c){let p=d.parentNode;p&&p.nodeName=="LI"&&(!f||Vee(t,f)!=p)&&d.remove()}}}let u=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||i)&&(o>-1&&(t.docView.markDirty(o,s),zee(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,Gee(t,l)),this.handleDOMChange(o,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||Mo(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let c=0;ci;y--){let b=r.childNodes[y-1],E=b.pmViewDesc;if(b.nodeName=="BR"&&!E){o=y;break}if(!E||E.size)break}let f=e.state.doc,d=e.someProp("domParser")||Ii.fromSchema(e.state.schema),p=f.resolve(s),h=null,g=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:Yee,context:p});if(u&&u[0].pos!=null){let y=u[0].pos,b=u[1]&&u[1].pos;b==null&&(b=y),h={anchor:y+s,head:b+s}}return{doc:g,sel:h,from:s,to:a}}function Yee(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(In&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||In&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}var $ee=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Wee(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let R=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,O=P_(e,R);if(O&&!e.state.selection.eq(O)){if(an&&Ro&&e.input.lastKeyCode===13&&Date.now()-100C(e,ja(13,"Enter"))))return;let B=e.state.tr.setSelection(O);R=="pointer"?B.setMeta("pointer",!0):R=="key"&&B.scrollIntoView(),o&&B.setMeta("composition",o),e.dispatch(B)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l=e.state.selection,u=Kee(e,t,n),c=e.state.doc,f=c.slice(u.from,u.to),d,p;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Ro)&&i.some(R=>R.nodeType==1&&!$ee.test(R.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",R=>R(e,ja(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!h)if(r&&l instanceof Te&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let R=D4(e,e.state.doc,u.sel);if(R&&!R.eq(e.state.selection)){let O=e.state.tr.setSelection(R);o&&O.setMeta("composition",o),e.dispatch(O)}}return}e.state.selection.frome.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?h.start=e.state.selection.from:h.endA=e.state.selection.to-2&&e.state.selection.to<=u.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),dr&&Ds<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)==" \xA0"&&(h.start--,h.endA--,h.endB--);let g=u.doc.resolveNoCache(h.start-u.from),y=u.doc.resolveNoCache(h.endB-u.from),b=c.resolve(h.start),E=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=h.endA;if((ic&&e.input.lastIOSEnter>Date.now()-225&&(!E||i.some(R=>R.nodeName=="DIV"||R.nodeName=="P"))||!E&&g.posR(e,ja(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&Xee(c,h.start,h.endA,g,y)&&e.someProp("handleKeyDown",R=>R(e,ja(8,"Backspace")))){Ro&&an&&e.domObserver.suppressSelectionUpdates();return}an&&h.endB==h.start&&(e.input.lastChromeDelete=Date.now()),Ro&&!E&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,y=u.doc.resolveNoCache(h.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(R){return R(e,ja(13,"Enter"))})},20));let T=h.start,S=h.endA,v=R=>{let O=R||e.state.tr.replace(T,S,u.doc.slice(h.start-u.from,h.endB-u.from));if(u.sel){let B=D4(e,O.doc,u.sel);B&&!(an&&e.composing&&B.empty&&(h.start!=h.endB||e.input.lastChromeDeleteMo(e),20));let R=v(e.state.tr.delete(T,S)),O=c.resolve(h.start).marksAcross(c.resolve(h.endA));O&&R.ensureMarks(O),e.dispatch(R)}else if(h.endA==h.endB&&(x=jee(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start())))){let R=v(e.state.tr);x.type=="add"?R.addMark(T,S,x.mark):R.removeMark(T,S,x.mark),e.dispatch(R)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let R=g.parent.textBetween(g.parentOffset,y.parentOffset),O=()=>v(e.state.tr.insertText(R,T,S));e.someProp("handleTextInput",B=>B(e,T,S,R,O))||e.dispatch(O())}else e.dispatch(v());else e.dispatch(v())}function D4(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:B_(e,t.resolve(n.anchor),t.resolve(n.head))}function jee(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,s,a,l;for(let c=0;cc.mark(a.addToSet(c.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=c=>c.mark(a.removeFromSet(c.marks));else return null;let u=[];for(let c=0;cn||m_(s,!0,!1)0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Qee(e,t,n,r,i){let o=e.findDiffStart(t,n),s=n+e.size,a=n+t.size;if(o==null)return null;let{a:l,b:u}=e.findDiffEnd(t,s,a);if(i=="end"){let c=Math.max(0,o-Math.min(l,u));r-=l+c-o}if(l=l?o-r:0;o-=c,u=o+(u-l),l=o}else if(u=u?o-r:0;o-=c,l=o+(l-u),u=o}return{start:o,endA:l,endB:u}}var Dd=class{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new w_,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(U4),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=P4(this),L4(this),this.nodeViews=B4(this),this.docView=m4(this.state.doc,I4(this),h_(this),this.dom,this),this.domObserver=new I_(this,(r,i,o,s)=>Wee(this,r,i,o,s)),this.domObserver.start(),yee(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&R_(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(U4),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let i=this.state,o=!1,s=!1;t.storedMarks&&this.composing&&(fB(this),s=!0),this.state=t;let a=i.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=B4(this);Jee(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&R_(this),this.editable=P4(this),L4(this);let l=h_(this),u=I4(this),c=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(t.doc,u,l);(f||!t.selection.eq(i.selection))&&(s=!0);let d=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&PJ(this);if(s){this.domObserver.stop();let p=f&&(dr||an)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&Zee(i.selection,t.selection);if(f){let g=an?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Mee(this)),(o||!this.docView.update(t.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=m4(t.doc,u,l,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}let h=this.input.mouseDown;p||!(h&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ree(this)&&h.delaySelUpdate())?Mo(this,p):(Z4(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&BJ(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ge){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&u4(this,n.getBoundingClientRect(),t)}else u4(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&on.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return VJ(this,t)}coordsAtPos(t,n=1){return Y4(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return WJ(this,n||this.state,t)}pasteHTML(t,n){return Md(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Md(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return U_(this,t)}destroy(){this.docView&&(Eee(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],h_(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,AJ())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return See(this,t)}domSelectionRange(){let t=this.domSelection();return t?In&&this.root.nodeType===11&&MJ(this.dom.ownerDocument)==this.dom&&qee(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Dd.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function I4(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Bi.node(0,e.state.doc.content.size,t)]}function L4(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Bi.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function P4(e){return!e.someProp("editable",t=>t(e.state)===!1)}function Zee(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function B4(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Jee(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function U4(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Oo={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},T0={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ete=typeof navigator<"u"&&/Mac/.test(navigator.platform),tte=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Wt=0;Wt<10;Wt++)Oo[48+Wt]=Oo[96+Wt]=String(Wt);var Wt;for(Wt=1;Wt<=24;Wt++)Oo[Wt+111]="F"+Wt;var Wt;for(Wt=65;Wt<=90;Wt++)Oo[Wt]=String.fromCharCode(Wt+32),T0[Wt]=String.fromCharCode(Wt);var Wt;for(E0 in Oo)T0.hasOwnProperty(E0)||(T0[E0]=Oo[E0]);var E0;function bB(e){var t=ete&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||tte&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?T0:Oo)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var nte=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),rte=typeof navigator<"u"&&/Win/.test(navigator.platform);function ite(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a{for(var n in t)ate(e,n,{get:t[n],enumerable:!0})};function R0(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var k0=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([s,a])=>[s,(...u)=>{let c=a(...u)(o);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),c}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,u=()=>(!a&&t&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(l),s.every(f=>f===!0)),c={...Object.fromEntries(Object.entries(n).map(([f,d])=>[f,(...h)=>{let g=this.buildProps(l,t),y=d(...h)(g);return s.push(y),c}])),run:u};return c}createCan(e){let{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,o=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...u)=>l(...u)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:R0({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...u)=>l(...u)(s)]))}};return s}},RB={};j_(RB,{blur:()=>lte,clearContent:()=>ute,clearNodes:()=>cte,command:()=>fte,createParagraphNear:()=>dte,cut:()=>pte,deleteCurrentNode:()=>hte,deleteNode:()=>mte,deleteRange:()=>gte,deleteSelection:()=>Ete,enter:()=>Tte,exitCode:()=>Ste,extendMarkRange:()=>xte,first:()=>_te,focus:()=>Cte,forEach:()=>Ate,insertContent:()=>Nte,insertContentAt:()=>kte,joinBackward:()=>Dte,joinDown:()=>Ote,joinForward:()=>Ite,joinItemBackward:()=>Lte,joinItemForward:()=>Pte,joinTextblockBackward:()=>Bte,joinTextblockForward:()=>Ute,joinUp:()=>Mte,keyboardShortcut:()=>Hte,lift:()=>zte,liftEmptyBlock:()=>qte,liftListItem:()=>Vte,newlineInCode:()=>Gte,resetAttributes:()=>Kte,scrollIntoView:()=>Yte,selectAll:()=>$te,selectNodeBackward:()=>Wte,selectNodeForward:()=>jte,selectParentNode:()=>Xte,selectTextblockEnd:()=>Qte,selectTextblockStart:()=>Zte,setContent:()=>Jte,setMark:()=>Ene,setMeta:()=>Tne,setNode:()=>Sne,setNodeSelection:()=>xne,setTextDirection:()=>_ne,setTextSelection:()=>vne,sinkListItem:()=>Cne,splitBlock:()=>Ane,splitListItem:()=>Nne,toggleList:()=>Rne,toggleMark:()=>kne,toggleNode:()=>Mne,toggleWrap:()=>One,undoInputRule:()=>Dne,unsetAllMarks:()=>Ine,unsetMark:()=>Lne,unsetTextDirection:()=>Pne,updateAttributes:()=>Bne,wrapIn:()=>Une,wrapInList:()=>Fne});var lte=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),ute=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),cte=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{e.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;let{doc:u,mapping:c}=t,f=u.resolve(c.map(l)),d=u.resolve(c.map(l+a.nodeSize)),p=f.blockRange(d);if(!p)return;let h=Ao(p);if(a.type.isTextblock){let{defaultType:g}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(p.start,g)}(h||h===0)&&t.lift(p,h)})}),!0},fte=e=>t=>e(t),dte=()=>({state:e,dispatch:t})=>o_(e,t),pte=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new Te(r.doc.resolve(Math.max(s-1,0)))),!0},hte=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){let a=i.before(o),l=i.after(o);e.delete(a,l).scrollIntoView()}return!0}return!1};function ln(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var mte=e=>({tr:t,state:n,dispatch:r})=>{let i=ln(e,n.schema),o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let l=o.before(s),u=o.after(s);t.delete(l,u).scrollIntoView()}return!0}return!1},gte=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},bte=e=>e.content?/^text(\*|\+)/.test(e.content):!1,EB=(e,t,n)=>{if(!e.parent.isInline||n==="left"&&e.pos>e.start()||n==="right"&&e.pos{let r=EB(e,n,"left"),i=EB(t,n,"right");return{from:r,to:i}},Ete=()=>({state:e,dispatch:t})=>{let{$from:n,$to:r}=e.selection;if(e.selection.empty)return!1;let{from:i,to:o}=yte(n,r,e.schema);return t&&(e.tr.deleteRange(i,o).scrollIntoView(),t(e.tr)),!0},Tte=()=>({commands:e})=>e.keyboardShortcut("Enter"),Ste=()=>({state:e,dispatch:t})=>i_(e,t);function X_(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function A0(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:X_(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function kB(e,t,n={}){return e.find(r=>r.type===t&&A0(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function TB(e,t,n={}){return!!kB(e,t,n)}function MB(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(u=>u.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(u=>u.type===t))return;if(!n){let u=r.node.marks.find(c=>c.type===t);u&&(n=u.attrs)}if(!kB([...r.node.marks],t,n))return;let o=r.index,s=e.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(;o>0&&TB([...e.parent.child(o-1).marks],t,n);)o-=1,s-=e.parent.child(o).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{let o=Do(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(i){let f=MB(l,o,t);if(f&&f.from<=u&&f.to>=c){let d=Te.create(s,f.from,f.to);n.setSelection(d)}}return!0},_te=e=>t=>{let n=typeof e=="function"?e(t):e;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let s=()=>{(N0()||SB())&&r.dom.focus(),vte()&&!N0()&&!SB()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(o&&e===null&&!OB(n.state.selection))return s(),!0;let a=DB(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},Ate=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),Nte=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),IB=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&IB(r)}return e};function S0(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`${e}`,n=new window.DOMParser().parseFromString(t,"text/html").body;return IB(n)}function zd(e,t,n){if(e instanceof fr||e instanceof J)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return J.fromArray(e.map(a=>t.nodeFromJSON(a)));let s=t.nodeFromJSON(e);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),zd("",t,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="",l=new Wu({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(s=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?Ii.fromSchema(l).parseSlice(S0(e),n.parseOptions):Ii.fromSchema(l).parse(S0(e),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}let o=Ii.fromSchema(t);return n.slice?o.parseSlice(S0(e),n.parseOptions).content:o.parse(S0(e),n.parseOptions)}return zd("",t,n)}function wte(e,t,n){let r=e.steps.length-1;if(r{s===0&&(s=c)}),e.setSelection(Oe.near(e.doc.resolve(s),n))}var Rte=e=>!("type"in e),kte=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a,l=y=>{o.emit("contentError",{editor:o,error:y,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{zd(t,o.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(y){l(y)}try{a=zd(t,o.schema,{parseOptions:u,errorOnInvalidContent:(s=n.errorOnInvalidContent)!=null?s:o.options.enableContentCheck})}catch(y){return l(y),!1}let{from:c,to:f}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},d=!0,p=!0;if((Rte(a)?a:[a]).forEach(y=>{y.check(),d=d?y.isText&&y.marks.length===0:!1,p=p?y.isBlock:!1}),c===f&&p){let{parent:y}=r.doc.resolve(c);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(c-=1,f+=1)}let g;if(d){if(Array.isArray(t))g=t.map(y=>y.text||"").join("");else if(t instanceof J){let y="";t.forEach(b=>{b.text&&(y+=b.text)}),g=y}else typeof t=="object"&&t&&t.text?g=t.text:g=t;r.insertText(g,c,f)}else{g=a;let y=r.doc.resolve(c),b=y.node(),E=y.parentOffset===0,T=b.isText||b.isTextblock,S=b.content.size>0;E&&T&&S&&p&&(c=Math.max(0,c-1)),r.replaceWith(c,f,g)}n.updateSelection&&wte(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:g})}return!0},Mte=()=>({state:e,dispatch:t})=>QP(e,t),Ote=()=>({state:e,dispatch:t})=>ZP(e,t),Dte=()=>({state:e,dispatch:t})=>Xx(e,t),Ite=()=>({state:e,dispatch:t})=>Jx(e,t),Lte=()=>({state:e,dispatch:t,tr:n})=>{try{let r=$a(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Pte=()=>({state:e,dispatch:t,tr:n})=>{try{let r=$a(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Bte=()=>({state:e,dispatch:t})=>$P(e,t),Ute=()=>({state:e,dispatch:t})=>WP(e,t);function LB(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Fte(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a({editor:t,view:n,tr:r,dispatch:i})=>{let o=Fte(e).split(/-(?!$)/),s=o.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l?.steps.forEach(u=>{let c=u.map(r.mapping);c&&i&&r.maybeStep(c)}),!0};function qd(e,t,n={}){let{from:r,to:i,empty:o}=e.selection,s=t?ln(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;let p=Math.max(r,d),h=Math.min(i,d+f.nodeSize);a.push({node:f,from:p,to:h})});let l=i-r,u=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>A0(f.node.attrs,n,{strict:!1}));return o?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=l}var zte=(e,t={})=>({state:n,dispatch:r})=>{let i=ln(e,n.schema);return qd(n,i,t)?JP(n,r):!1},qte=()=>({state:e,dispatch:t})=>s_(e,t),Vte=e=>({state:t,dispatch:n})=>{let r=ln(e,t.schema);return o4(r)(t,n)},Gte=()=>({state:e,dispatch:t})=>n_(e,t);function M0(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function xB(e,t){let n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}var Kte=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=M0(typeof e=="string"?e:e.name,r.schema);if(!a)return!1;a==="node"&&(o=ln(e,r.schema)),a==="mark"&&(s=Do(e,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,f)=>{o&&o===c.type&&(l=!0,i&&n.setNodeMarkup(f,void 0,xB(c.attrs,t))),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&(l=!0,i&&n.addMark(f,f+c.nodeSize,s.create(xB(d.attrs,t))))})})}),l},Yte=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),$te=()=>({tr:e,dispatch:t})=>{if(t){let n=new Kn(e.doc);e.setSelection(n)}return!0},Wte=()=>({state:e,dispatch:t})=>Qx(e,t),jte=()=>({state:e,dispatch:t})=>e_(e,t),Xte=()=>({state:e,dispatch:t})=>e4(e,t),Qte=()=>({state:e,dispatch:t})=>l_(e,t),Zte=()=>({state:e,dispatch:t})=>a_(e,t);function $_(e,t,n={},r={}){return zd(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Jte=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{let{doc:l}=o;if(r.preserveWhitespace!=="full"){let u=$_(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return s&&o.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function PB(e,t){let n=Do(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});let a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function ene(e,t){let n=new Qu(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function tne(e){for(let t=0;t0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function Q_(e){return t=>nne(t.$from,e)}function pe(e,t,n){return e.config[t]===void 0&&e.parent?pe(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?pe(e.parent,t,n):null}):e.config[t]}function Z_(e){return e.map(t=>{let n={name:t.name,options:t.options,storage:t.storage},r=pe(t,"addExtensions",n);return r?[t,...Z_(r())]:t}).flat(10)}function J_(e,t){let n=_o.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function BB(e){return typeof e=="function"}function Nt(e,t=void 0,...n){return BB(e)?t?e.bind(t)(...n):e(...n):e}function rne(e={}){return Object.keys(e).length===0&&e.constructor===Object}function sc(e){let t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function UB(e){let t=[],{nodeExtensions:n,markExtensions:r}=sc(e),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(u=>u.name!=="text").map(u=>u.name),a=r.map(u=>u.name),l=[...s,...a];return e.forEach(u=>{let c={name:u.name,options:u.options,storage:u.storage,extensions:i},f=pe(u,"addGlobalAttributes",c);if(!f)return;f().forEach(p=>{let h;Array.isArray(p.types)?h=p.types:p.types==="*"?h=l:p.types==="nodes"?h=s:p.types==="marks"?h=a:h=[],h.forEach(g=>{Object.entries(p.attributes).forEach(([y,b])=>{t.push({type:g,name:y,attribute:{...o,...b}})})})})}),i.forEach(u=>{let c={name:u.name,options:u.options,storage:u.storage},f=pe(u,"addAttributes",c);if(!f)return;let d=f();Object.entries(d).forEach(([p,h])=>{let g={...o,...h};typeof g?.default=="function"&&(g.default=g.default()),g?.isRequired&&g?.default===void 0&&delete g.default,t.push({type:u.name,name:p,attribute:g})})}),t}function ine(e){let t=[],n="",r=!1,i=!1,o=0,s=e.length;for(let a=0;a0){o-=1,n+=l;continue}if(l===";"&&o===0){t.push(n),n="";continue}}n+=l}return n&&t.push(n),t}function _B(e){let t=[],n=ine(e||""),r=n.length;for(let i=0;i!!t).reduce((t,n)=>{let r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let a=o?String(o).split(" "):[],l=r[i]?r[i].split(" "):[],u=a.filter(c=>!l.includes(c));r[i]=[...l,...u].join(" ")}else if(i==="style"){let a=new Map([..._B(r[i]),..._B(o)]);r[i]=Array.from(a.entries()).map(([l,u])=>`${l}: ${u}`).join("; ")}else r[i]=o}),r},{})}function w0(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>Vd(n,r),{})}function one(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function vB(e,t){return"style"in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((o,s)=>{let a=s.attribute.parseHTML?s.attribute.parseHTML(n):one(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function CB(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&rne(n)?!1:n!=null))}function AB(e){var t,n;let r={};return!((t=e?.attribute)!=null&&t.isRequired)&&"default"in(e?.attribute||{})&&(r.default=e.attribute.default),((n=e?.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function sne(e,t){var n;let r=UB(e),{nodeExtensions:i,markExtensions:o}=sc(e),s=(n=i.find(u=>pe(u,"topNode")))==null?void 0:n.name,a=Object.fromEntries(i.map(u=>{let c=r.filter(b=>b.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:t},d=e.reduce((b,E)=>{let T=pe(E,"extendNodeSchema",f);return{...b,...T?T(u):{}}},{}),p=CB({...d,content:Nt(pe(u,"content",f)),marks:Nt(pe(u,"marks",f)),group:Nt(pe(u,"group",f)),inline:Nt(pe(u,"inline",f)),atom:Nt(pe(u,"atom",f)),selectable:Nt(pe(u,"selectable",f)),draggable:Nt(pe(u,"draggable",f)),code:Nt(pe(u,"code",f)),whitespace:Nt(pe(u,"whitespace",f)),linebreakReplacement:Nt(pe(u,"linebreakReplacement",f)),defining:Nt(pe(u,"defining",f)),isolating:Nt(pe(u,"isolating",f)),attrs:Object.fromEntries(c.map(AB))}),h=Nt(pe(u,"parseHTML",f));h&&(p.parseDOM=h.map(b=>vB(b,c)));let g=pe(u,"renderHTML",f);g&&(p.toDOM=b=>g({node:b,HTMLAttributes:w0(b,c)}));let y=pe(u,"renderText",f);return y&&(p.toText=y),[u.name,p]})),l=Object.fromEntries(o.map(u=>{let c=r.filter(y=>y.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:t},d=e.reduce((y,b)=>{let E=pe(b,"extendMarkSchema",f);return{...y,...E?E(u):{}}},{}),p=CB({...d,inclusive:Nt(pe(u,"inclusive",f)),excludes:Nt(pe(u,"excludes",f)),group:Nt(pe(u,"group",f)),spanning:Nt(pe(u,"spanning",f)),code:Nt(pe(u,"code",f)),attrs:Object.fromEntries(c.map(AB))}),h=Nt(pe(u,"parseHTML",f));h&&(p.parseDOM=h.map(y=>vB(y,c)));let g=pe(u,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:w0(y,c)})),[u.name,p]}));return new Wu({topNode:s,nodes:a,marks:l})}function ane(e){let t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function Hd(e){return e.sort((n,r)=>{let i=pe(n,"priority")||100,o=pe(r,"priority")||100;return i>o?-1:ir.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),t}function HB(e,t,n){let{from:r,to:i}=t,{blockSeparator:o=` + +`,textSerializers:s={}}=n||{},a="";return e.nodesBetween(r,i,(l,u,c,f)=>{var d;l.isBlock&&u>r&&(a+=o);let p=s?.[l.type.name];if(p)return c&&(a+=p({node:l,pos:u,parent:c,index:f,range:t})),!1;l.isText&&(a+=(d=l?.text)==null?void 0:d.slice(Math.max(r,u)-u,i-u))}),a}function lne(e,t){let n={from:0,to:e.content.size};return HB(e,n,t)}function zB(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function une(e,t){let n=ln(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,a=>{o.push(a)});let s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function cne(e,t){let n=M0(typeof t=="string"?t:t.name,e.schema);return n==="node"?une(e,t):n==="mark"?PB(e,t):{}}function fne(e,t=JSON.stringify){let n={};return e.filter(r=>{let i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function dne(e){let t=fne(e);return t.length===1?t:t.filter((n,r)=>!t.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function pne(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{let{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{let u=t.slice(o).map(a,-1),c=t.slice(o).map(l),f=t.invert().map(u,-1),d=t.invert().map(c);r.push({oldRange:{from:f,to:d},newRange:{from:u,to:c}})})}),dne(r)}function Ud(e,t){return t.nodes[e]||t.marks[e]||null}function C0(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}var hne=(e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,s,a)=>{var l,u;let c=((u=(l=i.type.spec).toText)==null?void 0:u.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?c:c.slice(0,Math.max(0,r-o))}),n};function W_(e,t,n={}){let{empty:r,ranges:i}=e.selection,o=t?Do(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>A0(f.attrs,n,{strict:!1}));let s=0,a=[];if(i.forEach(({$from:f,$to:d})=>{let p=f.pos,h=d.pos;e.doc.nodesBetween(p,h,(g,y)=>{if(o&&g.inlineContent&&!g.type.allowsMarkType(o))return!1;if(!g.isText&&!g.marks.length)return;let b=Math.max(p,y),E=Math.min(h,y+g.nodeSize),T=E-b;s+=T,a.push(...g.marks.map(S=>({mark:S,from:b,to:E})))})}),s===0)return!1;let l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>A0(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+u:l)>=s}function mne(e,t,n={}){if(!t)return qd(e,null,n)||W_(e,null,n);let r=M0(t,e.schema);return r==="node"?qd(e,t,n):r==="mark"?W_(e,t,n):!1}function NB(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function G_(e,t){let{nodeExtensions:n}=sc(t),r=n.find(s=>s.name===e);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=Nt(pe(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function ev(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return!/\S/.test((r=e.text)!=null?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(o=>{i!==!1&&(ev(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}var qB=class VB{constructor(t){this.position=t}static fromJSON(t){return new VB(t.position)}toJSON(){return{position:this.position}}};function gne(e,t){let n=t.mapping.mapResult(e.position);return{position:new qB(n.pos),mapResult:n}}function bne(e){return new qB(e)}function yne(e,t,n){var r;let{selection:i}=t,o=null;if(OB(i)&&(o=i.$cursor),o){let a=(r=e.storedMarks)!=null?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(u=>u.type.excludes(n)))}let{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(a.pos,l.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){let p=!d||d.type.allowsMarkType(n),h=!!n.isInSet(c.marks)||!c.marks.some(g=>g.type.excludes(n));u=p&&h}return!u}),u})}var Ene=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:a}=o,l=Do(e,r.schema);if(i)if(s){let u=PB(r,l);n.addStoredMark(l.create({...u,...t}))}else a.forEach(u=>{let c=u.$from.pos,f=u.$to.pos;r.doc.nodesBetween(c,f,(d,p)=>{let h=Math.max(p,c),g=Math.min(p+d.nodeSize,f);d.marks.find(b=>b.type===l)?d.marks.forEach(b=>{l===b.type&&n.addMark(h,g,l.create({...b.attrs,...t}))}):n.addMark(h,g,l.create(t))})});return yne(r,n,l)},Tne=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Sne=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let o=ln(e,n.schema),s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>u_(o,{...s,...t})(n)?!0:a.clearNodes()).command(({state:a})=>u_(o,{...s,...t})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},xne=e=>({tr:t,dispatch:n})=>{if(n){let{doc:r}=t,i=rl(e,0,r.content.size),o=ge.create(r,i);t.setSelection(o)}return!0},_ne=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=r,s,a;return typeof t=="number"?(s=t,a=t):t&&"from"in t&&"to"in t?(s=t.from,a=t.to):(s=o.from,a=o.to),i&&n.doc.nodesBetween(s,a,(l,u)=>{l.isText||n.setNodeMarkup(u,void 0,{...l.attrs,dir:e})}),!0},vne=e=>({tr:t,dispatch:n})=>{if(n){let{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,s=Te.atStart(r).from,a=Te.atEnd(r).to,l=rl(i,s,a),u=rl(o,s,a),c=Te.create(r,l,u);t.setSelection(c)}return!0},Cne=e=>({state:t,dispatch:n})=>{let r=ln(e,t.schema);return s4(r)(t,n)};function wB(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(i=>t?.includes(i.type.name));e.tr.ensureMarks(r)}}var Ane=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=t,{$from:a,$to:l}=o,u=i.extensionManager.attributes,c=C0(u,a.node().type.name,a.node().attrs);if(o instanceof ge&&o.node.isBlock)return!a.parentOffset||!Ir(s,a.pos)?!1:(r&&(e&&wB(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;let f=l.parentOffset===l.parent.content.size,d=a.depth===0?void 0:tne(a.node(-1).contentMatchAt(a.indexAfter(-1))),p=f&&d?[{type:d,attrs:c}]:void 0,h=Ir(t.doc,t.mapping.map(a.pos),1,p);if(!p&&!h&&Ir(t.doc,t.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(h=!0,p=d?[{type:d,attrs:c}]:void 0),r){if(h&&(o instanceof Te&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,p),d&&!f&&!a.parentOffset&&a.parent.type!==d)){let g=t.mapping.map(a.before()),y=t.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,d)&&t.setNodeMarkup(t.mapping.map(a.before()),d)}e&&wB(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return h},Nne=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let a=ln(e,r.schema),{$from:l,$to:u}=r.selection,c=r.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(u))return!1;let f=l.node(-1);if(f.type!==a)return!1;let d=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let b=J.empty,E=l.index(-1)?1:l.index(-2)?2:3;for(let O=l.depth-E;O>=l.depth-3;O-=1)b=J.from(l.node(O).copy(b));let T=l.indexAfter(-1){if(R>-1)return!1;O.isTextblock&&O.content.size===0&&(R=B+1)}),R>-1&&n.setSelection(Te.near(n.doc.resolve(R))),n.scrollIntoView()}return!0}let p=u.pos===l.end()?f.contentMatchAt(0).defaultType:null,h={...C0(d,f.type.name,f.attrs),...t},g={...C0(d,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,u.pos);let y=p?[{type:a,attrs:h},{type:p,attrs:g}]:[{type:a,attrs:h}];if(!Ir(n.doc,l.pos,2))return!1;if(i){let{selection:b,storedMarks:E}=r,{splittableMarks:T}=o.extensionManager,S=E||b.$to.parentOffset&&b.$from.marks();if(n.split(l.pos,2,y).scrollIntoView(),!S||!i)return!0;let v=S.filter(x=>T.includes(x.type.name));n.ensureMarks(v)}return!0},K_=(e,t)=>{let n=Q_(s=>s.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&ui(e.doc,n.pos)&&e.join(n.pos),!0},Y_=(e,t)=>{let n=Q_(s=>s.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&ui(e.doc,r)&&e.join(r),!0};function wne(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return Te.between(r,i)}var Rne=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:u,can:c})=>{let{extensions:f,splittableMarks:d}=i.extensionManager,p=ln(e,s.schema),h=ln(t,s.schema),{selection:g,storedMarks:y}=s,{$from:b,$to:E}=g,T=b.blockRange(E),S=y||g.$to.parentOffset&&g.$from.marks();if(!T)return!1;let v=Q_(q=>G_(q.type.name,f))(g),x=g.from===0&&g.to===s.doc.content.size,R=s.doc.content.content,O=R.length===1?R[0]:null,B=x&&O&&G_(O.type.name,f)?{node:O,pos:0,depth:0}:null,C=v??B,V=!!v&&T.depth>=1&&T.depth-v.depth<=1,Y=!!B;if((V||Y)&&C){if(C.node.type===p)return x&&Y?l().command(({tr:q,dispatch:L})=>{let H=wne(q);return H?(q.setSelection(H),L&&L(q),!0):!1}).liftListItem(h).run():u.liftListItem(h);if(G_(C.node.type.name,f)&&p.validContent(C.node.content))return l().command(()=>(o.setNodeMarkup(C.pos,p),!0)).command(()=>K_(o,p)).command(()=>Y_(o,p)).run()}return!n||!S||!a?l().command(()=>c().wrapInList(p,r)?!0:u.clearNodes()).wrapInList(p,r).command(()=>K_(o,p)).command(()=>Y_(o,p)).run():l().command(()=>{let q=c().wrapInList(p,r),L=S.filter(H=>d.includes(H.type.name));return o.ensureMarks(L),q?!0:u.clearNodes()}).wrapInList(p,r).command(()=>K_(o,p)).command(()=>Y_(o,p)).run()},kne=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=Do(e,r.schema);return W_(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},Mne=(e,t,n={})=>({state:r,commands:i})=>{let o=ln(e,r.schema),s=ln(t,r.schema),a=qd(r,o,n),l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(s,l):i.setNode(o,{...l,...n})},One=(e,t={})=>({state:n,commands:r})=>{let i=ln(e,n.schema);return qd(n,i,t)?r.lift(i):r.wrapIn(i,t)},Dne=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){let l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,e.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},Ine=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:o}=t,{empty:s,ranges:a}=o;if(s)return!0;let{nonClearableMarks:l}=r.extensionManager;if(n){let u=Object.values(r.schema.marks).filter(c=>i||!l.includes(c.name));a.forEach(c=>{for(let f of u)t.removeMark(c.$from.pos,c.$to.pos,f)})}return!0},Lne=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Do(e,r.schema),{$from:u,empty:c,ranges:f}=a;if(!i)return!0;if(c&&s){let{from:d,to:p}=a,h=(o=u.marks().find(y=>y.type===l))==null?void 0:o.attrs,g=MB(u,l,h);g&&(d=g.from,p=g.to),n.removeMark(d,p,l)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,l)});return n.removeStoredMark(l),!0},Pne=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,o,s;return typeof e=="number"?(o=e,s=e):e&&"from"in e&&"to"in e?(o=e.from,s=e.to):(o=i.from,s=i.to),r&&t.doc.nodesBetween(o,s,(a,l)=>{if(a.isText)return;let u={...a.attrs};delete u.dir,t.setNodeMarkup(l,void 0,u)}),!0},Bne=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=M0(typeof e=="string"?e:e.name,r.schema);if(!a)return!1;a==="node"&&(o=ln(e,r.schema)),a==="mark"&&(s=Do(e,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{let c=u.$from.pos,f=u.$to.pos,d,p,h,g;n.selection.empty?r.doc.nodesBetween(c,f,(y,b)=>{o&&o===y.type&&(l=!0,h=Math.max(b,c),g=Math.min(b+y.nodeSize,f),d=b,p=y)}):r.doc.nodesBetween(c,f,(y,b)=>{b=c&&b<=f&&(o&&o===y.type&&(l=!0,i&&n.setNodeMarkup(b,void 0,{...y.attrs,...t})),s&&y.marks.length&&y.marks.forEach(E=>{if(s===E.type&&(l=!0,i)){let T=Math.max(b,c),S=Math.min(b+y.nodeSize,f);n.addMark(T,S,s.create({...E.attrs,...t}))}}))}),p&&(d!==void 0&&i&&n.setNodeMarkup(d,void 0,{...p.attrs,...t}),s&&p.marks.length&&p.marks.forEach(y=>{s===y.type&&i&&n.addMark(h,g,s.create({...y.attrs,...t}))}))}),l},Une=(e,t={})=>({state:n,dispatch:r})=>{let i=ln(e,n.schema);return r4(i,t)(n,r)},Fne=(e,t={})=>({state:n,dispatch:r})=>{let i=ln(e,n.schema);return i4(i,t)(n,r)},Hne=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(r=>r.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(r=>r!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};var zne=(e,t)=>{if(X_(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function x0(e){var t;let{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;let u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(t=u.nodeBefore||u.nodeAfter)!=null&&t.marks.find(d=>d.type.spec.code))return!1;let c=!1,f=hne(u)+o;return s.forEach(d=>{if(c)return;let p=zne(f,d.find);if(!p)return;let h=l.state.tr,g=R0({state:l.state,transaction:h}),y={from:r-(p[0].length-o.length),to:i},{commands:b,chain:E,can:T}=new k0({editor:n,state:g});d.handler({state:g,range:y,match:p,commands:b,chain:E,can:T})===null||!h.steps.length||(d.undoable&&h.setMeta(a,{transform:h,from:r,to:i,text:o}),l.dispatch(h),c=!0)}),c}function qne(e){let{editor:t,rules:n}=e,r=new Qe({state:{init(){return null},apply(i,o,s){let a=i.getMeta(r);if(a)return a;let l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:c}=l;typeof c=="string"?c=c:c=J_(J.from(c),s.schema);let{from:f}=l,d=f+c.length;x0({editor:t,from:f,to:d,text:c,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return x0({editor:t,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&x0({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?x0({editor:t,from:s.pos,to:s.pos,text:` +`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Vne(e){return Object.prototype.toString.call(e).slice(8,-1)}function _0(e){return Vne(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function GB(e,t){let n={...e};return _0(e)&&_0(t)&&Object.keys(t).forEach(r=>{_0(t[r])&&_0(e[r])?n[r]=GB(e[r],t[r]):n[r]=t[r]}),n}var tv=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Nt(pe(this,"addOptions",{name:this.name}))}}get storage(){return{...Nt(pe(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>GB(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},Gne=class KB extends tv{constructor(){super(...arguments),this.type="mark"}static create(t={}){let n=typeof t=="function"?t():t;return new KB(n)}static handleExit({editor:t,mark:n}){let{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(u=>u?.type.name===n.name))return!1;let l=s.find(u=>u?.type.name===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){let n=typeof t=="function"?t():t;return super.extend(n)}};function Kne(e){return typeof e=="number"}var Yne=(e,t,n)=>{if(X_(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(i=>{let o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function $ne(e){let{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:u,can:c}=new k0({editor:t,state:n}),f=[];return n.doc.nodesBetween(r,i,(p,h)=>{var g,y,b,E,T;if((y=(g=p.type)==null?void 0:g.spec)!=null&&y.code||!(p.isText||p.isTextblock||p.isInline))return;let S=(T=(E=(b=p.content)==null?void 0:b.size)!=null?E:p.nodeSize)!=null?T:0,v=Math.max(r,h),x=Math.min(i,h+S);if(v>=x)return;let R=p.isText?p.text||"":p.textBetween(v-h,x-h,void 0,"\uFFFC");Yne(R,o.find,s).forEach(B=>{if(B.index===void 0)return;let C=v+B.index+1,V=C+B[0].length,Y={from:n.tr.mapping.map(C),to:n.tr.mapping.map(V)},q=o.handler({state:n,range:Y,match:B,commands:l,chain:u,can:c,pasteEvent:s,dropEvent:a});f.push(q)})}),f.every(p=>p!==null)}var v0=null,Wne=e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function jne(e){let{editor:t,rules:n}=e,r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}let l=({state:c,from:f,to:d,rule:p,pasteEvt:h})=>{let g=c.tr,y=R0({state:c,transaction:g});if(!(!$ne({editor:t,state:y,from:Math.max(f-1,0),to:d.b-1,rule:p,pasteEvent:h,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(c=>new Qe({view(f){let d=h=>{var g;r=(g=f.dom.parentElement)!=null&&g.contains(h.target)?f.dom.parentElement:null,r&&(v0=t)},p=()=>{v0&&(v0=null)};return window.addEventListener("dragstart",d),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",d),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(f,d)=>{if(o=r===f.dom.parentElement,a=d,!o){let p=v0;p?.isEditable&&setTimeout(()=>{let h=p.state.selection;h&&p.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(f,d)=>{var p;let h=(p=d.clipboardData)==null?void 0:p.getData("text/html");return s=d,i=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(f,d,p)=>{let h=f[0],g=h.getMeta("uiEvent")==="paste"&&!i,y=h.getMeta("uiEvent")==="drop"&&!o,b=h.getMeta("applyPasteRules"),E=!!b;if(!g&&!y&&!E)return;if(E){let{text:v}=b;typeof v=="string"?v=v:v=J_(J.from(v),p.schema);let{from:x}=b,R=x+v.length,O=Wne(v);return l({rule:c,state:p,from:x,to:{b:R},pasteEvt:O})}let T=d.doc.content.findDiffStart(p.doc.content),S=d.doc.content.findDiffEnd(p.doc.content);if(!(!Kne(T)||!S||T===S.b))return l({rule:c,state:p,from:T,to:S,pasteEvt:s})}}))}var O0=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=FB(e),this.schema=sne(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Ud(t.name,this.schema)},r=pe(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this;return Hd([...this.extensions].reverse()).flatMap(r=>{let i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Ud(r.name,this.schema)},o=[],s=pe(r,"addKeyboardShortcuts",i),a={};if(r.type==="mark"&&pe(r,"exitable",i)&&(a.ArrowRight=()=>Gne.handleExit({editor:e,mark:r})),s){let d=Object.fromEntries(Object.entries(s()).map(([p,h])=>[p,()=>h({editor:e})]));a={...a,...d}}let l=yB(a);o.push(l);let u=pe(r,"addInputRules",i);if(NB(r,e.options.enableInputRules)&&u){let d=u();if(d&&d.length){let p=qne({editor:e,rules:d}),h=Array.isArray(p)?p:[p];o.push(...h)}}let c=pe(r,"addPasteRules",i);if(NB(r,e.options.enablePasteRules)&&c){let d=c();if(d&&d.length){let p=jne({editor:e,rules:d});o.push(...p)}}let f=pe(r,"addProseMirrorPlugins",i);if(f){let d=f();o.push(...d)}return o})}get attributes(){return UB(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=sc(this.extensions);return Object.fromEntries(t.filter(n=>!!pe(n,"addNodeView")).map(n=>{let r=this.attributes.filter(l=>l.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:ln(n.name,this.schema)},o=pe(n,"addNodeView",i);if(!o)return[];let s=o();if(!s)return[];let a=(l,u,c,f,d)=>{let p=w0(l,r);return s({node:l,view:u,getPos:c,decorations:f,innerDecorations:d,editor:e,extension:n,HTMLAttributes:p})};return[n.name,a]}))}dispatchTransaction(e){let{editor:t}=this;return Hd([...this.extensions].reverse()).reduceRight((r,i)=>{let o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Ud(i.name,this.schema)},s=pe(i,"dispatchTransaction",o);return s?a=>{s.call(o,{transaction:a,next:r})}:r},e)}transformPastedHTML(e){let{editor:t}=this;return Hd([...this.extensions]).reduce((r,i)=>{let o={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Ud(i.name,this.schema)},s=pe(i,"transformPastedHTML",o);return s?(a,l)=>{let u=r(a,l);return s.call(o,u)}:r},e||(r=>r))}get markViews(){let{editor:e}=this,{markExtensions:t}=sc(this.extensions);return Object.fromEntries(t.filter(n=>!!pe(n,"addMarkView")).map(n=>{let r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Do(n.name,this.schema)},o=pe(n,"addMarkView",i);if(!o)return[];let s=(a,l,u)=>{let c=w0(a,r);return o()({mark:a,view:l,inline:u,editor:e,extension:n,HTMLAttributes:c,updateAttributes:f=>{lre(a,e,f)}})};return[n.name,s]}))}destroy(){this.extensions.forEach(e=>{let t=e;for(;t.parent;){let n=t.parent;n.child===t&&(n.child=null),t=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{var n,r;let i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Ud(t.name,this.schema)};t.type==="mark"&&(((n=Nt(pe(t,"keepOnSplit",i)))==null||n)&&this.splittableMarks.push(t.name),(r=Nt(pe(t,"clearable",i)))==null||r||this.nonClearableMarks.push(t.name));let o=pe(t,"onBeforeCreate",i),s=pe(t,"onCreate",i),a=pe(t,"onUpdate",i),l=pe(t,"onSelectionUpdate",i),u=pe(t,"onTransaction",i),c=pe(t,"onFocus",i),f=pe(t,"onBlur",i),d=pe(t,"onDestroy",i);o&&this.editor.on("beforeCreate",o),s&&this.editor.on("create",s),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),c&&this.editor.on("focus",c),f&&this.editor.on("blur",f),d&&this.editor.on("destroy",d)})}};O0.resolve=FB;O0.sort=Hd;O0.flatten=Z_;var Xne={};j_(Xne,{ClipboardTextSerializer:()=>$B,Commands:()=>WB,Delete:()=>jB,Drop:()=>XB,Editable:()=>QB,FocusEvents:()=>JB,Keymap:()=>e5,Paste:()=>t5,Tabindex:()=>n5,TextDirection:()=>r5,focusEventsPluginKey:()=>ZB});var hr=class YB extends tv{constructor(){super(...arguments),this.type="extension"}static create(t={}){let n=typeof t=="function"?t():t;return new YB(n)}configure(t){return super.configure(t)}extend(t){let n=typeof t=="function"?t():t;return super.extend(n)}},$B=hr.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Qe({key:new Et("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,o=zB(n),{blockSeparator:s}=this.options,a={...s!==void 0?{blockSeparator:s}:{},textSerializers:o};return[...i.ranges].sort((u,c)=>u.$from.pos-c.$from.pos).map(({$from:u,$to:c})=>HB(r,{from:u.pos,to:c.pos},a)).join(s??` + +`)}}})]}}),WB=hr.create({name:"commands",addCommands(){return{...RB}}}),jB=hr.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;let o=()=>{var s,a,l,u;if((u=(l=(a=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,e))!=null?u:e.getMeta("y-sync$"))return;let c=ene(e.before,[e,...t]);pne(c).forEach(p=>{c.mapping.mapResult(p.oldRange.from).deletedAfter&&c.mapping.mapResult(p.oldRange.to).deletedBefore&&c.before.nodesBetween(p.oldRange.from,p.oldRange.to,(h,g)=>{let y=g+h.nodeSize-2,b=p.oldRange.from<=g&&y<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:h,from:g,to:y,newFrom:c.mapping.map(g),newTo:c.mapping.map(y),deletedRange:p.oldRange,newRange:p.newRange,partial:!b,editor:this.editor,transaction:e,combinedTransform:c})})});let d=c.mapping;c.steps.forEach((p,h)=>{var g,y;if(p instanceof Co){let b=d.slice(h).map(p.from,-1),E=d.slice(h).map(p.to),T=d.invert().map(b,-1),S=d.invert().map(E),v=b>0?(g=c.doc.nodeAt(b-1))==null?void 0:g.marks.some(R=>R.eq(p.mark)):!1,x=(y=c.doc.nodeAt(E))==null?void 0:y.marks.some(R=>R.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:T,to:S},newRange:{from:b,to:E},partial:!!(x||v),editor:this.editor,transaction:e,combinedTransform:c})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(o,0):o()}}),XB=hr.create({name:"drop",addProseMirrorPlugins(){return[new Qe({key:new Et("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),QB=hr.create({name:"editable",addProseMirrorPlugins(){return[new Qe({key:new Et("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ZB=new Et("focusEvents"),JB=hr.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new Qe({key:ZB,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),e5=hr.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{let{selection:l,doc:u}=a,{empty:c,$anchor:f}=l,{pos:d,parent:p}=f,h=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,g=h.parent.type.spec.isolating,y=f.pos-f.parentOffset,b=g&&h.parent.childCount===1?y===f.pos:Oe.atStart(u).from===d;return!c||!p.type.isTextblock||p.textContent.length||!b||b&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return N0()||LB()?o:i},addProseMirrorPlugins(){return[new Qe({key:new Et("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(g=>g.getMeta("composition")))return;let r=e.some(g=>g.docChanged)&&!t.doc.eq(n.doc),i=e.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:a}=t.selection,l=Oe.atStart(t.doc).from,u=Oe.atEnd(t.doc).to;if(o||!(s===l&&a===u)||!ev(n.doc))return;let d=n.tr,p=R0({state:n,transaction:d}),{commands:h}=new k0({editor:this.editor,state:p});if(h.clearNodes(),!!d.steps.length)return d}})]}}),t5=hr.create({name:"paste",addProseMirrorPlugins(){return[new Qe({key:new Et("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),n5=hr.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Qe({key:new Et("tabindex"),props:{attributes:()=>{var e;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(e=this.options.value)!=null?e:"0"}}}})]}}),r5=hr.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=sc(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{let n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new Qe({key:new Et("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),Qne=class Fd{constructor(t,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!=null?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new Fd(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new Fd(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new Fd(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+r+(o?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;let l=this.resolvedPos.doc.resolve(a);if(!i&&!s&&l.depth<=this.depth)return;let u=new Fd(l,this.editor,i,i||s?n:null);i&&(u.actualDepth=this.depth+1),t.push(u)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===t)if(Object.keys(n).length>0){let o=i.node.attrs,s=Object.keys(n);for(let a=0;a{r&&i.length>0||(s.node.type.name===t&&o.every(l=>n[l]===s.node.attrs[l])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(t,n,r))))}),i}setAttribute(t){let{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}},Zne=`.ProseMirror { position: relative; } @@ -174,33 +174,33 @@ img.ProseMirror-separator { .ProseMirror-focused .ProseMirror-gapcursor { display: block; -}`;function Xne(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;let i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}var r5=class extends Bne{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:pne,createMappablePosition:hne},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:o})=>this.options.onDrop(r,i,o)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);let t=this.createDoc(),n=OB(t,this.options.autofocus);this.editorState=s0.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Xne(jne,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=PB(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(i=>{let o=typeof i=="string"?`${i}$`:i.key;n=n.filter(s=>!s.key.startsWith(o))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t,n,r;let o=[...this.options.enableCoreExtensions?[XB,YB.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),$B,ZB,JB,t5.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),jB,e5,WB,n5.configure({direction:this.options.textDirection})].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s?.type));this.extensionManager=new O0(o,this)}createCommandManager(){this.commandManager=new k0({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=$_(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),e=$_(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,o=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(o);this.editorView=new Dd(e,{...t,attributes:{role:"textbox",...t?.attributes},dispatchTransaction:i,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();let l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(u=>{var c;return(c=this.capturedTransaction)==null?void 0:c.step(u)});return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let s=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),a=s?.getMeta("focus"),l=s?.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),!(e.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||o.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return ane(this.state,e)}isActive(e,t){let n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return dne(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return J_(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=` +}`;function Jne(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;let i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}var i5=class extends Hne{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:gne,createMappablePosition:bne},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:o})=>this.options.onDrop(r,i,o)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);let t=this.createDoc(),n=DB(t,this.options.autofocus);this.editorState=s0.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Jne(Zne,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=BB(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(i=>{let o=typeof i=="string"?`${i}$`:i.key;n=n.filter(s=>!s.key.startsWith(o))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t,n,r;let o=[...this.options.enableCoreExtensions?[QB,$B.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),WB,JB,e5,n5.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),XB,t5,jB,r5.configure({direction:this.options.textDirection})].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s?.type));this.extensionManager=new O0(o,this)}createCommandManager(){this.commandManager=new k0({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=$_(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),e=$_(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,o=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(o);this.editorView=new Dd(e,{...t,attributes:{role:"textbox",...t?.attributes},dispatchTransaction:i,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();let l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(u=>{var c;return(c=this.capturedTransaction)==null?void 0:c.step(u)});return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let s=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),a=s?.getMeta("focus"),l=s?.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),!(e.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||o.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return cne(this.state,e)}isActive(e,t){let n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return mne(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return J_(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=` -`,textSerializers:n={}}=e||{};return one(this.state.doc,{blockSeparator:t,textSerializers:{...HB(this.schema),...n}})}get isEmpty(){return ev(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,t))||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText?t.nodeAfter:null;return new Wne(t,this,!1,n)}get $doc(){return this.$pos(0)}};function i5(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var Qne={};j_(Qne,{createAtomBlockMarkdownSpec:()=>Zne,createBlockMarkdownSpec:()=>Jne,createInlineMarkdownSpec:()=>nre,parseAttributes:()=>nv,parseIndentedBlocks:()=>rre,renderNestedMarkdownContent:()=>ire,serializeAttributes:()=>rv});function nv(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,u=>(n.push(u),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){let u=i.map(c=>c.trim().slice(1));t.class=u.join(" ")}let o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(t.id=o[1]);let s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(s)).forEach(([,u,c])=>{var f;let d=parseInt(((f=c.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),p=n[d];p&&(t[u]=p.slice(1,-1))});let l=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(c=>{c.match(/^[a-zA-Z][\w-]*$/)&&(t[c]=!0)}),t}function rv(e){if(!e||Object.keys(e).length===0)return"";let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(r=>t.push(`.${r}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?t.push(n):r!==!1&&r!=null&&t.push(`${n}="${String(r)}"`))}),t.join(" ")}function Zne(e){let{nodeName:t,name:n,parseAttributes:r=nv,serializeAttributes:i=rv,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:a}=e,l=n||t,u=c=>{if(!a)return c;let f={};return a.forEach(d=>{d in c&&(f[d]=c[d])}),f};return{parseMarkdown:(c,f)=>{let d={...o,...c.attributes};return f.createNode(t,d,[])},markdownTokenizer:{name:t,level:"block",start(c){var f;let d=new RegExp(`^:::${l}(?:\\s|$)`,"m"),p=(f=c.match(d))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(c,f,d){let p=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),h=c.match(p);if(!h)return;let g=h[1]||"",y=r(g);if(!s.find(E=>!(E in y)))return{type:t,raw:h[0],attributes:y}}},renderMarkdown:c=>{let f=u(c.attrs||{}),d=i(f),p=d?` {${d}}`:"";return`:::${l}${p} :::`}}}function Jne(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=nv,serializeAttributes:o=rv,defaultAttributes:s={},content:a="block",allowedAttributes:l}=e,u=n||t,c=f=>{if(!l)return f;let d={};return l.forEach(p=>{p in f&&(d[p]=f[p])}),d};return{parseMarkdown:(f,d)=>{let p;if(r){let g=r(f);p=typeof g=="string"?[{type:"text",text:g}]:g}else a==="block"?p=d.parseChildren(f.tokens||[]):p=d.parseInline(f.tokens||[]);let h={...s,...f.attributes};return d.createNode(t,h,p)},markdownTokenizer:{name:t,level:"block",start(f){var d;let p=new RegExp(`^:::${u}`,"m"),h=(d=f.match(p))==null?void 0:d.index;return h!==void 0?h:-1},tokenize(f,d,p){var h;let g=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),y=f.match(g);if(!y)return;let[b,E=""]=y,T=i(E),S=1,v=b.length,x="",R=/^:::([\w-]*)(\s.*)?/gm,O=f.slice(v);for(R.lastIndex=0;;){let B=R.exec(O);if(B===null)break;let C=B.index,V=B[1];if(!((h=B[2])!=null&&h.endsWith(":::"))){if(V)S+=1;else if(S-=1,S===0){let Y=O.slice(0,C);x=Y.trim();let q=f.slice(0,v+C+B[0].length),L=[];if(x)if(a==="block")for(L=p.blockTokens(Y),L.forEach(H=>{H.text&&(!H.tokens||H.tokens.length===0)&&(H.tokens=p.inlineTokens(H.text))});L.length>0;){let H=L[L.length-1];if(H.type==="paragraph"&&(!H.text||H.text.trim()===""))L.pop();else break}else L=p.inlineTokens(x);return{type:t,raw:q,attributes:T,content:x,tokens:L}}}}}},renderMarkdown:(f,d)=>{let p=c(f.attrs||{}),h=o(p),g=h?` {${h}}`:"",y=d.renderChildren(f.content||[],` +`,textSerializers:n={}}=e||{};return lne(this.state.doc,{blockSeparator:t,textSerializers:{...zB(this.schema),...n}})}get isEmpty(){return ev(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,t))||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText?t.nodeAfter:null;return new Qne(t,this,!1,n)}get $doc(){return this.$pos(0)}};function o5(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var ere={};j_(ere,{createAtomBlockMarkdownSpec:()=>tre,createBlockMarkdownSpec:()=>nre,createInlineMarkdownSpec:()=>ore,parseAttributes:()=>nv,parseIndentedBlocks:()=>sre,renderNestedMarkdownContent:()=>are,serializeAttributes:()=>rv});function nv(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,u=>(n.push(u),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){let u=i.map(c=>c.trim().slice(1));t.class=u.join(" ")}let o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(t.id=o[1]);let s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(s)).forEach(([,u,c])=>{var f;let d=parseInt(((f=c.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),p=n[d];p&&(t[u]=p.slice(1,-1))});let l=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(c=>{c.match(/^[a-zA-Z][\w-]*$/)&&(t[c]=!0)}),t}function rv(e){if(!e||Object.keys(e).length===0)return"";let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(r=>t.push(`.${r}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?t.push(n):r!==!1&&r!=null&&t.push(`${n}="${String(r)}"`))}),t.join(" ")}function tre(e){let{nodeName:t,name:n,parseAttributes:r=nv,serializeAttributes:i=rv,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:a}=e,l=n||t,u=c=>{if(!a)return c;let f={};return a.forEach(d=>{d in c&&(f[d]=c[d])}),f};return{parseMarkdown:(c,f)=>{let d={...o,...c.attributes};return f.createNode(t,d,[])},markdownTokenizer:{name:t,level:"block",start(c){var f;let d=new RegExp(`^:::${l}(?:\\s|$)`,"m"),p=(f=c.match(d))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(c,f,d){let p=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),h=c.match(p);if(!h)return;let g=h[1]||"",y=r(g);if(!s.find(E=>!(E in y)))return{type:t,raw:h[0],attributes:y}}},renderMarkdown:c=>{let f=u(c.attrs||{}),d=i(f),p=d?` {${d}}`:"";return`:::${l}${p} :::`}}}function nre(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=nv,serializeAttributes:o=rv,defaultAttributes:s={},content:a="block",allowedAttributes:l}=e,u=n||t,c=f=>{if(!l)return f;let d={};return l.forEach(p=>{p in f&&(d[p]=f[p])}),d};return{parseMarkdown:(f,d)=>{let p;if(r){let g=r(f);p=typeof g=="string"?[{type:"text",text:g}]:g}else a==="block"?p=d.parseChildren(f.tokens||[]):p=d.parseInline(f.tokens||[]);let h={...s,...f.attributes};return d.createNode(t,h,p)},markdownTokenizer:{name:t,level:"block",start(f){var d;let p=new RegExp(`^:::${u}`,"m"),h=(d=f.match(p))==null?void 0:d.index;return h!==void 0?h:-1},tokenize(f,d,p){var h;let g=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),y=f.match(g);if(!y)return;let[b,E=""]=y,T=i(E),S=1,v=b.length,x="",R=/^:::([\w-]*)(\s.*)?/gm,O=f.slice(v);for(R.lastIndex=0;;){let B=R.exec(O);if(B===null)break;let C=B.index,V=B[1];if(!((h=B[2])!=null&&h.endsWith(":::"))){if(V)S+=1;else if(S-=1,S===0){let Y=O.slice(0,C);x=Y.trim();let q=f.slice(0,v+C+B[0].length),L=[];if(x)if(a==="block")for(L=p.blockTokens(Y),L.forEach(H=>{H.text&&(!H.tokens||H.tokens.length===0)&&(H.tokens=p.inlineTokens(H.text))});L.length>0;){let H=L[L.length-1];if(H.type==="paragraph"&&(!H.text||H.text.trim()===""))L.pop();else break}else L=p.inlineTokens(x);return{type:t,raw:q,attributes:T,content:x,tokens:L}}}}}},renderMarkdown:(f,d)=>{let p=c(f.attrs||{}),h=o(p),g=h?` {${h}}`:"",y=d.renderChildren(f.content||[],` `);return`:::${u}${g} ${y} -:::`}}}function ere(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,o,s]=r;t[i]=o||s,r=n.exec(e)}return t}function tre(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function nre(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=ere,serializeAttributes:o=tre,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:l}=e,u=n||t,c=d=>{if(!l)return d;let p={};return l.forEach(h=>{let g=typeof h=="string"?h:h.name,y=typeof h=="string"?void 0:h.skipIfDefault;if(g in d){let b=d[g];if(y!==void 0&&b===y)return;p[g]=b}}),p},f=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(d,p)=>{let h={...s,...d.attributes};if(a)return p.createNode(t,h);let g=r?r(d):d.content||"";return g?p.createNode(t,h,[p.createTextNode(g)]):p.createNode(t,h,[])},markdownTokenizer:{name:t,level:"inline",start(d){let p=a?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),h=d.match(p),g=h?.index;return g!==void 0?g:-1},tokenize(d,p,h){let g=a?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),y=d.match(g);if(!y)return;let b="",E="";if(a){let[,S]=y;E=S}else{let[,S,v]=y;E=S,b=v||""}let T=i(E.trim());return{type:t,raw:y[0],content:b.trim(),attributes:T}}},renderMarkdown:d=>{let p="";r?p=r(d):d.content&&d.content.length>0&&(p=d.content.filter(b=>b.type==="text").map(b=>b.text).join(""));let h=c(d.attrs||{}),g=o(h),y=g?` ${g}`:"";return a?`[${u}${y}]`:`[${u}${y}]${p}[/${u}]`}}}function rre(e,t,n){var r,i,o,s;let a=e.split(` +:::`}}}function rre(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,o,s]=r;t[i]=o||s,r=n.exec(e)}return t}function ire(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function ore(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=rre,serializeAttributes:o=ire,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:l}=e,u=n||t,c=d=>{if(!l)return d;let p={};return l.forEach(h=>{let g=typeof h=="string"?h:h.name,y=typeof h=="string"?void 0:h.skipIfDefault;if(g in d){let b=d[g];if(y!==void 0&&b===y)return;p[g]=b}}),p},f=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(d,p)=>{let h={...s,...d.attributes};if(a)return p.createNode(t,h);let g=r?r(d):d.content||"";return g?p.createNode(t,h,[p.createTextNode(g)]):p.createNode(t,h,[])},markdownTokenizer:{name:t,level:"inline",start(d){let p=a?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),h=d.match(p),g=h?.index;return g!==void 0?g:-1},tokenize(d,p,h){let g=a?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),y=d.match(g);if(!y)return;let b="",E="";if(a){let[,S]=y;E=S}else{let[,S,v]=y;E=S,b=v||""}let T=i(E.trim());return{type:t,raw:y[0],content:b.trim(),attributes:T}}},renderMarkdown:d=>{let p="";r?p=r(d):d.content&&d.content.length>0&&(p=d.content.filter(b=>b.type==="text").map(b=>b.text).join(""));let h=c(d.attrs||{}),g=o(h),y=g?` ${g}`:"";return a?`[${u}${y}]`:`[${u}${y}]${p}[/${u}]`}}}function sre(e,t,n){var r,i,o,s;let a=e.split(` `),l=[],u="",c=0,f=t.baseIndentSize||2;for(;c0)break;if(d.trim()===""){c+=1,u=`${u}${d} `;continue}else return}let h=t.extractItemData(p),{indentLevel:g,mainContent:y}=h;u=`${u}${d} `;let b=[y];for(c+=1;cC.trim()!=="");if(R===-1)break;if((((i=(r=a[c+1+R].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>g){b.push(v),u=`${u}${v} `,c+=1;continue}else break}if((((s=(o=v.match(/^(\s*)/))==null?void 0:o[1])==null?void 0:s.length)||0)>g)b.push(v),u=`${u}${v} `,c+=1;else break}let E,T=b.slice(1);if(T.length>0){let v=T.map(x=>x.slice(g+f)).join(` -`);v.trim()&&(t.customNestedParser?E=t.customNestedParser(v):E=n.blockTokens(v))}let S=t.createToken(h,E);l.push(S)}if(l.length!==0)return{items:l,raw:u}}function ire(e,t,n,r){if(!e||!Array.isArray(e.content))return"";let i=typeof n=="function"?n(r):n,[o,...s]=e.content,a=t.renderChildren([o]),l=`${i}${a}`;return s&&s.length>0&&s.forEach((u,c)=>{var f,d;let p=(d=(f=t.renderChild)==null?void 0:f.call(t,u,c+1))!=null?d:t.renderChildren([u]);if(p!=null){let h=p.split(` +`);v.trim()&&(t.customNestedParser?E=t.customNestedParser(v):E=n.blockTokens(v))}let S=t.createToken(h,E);l.push(S)}if(l.length!==0)return{items:l,raw:u}}function are(e,t,n,r){if(!e||!Array.isArray(e.content))return"";let i=typeof n=="function"?n(r):n,[o,...s]=e.content,a=t.renderChildren([o]),l=`${i}${a}`;return s&&s.length>0&&s.forEach((u,c)=>{var f,d;let p=(d=(f=t.renderChild)==null?void 0:f.call(t,u,c+1))!=null?d:t.renderChildren([u]);if(p!=null){let h=p.split(` `).map(g=>g?t.indent(g):t.indent("")).join(` `);l+=u.type==="paragraph"?` ${h}`:` -${h}`}}),l}function ore(e,t,n={}){let{state:r}=t,{doc:i,tr:o}=r,s=e;i.descendants((a,l)=>{let u=o.mapping.map(l),c=o.mapping.map(l)+a.nodeSize,f=null;if(a.marks.forEach(p=>{if(p!==s)return!1;f=p}),!f)return;let d=!1;if(Object.keys(n).forEach(p=>{n[p]!==f.attrs[p]&&(d=!0)}),d){let p=e.type.create({...e.attrs,...n});o.removeMark(u,c,e.type),o.addMark(u,c,p)}}),o.docChanged&&t.view.dispatch(o)}var Ps=class o5 extends tv{constructor(){super(...arguments),this.type="node"}static create(t={}){let n=typeof t=="function"?t():t;return new o5(n)}configure(t){return super.configure(t)}extend(t){let n=typeof t=="function"?t():t;return super.extend(n)}};var Fs=G(fe(),1),T5=G(Kg(),1);var{getOwnPropertyNames:sre,getOwnPropertySymbols:are}=Object,{hasOwnProperty:lre}=Object.prototype;function iv(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function D0(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);let{cache:o}=i,s=o.get(n),a=o.get(r);if(s&&a)return s===r&&a===n;o.set(n,r),o.set(r,n);let l=e(n,r,i);return o.delete(n),o.delete(r),l}}function ure(e){return e?.[Symbol.toStringTag]}function s5(e){return sre(e).concat(are(e))}var cre=Object.hasOwn||((e,t)=>lre.call(e,t));function il(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var fre="__v",dre="__o",pre="_owner",{getOwnPropertyDescriptor:a5,keys:l5}=Object;function hre(e,t){return e.byteLength===t.byteLength&&I0(new Uint8Array(e),new Uint8Array(t))}function mre(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function gre(e,t){return e.byteLength===t.byteLength&&I0(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function bre(e,t){return il(e.getTime(),t.getTime())}function yre(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Ere(e,t){return e===t}function u5(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=new Array(r),o=e.entries(),s,a,l=0;for(;(s=o.next())&&!s.done;){let u=t.entries(),c=!1,f=0;for(;(a=u.next())&&!a.done;){if(i[f]){f++;continue}let d=s.value,p=a.value;if(n.equals(d[0],p[0],l,f,e,t,n)&&n.equals(d[1],p[1],d[0],p[0],e,t,n)){c=i[f]=!0;break}f++}if(!c)return!1;l++}return!0}var Tre=il;function Sre(e,t,n){let r=l5(e),i=r.length;if(l5(t).length!==i)return!1;for(;i-- >0;)if(!f5(e,t,n,r[i]))return!1;return!0}function Gd(e,t,n){let r=s5(e),i=r.length;if(s5(t).length!==i)return!1;let o,s,a;for(;i-- >0;)if(o=r[i],!f5(e,t,n,o)||(s=a5(e,o),a=a5(t,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function xre(e,t){return il(e.valueOf(),t.valueOf())}function _re(e,t){return e.source===t.source&&e.flags===t.flags}function c5(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=new Array(r),o=e.values(),s,a;for(;(s=o.next())&&!s.done;){let l=t.values(),u=!1,c=0;for(;(a=l.next())&&!a.done;){if(!i[c]&&n.equals(s.value,a.value,s.value,a.value,e,t,n)){u=i[c]=!0;break}c++}if(!u)return!1}return!0}function I0(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function vre(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function f5(e,t,n,r){return(r===pre||r===dre||r===fre)&&(e.$$typeof||t.$$typeof)?!0:cre(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Cre="[object ArrayBuffer]",Are="[object Arguments]",Nre="[object Boolean]",wre="[object DataView]",Rre="[object Date]",kre="[object Error]",Mre="[object Map]",Ore="[object Number]",Dre="[object Object]",Ire="[object RegExp]",Lre="[object Set]",Pre="[object String]",Bre={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Ure="[object URL]",Fre=Object.prototype.toString;function Hre({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:f,areTypedArraysEqual:d,areUrlsEqual:p,unknownTagComparators:h}){return function(y,b,E){if(y===b)return!0;if(y==null||b==null)return!1;let T=typeof y;if(T!==typeof b)return!1;if(T!=="object")return T==="number"?a(y,b,E):T==="function"?o(y,b,E):!1;let S=y.constructor;if(S!==b.constructor)return!1;if(S===Object)return l(y,b,E);if(Array.isArray(y))return t(y,b,E);if(S===Date)return r(y,b,E);if(S===RegExp)return c(y,b,E);if(S===Map)return s(y,b,E);if(S===Set)return f(y,b,E);let v=Fre.call(y);if(v===Rre)return r(y,b,E);if(v===Ire)return c(y,b,E);if(v===Mre)return s(y,b,E);if(v===Lre)return f(y,b,E);if(v===Dre)return typeof y.then!="function"&&typeof b.then!="function"&&l(y,b,E);if(v===Ure)return p(y,b,E);if(v===kre)return i(y,b,E);if(v===Are)return l(y,b,E);if(Bre[v])return d(y,b,E);if(v===Cre)return e(y,b,E);if(v===wre)return n(y,b,E);if(v===Nre||v===Ore||v===Pre)return u(y,b,E);if(h){let x=h[v];if(!x){let R=ure(y);R&&(x=h[R])}if(x)return x(y,b,E)}return!1}}function zre({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:hre,areArraysEqual:n?Gd:mre,areDataViewsEqual:gre,areDatesEqual:bre,areErrorsEqual:yre,areFunctionsEqual:Ere,areMapsEqual:n?iv(u5,Gd):u5,areNumbersEqual:Tre,areObjectsEqual:n?Gd:Sre,arePrimitiveWrappersEqual:xre,areRegExpsEqual:_re,areSetsEqual:n?iv(c5,Gd):c5,areTypedArraysEqual:n?iv(I0,Gd):I0,areUrlsEqual:vre,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let i=D0(r.areArraysEqual),o=D0(r.areMapsEqual),s=D0(r.areObjectsEqual),a=D0(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:a})}return r}function qre(e){return function(t,n,r,i,o,s,a){return e(t,n,a)}}function Vre({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,l){let{cache:u=e?new WeakMap:void 0,meta:c}=n();return t(a,l,{cache:u,equals:r,meta:c,strict:i})};if(e)return function(a,l){return t(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let o={cache:void 0,equals:r,meta:void 0,strict:i};return function(a,l){return t(a,l,o)}}var d5=Bs(),ECe=Bs({strict:!0}),TCe=Bs({circular:!0}),SCe=Bs({circular:!0,strict:!0}),xCe=Bs({createInternalComparator:()=>il}),_Ce=Bs({strict:!0,createInternalComparator:()=>il}),vCe=Bs({circular:!0,createInternalComparator:()=>il}),CCe=Bs({circular:!0,createInternalComparator:()=>il,strict:!0});function Bs(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=zre(e),s=Hre(o),a=n?n(s):qre(s);return Vre({circular:t,comparator:s,createState:r,equals:a,strict:i})}var Hs=G(fe(),1),S5=G(g5(),1),C5=G(ie(),1),Kd=G(fe(),1),cie=G(ie(),1),N5=G(fe(),1),w5=G(ie(),1);var R5=G(fe(),1),fie=G(fe(),1),die=G(qi(),1),pie=G(ie(),1),hie=G(ie(),1);var sv=G(fe(),1),mie=G(ie(),1),ol=G(fe(),1),P0=G(ie(),1),Zre=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},Jre=({contentComponent:e})=>{let t=(0,E5.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,Io.jsx)(Io.Fragment,{children:Object.values(t)})};function eie(){let e=new Set,t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:y5.default.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(i=>i())}}}var tie=class extends Us.default.Component{constructor(e){super(e),this.editorContentRef=Us.default.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;let t=this.props.editor;if(t&&!t.isDestroyed&&((e=t.view.dom)!=null&&e.parentNode)){if(t.contentComponent)return;let n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=eie(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;let t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.parentNode))return;let n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,Io.jsxs)(Io.Fragment,{children:[(0,Io.jsx)("div",{ref:Zre(t,this.editorContentRef),...n}),e?.contentComponent&&(0,Io.jsx)(Jre,{contentComponent:e.contentComponent})]})}},nie=(0,Us.forwardRef)((e,t)=>{let n=Us.default.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return Us.default.createElement(tie,{key:n,innerRef:t,...e})}),ov=Us.default.memo(nie),rie=typeof window<"u"?Hs.useLayoutEffect:Hs.useEffect,iie=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let t=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",t),()=>{n.off("transaction",t)}}}};function oie(e){var t;let[n]=(0,Hs.useState)(()=>new iie(e.editor)),r=(0,S5.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:d5);return rie(()=>n.watch(e.editor),[e.editor,n]),(0,Hs.useDebugValue)(r),r}var b5=!1,x5=typeof window>"u",sie=x5||!!(typeof window<"u"&&window.next),aie=class _5{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){let t=this.options.current.immediatelyRender,n=t??!0;return x5?(n&&b5&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):sie&&t===void 0&&(n=!1,b5&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),n?this.createEditor():null}createEditor(){let t={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)==null?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)==null?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)==null?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)==null?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)==null?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)==null?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)==null?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)==null?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)==null?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return(o=(i=this.options.current).onDrop)==null?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return(o=(i=this.options.current).onPaste)==null?void 0:o.call(i,...r)},onDelete:(...r)=>{var i,o;return(o=(i=this.options.current).onDelete)==null?void 0:o.call(i,...r)}};return new r5(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((i,o)=>{var s;return i===((s=n.extensions)==null?void 0:s[o])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?_5.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((r,i)=>r===t[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){let t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function v5(e={},t=[]){let n=(0,Fs.useRef)(e);n.current=e;let[r]=(0,Fs.useState)(()=>new aie(n)),i=(0,T5.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,Fs.useDebugValue)(i),(0,Fs.useEffect)(r.onRender(t)),oie({editor:i,selector:({transactionNumber:o})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&o===0?0:o+1}),i}var A5=(0,B0.createContext)({editor:null}),MCe=A5.Consumer;var lie=(0,Kd.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});var uie=()=>(0,Kd.useContext)(lie);var OCe=N5.default.forwardRef((e,t)=>{let{onDragStart:n}=uie(),r=e.as||"div";return(0,w5.jsx)(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});var DCe=R5.default.createContext({markViewContentRef:()=>{}});var av=(0,ol.createContext)({get editor(){throw new Error("useTiptap must be used within a provider")}});av.displayName="TiptapContext";var gie=()=>(0,ol.useContext)(av);function k5({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,ol.useMemo)(()=>({editor:r}),[r]),o=(0,ol.useMemo)(()=>({editor:r}),[r]);return(0,P0.jsx)(A5.Provider,{value:o,children:(0,P0.jsx)(av.Provider,{value:i,children:n})})}k5.displayName="Tiptap";function M5({...e}){let{editor:t}=gie();return(0,P0.jsx)(ov,{editor:t,...e})}M5.displayName="Tiptap.Content";var ICe=Object.assign(k5,{Content:M5});var bie=Ps.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` +${h}`}}),l}function lre(e,t,n={}){let{state:r}=t,{doc:i,tr:o}=r,s=e;i.descendants((a,l)=>{let u=o.mapping.map(l),c=o.mapping.map(l)+a.nodeSize,f=null;if(a.marks.forEach(p=>{if(p!==s)return!1;f=p}),!f)return;let d=!1;if(Object.keys(n).forEach(p=>{n[p]!==f.attrs[p]&&(d=!0)}),d){let p=e.type.create({...e.attrs,...n});o.removeMark(u,c,e.type),o.addMark(u,c,p)}}),o.docChanged&&t.view.dispatch(o)}var Ps=class s5 extends tv{constructor(){super(...arguments),this.type="node"}static create(t={}){let n=typeof t=="function"?t():t;return new s5(n)}configure(t){return super.configure(t)}extend(t){let n=typeof t=="function"?t():t;return super.extend(n)}};var Fs=G(fe(),1),S5=G(Kg(),1);var{getOwnPropertyNames:ure,getOwnPropertySymbols:cre}=Object,{hasOwnProperty:fre}=Object.prototype;function iv(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function D0(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);let{cache:o}=i,s=o.get(n),a=o.get(r);if(s&&a)return s===r&&a===n;o.set(n,r),o.set(r,n);let l=e(n,r,i);return o.delete(n),o.delete(r),l}}function dre(e){return e?.[Symbol.toStringTag]}function a5(e){return ure(e).concat(cre(e))}var pre=Object.hasOwn||((e,t)=>fre.call(e,t));function il(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var hre="__v",mre="__o",gre="_owner",{getOwnPropertyDescriptor:l5,keys:u5}=Object;function bre(e,t){return e.byteLength===t.byteLength&&I0(new Uint8Array(e),new Uint8Array(t))}function yre(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Ere(e,t){return e.byteLength===t.byteLength&&I0(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Tre(e,t){return il(e.getTime(),t.getTime())}function Sre(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function xre(e,t){return e===t}function c5(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=new Array(r),o=e.entries(),s,a,l=0;for(;(s=o.next())&&!s.done;){let u=t.entries(),c=!1,f=0;for(;(a=u.next())&&!a.done;){if(i[f]){f++;continue}let d=s.value,p=a.value;if(n.equals(d[0],p[0],l,f,e,t,n)&&n.equals(d[1],p[1],d[0],p[0],e,t,n)){c=i[f]=!0;break}f++}if(!c)return!1;l++}return!0}var _re=il;function vre(e,t,n){let r=u5(e),i=r.length;if(u5(t).length!==i)return!1;for(;i-- >0;)if(!d5(e,t,n,r[i]))return!1;return!0}function Gd(e,t,n){let r=a5(e),i=r.length;if(a5(t).length!==i)return!1;let o,s,a;for(;i-- >0;)if(o=r[i],!d5(e,t,n,o)||(s=l5(e,o),a=l5(t,o),(s||a)&&(!s||!a||s.configurable!==a.configurable||s.enumerable!==a.enumerable||s.writable!==a.writable)))return!1;return!0}function Cre(e,t){return il(e.valueOf(),t.valueOf())}function Are(e,t){return e.source===t.source&&e.flags===t.flags}function f5(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=new Array(r),o=e.values(),s,a;for(;(s=o.next())&&!s.done;){let l=t.values(),u=!1,c=0;for(;(a=l.next())&&!a.done;){if(!i[c]&&n.equals(s.value,a.value,s.value,a.value,e,t,n)){u=i[c]=!0;break}c++}if(!u)return!1}return!0}function I0(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Nre(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function d5(e,t,n,r){return(r===gre||r===mre||r===hre)&&(e.$$typeof||t.$$typeof)?!0:pre(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var wre="[object ArrayBuffer]",Rre="[object Arguments]",kre="[object Boolean]",Mre="[object DataView]",Ore="[object Date]",Dre="[object Error]",Ire="[object Map]",Lre="[object Number]",Pre="[object Object]",Bre="[object RegExp]",Ure="[object Set]",Fre="[object String]",Hre={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},zre="[object URL]",qre=Object.prototype.toString;function Vre({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:c,areSetsEqual:f,areTypedArraysEqual:d,areUrlsEqual:p,unknownTagComparators:h}){return function(y,b,E){if(y===b)return!0;if(y==null||b==null)return!1;let T=typeof y;if(T!==typeof b)return!1;if(T!=="object")return T==="number"?a(y,b,E):T==="function"?o(y,b,E):!1;let S=y.constructor;if(S!==b.constructor)return!1;if(S===Object)return l(y,b,E);if(Array.isArray(y))return t(y,b,E);if(S===Date)return r(y,b,E);if(S===RegExp)return c(y,b,E);if(S===Map)return s(y,b,E);if(S===Set)return f(y,b,E);let v=qre.call(y);if(v===Ore)return r(y,b,E);if(v===Bre)return c(y,b,E);if(v===Ire)return s(y,b,E);if(v===Ure)return f(y,b,E);if(v===Pre)return typeof y.then!="function"&&typeof b.then!="function"&&l(y,b,E);if(v===zre)return p(y,b,E);if(v===Dre)return i(y,b,E);if(v===Rre)return l(y,b,E);if(Hre[v])return d(y,b,E);if(v===wre)return e(y,b,E);if(v===Mre)return n(y,b,E);if(v===kre||v===Lre||v===Fre)return u(y,b,E);if(h){let x=h[v];if(!x){let R=dre(y);R&&(x=h[R])}if(x)return x(y,b,E)}return!1}}function Gre({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:bre,areArraysEqual:n?Gd:yre,areDataViewsEqual:Ere,areDatesEqual:Tre,areErrorsEqual:Sre,areFunctionsEqual:xre,areMapsEqual:n?iv(c5,Gd):c5,areNumbersEqual:_re,areObjectsEqual:n?Gd:vre,arePrimitiveWrappersEqual:Cre,areRegExpsEqual:Are,areSetsEqual:n?iv(f5,Gd):f5,areTypedArraysEqual:n?iv(I0,Gd):I0,areUrlsEqual:Nre,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let i=D0(r.areArraysEqual),o=D0(r.areMapsEqual),s=D0(r.areObjectsEqual),a=D0(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:a})}return r}function Kre(e){return function(t,n,r,i,o,s,a){return e(t,n,a)}}function Yre({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,l){let{cache:u=e?new WeakMap:void 0,meta:c}=n();return t(a,l,{cache:u,equals:r,meta:c,strict:i})};if(e)return function(a,l){return t(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let o={cache:void 0,equals:r,meta:void 0,strict:i};return function(a,l){return t(a,l,o)}}var p5=Bs(),vCe=Bs({strict:!0}),CCe=Bs({circular:!0}),ACe=Bs({circular:!0,strict:!0}),NCe=Bs({createInternalComparator:()=>il}),wCe=Bs({strict:!0,createInternalComparator:()=>il}),RCe=Bs({circular:!0,createInternalComparator:()=>il}),kCe=Bs({circular:!0,createInternalComparator:()=>il,strict:!0});function Bs(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=Gre(e),s=Vre(o),a=n?n(s):Kre(s);return Yre({circular:t,comparator:s,createState:r,equals:a,strict:i})}var Hs=G(fe(),1),x5=G(b5(),1),A5=G(ie(),1),Kd=G(fe(),1),pie=G(ie(),1),w5=G(fe(),1),R5=G(ie(),1);var k5=G(fe(),1),hie=G(fe(),1),mie=G(qi(),1),gie=G(ie(),1),bie=G(ie(),1);var sv=G(fe(),1),yie=G(ie(),1),ol=G(fe(),1),P0=G(ie(),1),tie=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},nie=({contentComponent:e})=>{let t=(0,T5.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,Io.jsx)(Io.Fragment,{children:Object.values(t)})};function rie(){let e=new Set,t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:E5.default.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(i=>i())}}}var iie=class extends Us.default.Component{constructor(e){super(e),this.editorContentRef=Us.default.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;let t=this.props.editor;if(t&&!t.isDestroyed&&((e=t.view.dom)!=null&&e.parentNode)){if(t.contentComponent)return;let n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=rie(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;let t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.parentNode))return;let n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,Io.jsxs)(Io.Fragment,{children:[(0,Io.jsx)("div",{ref:tie(t,this.editorContentRef),...n}),e?.contentComponent&&(0,Io.jsx)(nie,{contentComponent:e.contentComponent})]})}},oie=(0,Us.forwardRef)((e,t)=>{let n=Us.default.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return Us.default.createElement(iie,{key:n,innerRef:t,...e})}),ov=Us.default.memo(oie),sie=typeof window<"u"?Hs.useLayoutEffect:Hs.useEffect,aie=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let t=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",t),()=>{n.off("transaction",t)}}}};function lie(e){var t;let[n]=(0,Hs.useState)(()=>new aie(e.editor)),r=(0,x5.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:p5);return sie(()=>n.watch(e.editor),[e.editor,n]),(0,Hs.useDebugValue)(r),r}var y5=!1,_5=typeof window>"u",uie=_5||!!(typeof window<"u"&&window.next),cie=class v5{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){let t=this.options.current.immediatelyRender,n=t??!0;return _5?(n&&y5&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):uie&&t===void 0&&(n=!1,y5&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),n?this.createEditor():null}createEditor(){let t={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)==null?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)==null?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)==null?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)==null?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)==null?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)==null?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)==null?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)==null?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)==null?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return(o=(i=this.options.current).onDrop)==null?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return(o=(i=this.options.current).onPaste)==null?void 0:o.call(i,...r)},onDelete:(...r)=>{var i,o;return(o=(i=this.options.current).onDelete)==null?void 0:o.call(i,...r)}};return new i5(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((i,o)=>{var s;return i===((s=n.extensions)==null?void 0:s[o])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?v5.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((r,i)=>r===t[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){let t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function C5(e={},t=[]){let n=(0,Fs.useRef)(e);n.current=e;let[r]=(0,Fs.useState)(()=>new cie(n)),i=(0,S5.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,Fs.useDebugValue)(i),(0,Fs.useEffect)(r.onRender(t)),lie({editor:i,selector:({transactionNumber:o})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&o===0?0:o+1}),i}var N5=(0,B0.createContext)({editor:null}),PCe=N5.Consumer;var fie=(0,Kd.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});var die=()=>(0,Kd.useContext)(fie);var BCe=w5.default.forwardRef((e,t)=>{let{onDragStart:n}=die(),r=e.as||"div";return(0,R5.jsx)(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});var UCe=k5.default.createContext({markViewContentRef:()=>{}});var av=(0,ol.createContext)({get editor(){throw new Error("useTiptap must be used within a provider")}});av.displayName="TiptapContext";var Eie=()=>(0,ol.useContext)(av);function M5({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,ol.useMemo)(()=>({editor:r}),[r]),o=(0,ol.useMemo)(()=>({editor:r}),[r]);return(0,P0.jsx)(N5.Provider,{value:o,children:(0,P0.jsx)(av.Provider,{value:i,children:n})})}M5.displayName="Tiptap";function O5({...e}){let{editor:t}=Eie();return(0,P0.jsx)(ov,{editor:t,...e})}O5.displayName="Tiptap.Content";var FCe=Object.assign(M5,{Content:O5});var Tie=Ps.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` -`):""}),O5=bie;var yie=Ps.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),D5=yie;var Eie=Ps.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Vd(this.options.HTMLAttributes,e)]},renderText(){return` +`):""}),D5=Tie;var Sie=Ps.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),I5=Sie;var xie=Ps.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Vd(this.options.HTMLAttributes,e)]},renderText(){return` `},renderMarkdown:()=>` -`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&s){let f=l.filter(d=>a.includes(d.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),I5=Eie;var U0=200,vn=function(){};vn.prototype.append=function(t){return t.length?(t=vn.from(t),!this.length&&t||t.length=n?vn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};vn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};vn.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};vn.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(t(o,s))},n,r),i};vn.from=function(t){return t instanceof vn?t:t&&t.length?new L5(t):vn.empty};var L5=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,s,a){for(var l=o;l=s;l--)if(i(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=U0)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=U0)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(vn);vn.empty=new L5([]);var Tie=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(vn),lv=vn;var Sie=500,al=class e{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=t.tr,a,l,u=[],c=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,c.push(f);return}if(i){c.push(new Ui(f.map));let p=f.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],u.push(new Ui(h,void 0,void 0,u.length+c.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,l=new e(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;c_ie&&(a=xie(a,u),s-=u),new e(a.append(o),s)}remapping(t,n){let r=new Sd;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(n=>new Ui(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(d=>{d.selection&&a--},i);let l=n;this.items.forEach(d=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(d.step){let g=t.steps[p].invert(t.docs[p]),y=d.selection&&d.selection.map(o.slice(l+1,p));y&&a++,r.push(new Ui(h,g,y))}else r.push(new Ui(h))},i);let u=[];for(let d=n;dSie&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=t)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let c=s.selection&&s.selection.map(n.slice(r));c&&o++;let f=new Ui(u.invert(),l,c),d,p=i.length-1;(d=i.length&&i[p].merge(f))?i[p]=d:i.push(f)}}else s.map&&r--},this.items.length,0),new e(lv.from(i.reverse()),o)}};al.empty=new al(lv.empty,0);function xie(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}var Ui=class e{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},Fi=class{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},_ie=20;function vie(e,t,n,r){let i=n.getMeta(sl),o;if(i)return i.historyState;n.getMeta(Nie)&&(e=new Fi(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(sl))return s.getMeta(sl).redo?new Fi(e.done.addTransform(n,void 0,r,F0(t)),e.undone,P5(n.mapping.maps),e.prevTime,e.prevComposition):new Fi(e.done,e.undone.addTransform(n,void 0,r,F0(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Cie(n,e.prevRanges)),u=s?uv(e.prevRanges,n.mapping):P5(n.mapping.maps);return new Fi(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,F0(t)),al.empty,u,n.time,a??e.prevComposition)}else return(o=n.getMeta("rebased"))?new Fi(e.done.rebased(n,o),e.undone.rebased(n,o),uv(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Fi(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),uv(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Cie(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=t[o]&&(n=!0)}),n}function P5(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,s)=>t.push(o,s));return t}function uv(e,t){if(!e)return null;let n=[];for(let r=0;r{let i=sl.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=Aie(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}var fv=H0(!1,!0),dv=H0(!0,!0),jCe=H0(!1,!1),XCe=H0(!0,!1);var F5=hr.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>fv(e,t),redo:()=>({state:e,dispatch:t})=>dv(e,t)}},addProseMirrorPlugins(){return[U5(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});function wie(e){var t;let{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:a}=e,l=r&&!i,u=i5(n),c=new RegExp(`\\s${u}$`),f=s?"^":"",d=i?"":u,p=l?new RegExp(`${f}${u}.*?(?=\\s${d}|$)`,"gm"):new RegExp(`${f}(?:^)?${u}[^\\s${d}]*`,"gm"),h=((t=a.nodeBefore)==null?void 0:t.isText)&&a.nodeBefore.text;if(!h)return null;let g=a.pos-h.length,y=Array.from(h.matchAll(p)).pop();if(!y||y.input===void 0||y.index===void 0)return null;let b=y.input.slice(Math.max(0,y.index-1),y.index),E=new RegExp(`^[${o?.join("")}\0]?$`).test(b);if(o!==null&&!E)return null;let T=g+y.index,S=T+y[0].length;return l&&c.test(h.slice(S-1,S+1))&&(y[0]+=" ",S+=1),T=a.pos?{range:{from:T,to:S},query:y[0].slice(n.length),text:y[0]}:null}function Rie(e){return e.docChanged?e.steps.some(t=>{let n=t.slice;if(!n?.content)return!1;let r=n.content.textBetween(0,n.content.size,` -`);return/\s/.test(r)}):!1}var pv=new Et("suggestion");function H5({pluginKey:e=pv,editor:t,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:u="",decorationEmptyClass:c="is-empty",command:f=()=>null,items:d=()=>[],render:p=()=>({}),allow:h=()=>!0,findSuggestionMatch:g=wie,shouldShow:y,shouldResetDismissed:b}){let E,T=p?.(),S=r&&!i,v=()=>{let C=t.state.selection.$anchor.pos,V=t.view.coordsAtPos(C),{top:Y,right:q,bottom:L,left:H}=V;try{return new DOMRect(H,Y,q-H,L-Y)}catch{return null}},x=(C,V)=>V?()=>{let Y=e.getState(t.state),q=Y?.decorationId,L=C.dom.querySelector(`[data-decoration-id="${q}"]`);return L?.getBoundingClientRect()||null}:v,R=({match:C,dismissedRange:V,state:Y,transaction:q})=>b?.({editor:t,state:Y,range:V,match:C,transaction:q,allowSpaces:S})?!1:S?C.range.from===V.from:C.range.from===V.from&&!Rie(q);function O(C,V){var Y;try{let L=e.getState(C.state),H=L?.decorationId?C.dom.querySelector(`[data-decoration-id="${L.decorationId}"]`):null,I={editor:t,range:L?.range||{from:0,to:0},query:L?.query||null,text:L?.text||null,items:[],command:P=>f({editor:t,range:L?.range||{from:0,to:0},props:P}),decorationNode:H,clientRect:x(C,H)};(Y=T?.onExit)==null||Y.call(T,I)}catch{}let q=C.state.tr.setMeta(V,{exit:!0});C.dispatch(q)}let B=new Qe({key:e,view(){return{update:async(C,V)=>{var Y,q,L,H,I,P,D;let U=(Y=this.key)==null?void 0:Y.getState(V),_=(q=this.key)==null?void 0:q.getState(C.state),te=U.active&&_.active&&U.range.from!==_.range.from,ne=!U.active&&_.active,A=U.active&&!_.active,re=!ne&&!A&&U.query!==_.query,se=ne||te&&re,xe=re||te,Ve=A||te&&re;if(!se&&!xe&&!Ve)return;let de=Ve&&!se?U:_,ct=C.dom.querySelector(`[data-decoration-id="${de.decorationId}"]`);E={editor:t,range:de.range,query:de.query,text:de.text,items:[],command:Ge=>f({editor:t,range:de.range,props:Ge}),decorationNode:ct,clientRect:x(C,ct)},se&&((L=T?.onBeforeStart)==null||L.call(T,E)),xe&&((H=T?.onBeforeUpdate)==null||H.call(T,E)),(xe||se)&&(E.items=await d({editor:t,query:de.query})),Ve&&((I=T?.onExit)==null||I.call(T,E)),xe&&((P=T?.onUpdate)==null||P.call(T,E)),se&&((D=T?.onStart)==null||D.call(T,E))},destroy:()=>{var C;E&&((C=T?.onExit)==null||C.call(T,E))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(C,V,Y,q){let{isEditable:L}=t,{composing:H}=t.view,{selection:I}=C,{empty:P,from:D}=I,U={...V},_=C.getMeta(e);if(_&&_.exit)return U.active=!1,U.decorationId=null,U.range={from:0,to:0},U.query=null,U.text=null,U.dismissedRange=V.active?{...V.range}:V.dismissedRange,U;if(U.composing=H,C.docChanged&&U.dismissedRange!==null&&(U.dismissedRange={from:C.mapping.map(U.dismissedRange.from),to:C.mapping.map(U.dismissedRange.to)}),L&&(P||t.view.composing)){(DV.range.to)&&!H&&!V.composing&&(U.active=!1);let te=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:I.$from}),ne=`id_${Math.floor(Math.random()*4294967295)}`;te&&h({editor:t,state:q,range:te.range,isActive:V.active})&&(!y||y({editor:t,range:te.range,query:te.query,text:te.text,transaction:C}))?(U.dismissedRange!==null&&!R({match:te,dismissedRange:U.dismissedRange,state:q,transaction:C})&&(U.dismissedRange=null),U.dismissedRange===null?(U.active=!0,U.decorationId=V.decorationId?V.decorationId:ne,U.range=te.range,U.query=te.query,U.text=te.text):U.active=!1):(te||(U.dismissedRange=null),U.active=!1)}else U.active=!1;return U.active||(U.decorationId=null,U.range={from:0,to:0},U.query=null,U.text=null),U}},props:{handleKeyDown(C,V){var Y,q;let{active:L,range:H}=B.getState(C.state);if(!L)return!1;if(V.key==="Escape"||V.key==="Esc"){let P=B.getState(C.state);return(Y=T?.onKeyDown)==null||Y.call(T,{view:C,event:V,range:P.range}),O(C,e),!0}return((q=T?.onKeyDown)==null?void 0:q.call(T,{view:C,event:V,range:H}))||!1},decorations(C){let{active:V,range:Y,decorationId:q,query:L}=B.getState(C);if(!V)return null;let H=!L?.length,I=[l];return H&&I.push(c),pr.create(C.doc,[Bi.inline(Y.from,Y.to,{nodeName:a,class:I.join(" "),"data-decoration-id":q,"data-decoration-content":u})])}}});return B}var z5=Ps.create({name:"commandMention",group:"inline",inline:!0,atom:!0,selectable:!0,addOptions(){return{commands:[],suggestion:{char:"/",allowSpaces:!1,allow({range:e}){return e.from===0},command:({editor:e,range:t,props:n})=>{e.chain().focus().deleteRange(t).insertContent([{type:"commandMention",attrs:{name:n.name}},{type:"text",text:" "}]).run()}}}},addAttributes(){return{name:{default:null}}},parseHTML(){return[{tag:"span[data-command-mention]",getAttrs:e=>({name:e.getAttribute("data-command-mention")})}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Vd(t,{"data-command-mention":e.attrs.name,class:"command-chip"}),`/${e.attrs.name}`]},addKeyboardShortcuts(){return{Backspace:()=>{let{state:e,view:t}=this.editor,{selection:n}=e,{$from:r}=n;if(n instanceof ge&&n.node.type.name==="commandMention"){let o=n.node.attrs.name,s=n.from,a=e.tr.replaceWith(s,n.to,e.schema.text(`/${o}`));return a.setSelection(Te.create(a.doc,s+o.length+1)),t.dispatch(a),!0}let i=r.nodeBefore;if(i?.type.name==="commandMention"){let o=i.attrs.name,s=r.pos-i.nodeSize,a=e.tr.replaceWith(s,r.pos,e.schema.text(`/${o}`));return a.setSelection(Te.create(a.doc,s+o.length+1)),t.dispatch(a),!0}return!1}}},addProseMirrorPlugins(){let e=this.options;return[H5({editor:this.editor,...this.options.suggestion}),new Qe({key:new Et("commandMentionPaste"),props:{handlePaste:(t,n)=>{let r=n.clipboardData?.getData("text/plain")??"";if(!r.startsWith("/"))return!1;let i=r.slice(1),o=i.indexOf(" "),s=o===-1?i:i.slice(0,o),a=o===-1?"":i.slice(o);if(!e.commands.find(y=>y.name===s))return!1;let{state:c}=t,f=c.schema.nodes.commandMention;if(!f)return!1;let d=[];d.push(f.create({name:s})),a&&d.push(c.schema.text(a));let p=c.tr,{from:h,to:g}=c.selection;return p.replaceWith(h,g,d),t.dispatch(p),!0}}})]}});var G5=G(Ch(),1);var z0=G(fe(),1),ll=G(ie(),1);function q5(e,t){let n=t.toLowerCase();return e.filter(r=>r.name.toLowerCase().startsWith(n))}function V5({id:e,commands:t,effectiveIndex:n,onSelect:r,onHighlight:i}){let o=(0,z0.useRef)(null);return(0,z0.useEffect)(()=>{o.current?.children[n]?.scrollIntoView({block:"nearest"})},[n]),(0,ll.jsx)("ul",{id:e,ref:o,className:"shiny-chat-slash-palette",role:"listbox","aria-label":"Slash commands",onMouseDown:s=>s.preventDefault(),children:t.length===0?(0,ll.jsx)("li",{className:"shiny-chat-slash-palette-empty",role:"presentation",children:"No matching commands"}):t.map((s,a)=>(0,ll.jsxs)("li",{id:`${e}-item-${s.name}`,className:"shiny-chat-slash-palette-item"+(a===n?" highlighted":""),role:"option","aria-selected":a===n,onClick:()=>r(s),onMouseEnter:()=>i(a),children:[(0,ll.jsxs)("span",{className:"shiny-chat-slash-palette-name",children:["/",s.name]}),(0,ll.jsx)("span",{className:"shiny-chat-slash-palette-desc",children:s.description})]},s.name))})}var Y5=G(ie(),1);function K5({paletteId:e}){let t=null,n=null,r=0,i=[],o=null;function s(f){if(!t||!f)return;let d=f();if(!d)return;let p=t.offsetHeight,h=d.top,g=window.innerHeight-d.bottom,y=4;t.style.left=`${d.left}px`,p>0&&g>=p+y||g>=h?(t.style.top=`${d.bottom+y}px`,t.style.bottom=""):(t.style.top="",t.style.bottom=`${window.innerHeight-d.top+y}px`)}function a(){n&&n.render((0,Y5.jsx)(V5,{id:e,commands:i,effectiveIndex:r>=0?Math.min(r,i.length-1):-1,onSelect:f=>{o?.({name:f.name})},onHighlight:f=>{r=f,a()}}))}let l=null,u=null;function c(){l&&(window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0),l=null),u&&(document.removeEventListener("pointerdown",u,!0),u=null),n&&(n.unmount(),n=null),t&&(t.remove(),t=null),o=null}return{onStart(f){i=f.items??[],r=0,o=f.command,t=document.createElement("div"),t.style.position="fixed",t.style.zIndex="var(--slash-palette-z-index, 1050)",t.style.width="max-content",t.style.maxWidth="400px",document.body.appendChild(t),n=(0,G5.createRoot)(t),a(),requestAnimationFrame(()=>requestAnimationFrame(()=>s(f.clientRect))),l=()=>s(f.clientRect),window.addEventListener("resize",l),window.addEventListener("scroll",l,!0),u=d=>{t&&t.contains(d.target)},document.addEventListener("pointerdown",u,!0)},onUpdate(f){i=f.items??[],r=0,o=f.command,a(),requestAnimationFrame(()=>s(f.clientRect))},onKeyDown({event:f}){if(f.key==="ArrowDown")return r=i.length===0?0:(r+1)%i.length,a(),!0;if(f.key==="ArrowUp")return r=i.length===0?0:(r-1+i.length)%i.length,a(),!0;if(f.key==="Enter"||f.key==="Tab"){if(i.length>0&&r>=0){let d=i[Math.min(r,i.length-1)];d&&o?.({name:d.name})}return!0}return f.key==="Escape"},onExit(){c()}}}var Lo=G(fe(),1);function $5(e){let t=(0,Lo.useRef)(-1),n=(0,Lo.useRef)(new Map),r=(0,Lo.useRef)(!1),i=(0,Lo.useRef)(e);i.current!==e&&(i.current=e,t.current=-1,n.current.clear(),r.current=!1);let o=(0,Lo.useCallback)((l,u)=>{let c=e.length-1;if(n.current.set(t.current,u),l==="up"){if(e.length===0)return;r.current=!0,t.current>c&&(t.current=-1);let f=t.current===-1?c:Math.max(0,t.current-1);return t.current=f,n.current.get(f)??e[f]}else{let f=t.current;if(f===-1)return;if(f>c){t.current=-1;return}if(f>=c)return t.current=-1,n.current.get(-1)??"";let d=f+1;return t.current=d,n.current.get(d)??e[d]}},[e]),s=(0,Lo.useCallback)(()=>{t.current=-1,n.current.clear(),r.current=!1},[]),a=(0,Lo.useCallback)(()=>r.current,[]);return{recall:o,reset:s,isActive:a}}var W5=G(ie(),1);function Yd(e){let t=e.state.doc,n=[];return t.descendants(r=>r.type.name==="commandMention"?(n.push(`/${r.attrs.name}`),!1):r.type.name==="text"?(n.push(r.text??""),!1):r.type.name==="hardBreak"?(n.push(` +`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&s){let f=l.filter(d=>a.includes(d.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),L5=xie;var U0=200,vn=function(){};vn.prototype.append=function(t){return t.length?(t=vn.from(t),!this.length&&t||t.length=n?vn.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};vn.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};vn.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};vn.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(t(o,s))},n,r),i};vn.from=function(t){return t instanceof vn?t:t&&t.length?new P5(t):vn.empty};var P5=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,s,a){for(var l=o;l=s;l--)if(i(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=U0)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=U0)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(vn);vn.empty=new P5([]);var _ie=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(vn),lv=vn;var vie=500,al=class e{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=t.tr,a,l,u=[],c=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,c.push(f);return}if(i){c.push(new Ui(f.map));let p=f.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],u.push(new Ui(h,void 0,void 0,u.length+c.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,l=new e(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;cAie&&(a=Cie(a,u),s-=u),new e(a.append(o),s)}remapping(t,n){let r=new Sd;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(n=>new Ui(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(d=>{d.selection&&a--},i);let l=n;this.items.forEach(d=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(d.step){let g=t.steps[p].invert(t.docs[p]),y=d.selection&&d.selection.map(o.slice(l+1,p));y&&a++,r.push(new Ui(h,g,y))}else r.push(new Ui(h))},i);let u=[];for(let d=n;dvie&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=t)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let c=s.selection&&s.selection.map(n.slice(r));c&&o++;let f=new Ui(u.invert(),l,c),d,p=i.length-1;(d=i.length&&i[p].merge(f))?i[p]=d:i.push(f)}}else s.map&&r--},this.items.length,0),new e(lv.from(i.reverse()),o)}};al.empty=new al(lv.empty,0);function Cie(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}var Ui=class e{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},Fi=class{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},Aie=20;function Nie(e,t,n,r){let i=n.getMeta(sl),o;if(i)return i.historyState;n.getMeta(kie)&&(e=new Fi(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(sl))return s.getMeta(sl).redo?new Fi(e.done.addTransform(n,void 0,r,F0(t)),e.undone,B5(n.mapping.maps),e.prevTime,e.prevComposition):new Fi(e.done,e.undone.addTransform(n,void 0,r,F0(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!wie(n,e.prevRanges)),u=s?uv(e.prevRanges,n.mapping):B5(n.mapping.maps);return new Fi(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,F0(t)),al.empty,u,n.time,a??e.prevComposition)}else return(o=n.getMeta("rebased"))?new Fi(e.done.rebased(n,o),e.undone.rebased(n,o),uv(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Fi(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),uv(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function wie(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=t[o]&&(n=!0)}),n}function B5(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,s)=>t.push(o,s));return t}function uv(e,t){if(!e)return null;let n=[];for(let r=0;r{let i=sl.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=Rie(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}var fv=H0(!1,!0),dv=H0(!0,!0),eAe=H0(!1,!1),tAe=H0(!0,!1);var H5=hr.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>fv(e,t),redo:()=>({state:e,dispatch:t})=>dv(e,t)}},addProseMirrorPlugins(){return[F5(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});function Mie(e){var t;let{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:a}=e,l=r&&!i,u=o5(n),c=new RegExp(`\\s${u}$`),f=s?"^":"",d=i?"":u,p=l?new RegExp(`${f}${u}.*?(?=\\s${d}|$)`,"gm"):new RegExp(`${f}(?:^)?${u}[^\\s${d}]*`,"gm"),h=((t=a.nodeBefore)==null?void 0:t.isText)&&a.nodeBefore.text;if(!h)return null;let g=a.pos-h.length,y=Array.from(h.matchAll(p)).pop();if(!y||y.input===void 0||y.index===void 0)return null;let b=y.input.slice(Math.max(0,y.index-1),y.index),E=new RegExp(`^[${o?.join("")}\0]?$`).test(b);if(o!==null&&!E)return null;let T=g+y.index,S=T+y[0].length;return l&&c.test(h.slice(S-1,S+1))&&(y[0]+=" ",S+=1),T=a.pos?{range:{from:T,to:S},query:y[0].slice(n.length),text:y[0]}:null}function Oie(e){return e.docChanged?e.steps.some(t=>{let n=t.slice;if(!n?.content)return!1;let r=n.content.textBetween(0,n.content.size,` +`);return/\s/.test(r)}):!1}var pv=new Et("suggestion");function z5({pluginKey:e=pv,editor:t,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:u="",decorationEmptyClass:c="is-empty",command:f=()=>null,items:d=()=>[],render:p=()=>({}),allow:h=()=>!0,findSuggestionMatch:g=Mie,shouldShow:y,shouldResetDismissed:b}){let E,T=p?.(),S=r&&!i,v=()=>{let C=t.state.selection.$anchor.pos,V=t.view.coordsAtPos(C),{top:Y,right:q,bottom:L,left:H}=V;try{return new DOMRect(H,Y,q-H,L-Y)}catch{return null}},x=(C,V)=>V?()=>{let Y=e.getState(t.state),q=Y?.decorationId,L=C.dom.querySelector(`[data-decoration-id="${q}"]`);return L?.getBoundingClientRect()||null}:v,R=({match:C,dismissedRange:V,state:Y,transaction:q})=>b?.({editor:t,state:Y,range:V,match:C,transaction:q,allowSpaces:S})?!1:S?C.range.from===V.from:C.range.from===V.from&&!Oie(q);function O(C,V){var Y;try{let L=e.getState(C.state),H=L?.decorationId?C.dom.querySelector(`[data-decoration-id="${L.decorationId}"]`):null,I={editor:t,range:L?.range||{from:0,to:0},query:L?.query||null,text:L?.text||null,items:[],command:P=>f({editor:t,range:L?.range||{from:0,to:0},props:P}),decorationNode:H,clientRect:x(C,H)};(Y=T?.onExit)==null||Y.call(T,I)}catch{}let q=C.state.tr.setMeta(V,{exit:!0});C.dispatch(q)}let B=new Qe({key:e,view(){return{update:async(C,V)=>{var Y,q,L,H,I,P,D;let U=(Y=this.key)==null?void 0:Y.getState(V),_=(q=this.key)==null?void 0:q.getState(C.state),te=U.active&&_.active&&U.range.from!==_.range.from,ne=!U.active&&_.active,A=U.active&&!_.active,re=!ne&&!A&&U.query!==_.query,se=ne||te&&re,xe=re||te,Ve=A||te&&re;if(!se&&!xe&&!Ve)return;let de=Ve&&!se?U:_,ct=C.dom.querySelector(`[data-decoration-id="${de.decorationId}"]`);E={editor:t,range:de.range,query:de.query,text:de.text,items:[],command:Ge=>f({editor:t,range:de.range,props:Ge}),decorationNode:ct,clientRect:x(C,ct)},se&&((L=T?.onBeforeStart)==null||L.call(T,E)),xe&&((H=T?.onBeforeUpdate)==null||H.call(T,E)),(xe||se)&&(E.items=await d({editor:t,query:de.query})),Ve&&((I=T?.onExit)==null||I.call(T,E)),xe&&((P=T?.onUpdate)==null||P.call(T,E)),se&&((D=T?.onStart)==null||D.call(T,E))},destroy:()=>{var C;E&&((C=T?.onExit)==null||C.call(T,E))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(C,V,Y,q){let{isEditable:L}=t,{composing:H}=t.view,{selection:I}=C,{empty:P,from:D}=I,U={...V},_=C.getMeta(e);if(_&&_.exit)return U.active=!1,U.decorationId=null,U.range={from:0,to:0},U.query=null,U.text=null,U.dismissedRange=V.active?{...V.range}:V.dismissedRange,U;if(U.composing=H,C.docChanged&&U.dismissedRange!==null&&(U.dismissedRange={from:C.mapping.map(U.dismissedRange.from),to:C.mapping.map(U.dismissedRange.to)}),L&&(P||t.view.composing)){(DV.range.to)&&!H&&!V.composing&&(U.active=!1);let te=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:I.$from}),ne=`id_${Math.floor(Math.random()*4294967295)}`;te&&h({editor:t,state:q,range:te.range,isActive:V.active})&&(!y||y({editor:t,range:te.range,query:te.query,text:te.text,transaction:C}))?(U.dismissedRange!==null&&!R({match:te,dismissedRange:U.dismissedRange,state:q,transaction:C})&&(U.dismissedRange=null),U.dismissedRange===null?(U.active=!0,U.decorationId=V.decorationId?V.decorationId:ne,U.range=te.range,U.query=te.query,U.text=te.text):U.active=!1):(te||(U.dismissedRange=null),U.active=!1)}else U.active=!1;return U.active||(U.decorationId=null,U.range={from:0,to:0},U.query=null,U.text=null),U}},props:{handleKeyDown(C,V){var Y,q;let{active:L,range:H}=B.getState(C.state);if(!L)return!1;if(V.key==="Escape"||V.key==="Esc"){let P=B.getState(C.state);return(Y=T?.onKeyDown)==null||Y.call(T,{view:C,event:V,range:P.range}),O(C,e),!0}return((q=T?.onKeyDown)==null?void 0:q.call(T,{view:C,event:V,range:H}))||!1},decorations(C){let{active:V,range:Y,decorationId:q,query:L}=B.getState(C);if(!V)return null;let H=!L?.length,I=[l];return H&&I.push(c),pr.create(C.doc,[Bi.inline(Y.from,Y.to,{nodeName:a,class:I.join(" "),"data-decoration-id":q,"data-decoration-content":u})])}}});return B}var q5=Ps.create({name:"commandMention",group:"inline",inline:!0,atom:!0,selectable:!0,addOptions(){return{commands:[],suggestion:{char:"/",allowSpaces:!1,allow({range:e}){return e.from===0},command:({editor:e,range:t,props:n})=>{e.chain().focus().deleteRange(t).insertContent([{type:"commandMention",attrs:{name:n.name}},{type:"text",text:" "}]).run()}}}},addAttributes(){return{name:{default:null}}},parseHTML(){return[{tag:"span[data-command-mention]",getAttrs:e=>({name:e.getAttribute("data-command-mention")})}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Vd(t,{"data-command-mention":e.attrs.name,class:"command-chip"}),`/${e.attrs.name}`]},addKeyboardShortcuts(){return{Backspace:()=>{let{state:e,view:t}=this.editor,{selection:n}=e,{$from:r}=n;if(n instanceof ge&&n.node.type.name==="commandMention"){let o=n.node.attrs.name,s=n.from,a=e.tr.replaceWith(s,n.to,e.schema.text(`/${o}`));return a.setSelection(Te.create(a.doc,s+o.length+1)),t.dispatch(a),!0}let i=r.nodeBefore;if(i?.type.name==="commandMention"){let o=i.attrs.name,s=r.pos-i.nodeSize,a=e.tr.replaceWith(s,r.pos,e.schema.text(`/${o}`));return a.setSelection(Te.create(a.doc,s+o.length+1)),t.dispatch(a),!0}return!1}}},addProseMirrorPlugins(){let e=this.options;return[z5({editor:this.editor,...this.options.suggestion}),new Qe({key:new Et("commandMentionPaste"),props:{handlePaste:(t,n)=>{let r=n.clipboardData?.getData("text/plain")??"";if(!r.startsWith("/"))return!1;let i=r.slice(1),o=i.indexOf(" "),s=o===-1?i:i.slice(0,o),a=o===-1?"":i.slice(o);if(!e.commands.find(y=>y.name===s))return!1;let{state:c}=t,f=c.schema.nodes.commandMention;if(!f)return!1;let d=[];d.push(f.create({name:s})),a&&d.push(c.schema.text(a));let p=c.tr,{from:h,to:g}=c.selection;return p.replaceWith(h,g,d),t.dispatch(p),!0}}})]}});var K5=G(Ch(),1);var z0=G(fe(),1),ll=G(ie(),1);function V5(e,t){let n=t.toLowerCase();return e.filter(r=>r.name.toLowerCase().startsWith(n))}function G5({id:e,commands:t,effectiveIndex:n,onSelect:r,onHighlight:i}){let o=(0,z0.useRef)(null);return(0,z0.useEffect)(()=>{o.current?.children[n]?.scrollIntoView({block:"nearest"})},[n]),(0,ll.jsx)("ul",{id:e,ref:o,className:"shiny-chat-slash-palette",role:"listbox","aria-label":"Slash commands",onMouseDown:s=>s.preventDefault(),children:t.length===0?(0,ll.jsx)("li",{className:"shiny-chat-slash-palette-empty",role:"presentation",children:"No matching commands"}):t.map((s,a)=>(0,ll.jsxs)("li",{id:`${e}-item-${s.name}`,className:"shiny-chat-slash-palette-item"+(a===n?" highlighted":""),role:"option","aria-selected":a===n,onClick:()=>r(s),onMouseEnter:()=>i(a),children:[(0,ll.jsxs)("span",{className:"shiny-chat-slash-palette-name",children:["/",s.name]}),(0,ll.jsx)("span",{className:"shiny-chat-slash-palette-desc",children:s.description})]},s.name))})}var $5=G(ie(),1);function Y5({paletteId:e}){let t=null,n=null,r=0,i=[],o=null;function s(f){if(!t||!f)return;let d=f();if(!d)return;let p=t.offsetHeight,h=d.top,g=window.innerHeight-d.bottom,y=4;t.style.left=`${d.left}px`,p>0&&g>=p+y||g>=h?(t.style.top=`${d.bottom+y}px`,t.style.bottom=""):(t.style.top="",t.style.bottom=`${window.innerHeight-d.top+y}px`)}function a(){n&&n.render((0,$5.jsx)(G5,{id:e,commands:i,effectiveIndex:r>=0?Math.min(r,i.length-1):-1,onSelect:f=>{o?.({name:f.name})},onHighlight:f=>{r=f,a()}}))}let l=null,u=null;function c(){l&&(window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0),l=null),u&&(document.removeEventListener("pointerdown",u,!0),u=null),n&&(n.unmount(),n=null),t&&(t.remove(),t=null),o=null}return{onStart(f){i=f.items??[],r=0,o=f.command,t=document.createElement("div"),t.style.position="fixed",t.style.zIndex="var(--slash-palette-z-index, 1050)",t.style.width="max-content",t.style.maxWidth="400px",document.body.appendChild(t),n=(0,K5.createRoot)(t),a(),requestAnimationFrame(()=>requestAnimationFrame(()=>s(f.clientRect))),l=()=>s(f.clientRect),window.addEventListener("resize",l),window.addEventListener("scroll",l,!0),u=d=>{t&&t.contains(d.target)},document.addEventListener("pointerdown",u,!0)},onUpdate(f){i=f.items??[],r=0,o=f.command,a(),requestAnimationFrame(()=>s(f.clientRect))},onKeyDown({event:f}){if(f.key==="ArrowDown")return r=i.length===0?0:(r+1)%i.length,a(),!0;if(f.key==="ArrowUp")return r=i.length===0?0:(r-1+i.length)%i.length,a(),!0;if(f.key==="Enter"||f.key==="Tab"){if(i.length>0&&r>=0){let d=i[Math.min(r,i.length-1)];d&&o?.({name:d.name})}return!0}return f.key==="Escape"},onExit(){c()}}}var Lo=G(fe(),1);function W5(e){let t=(0,Lo.useRef)(-1),n=(0,Lo.useRef)(new Map),r=(0,Lo.useRef)(!1),i=(0,Lo.useRef)(e);i.current!==e&&(i.current=e,t.current=-1,n.current.clear(),r.current=!1);let o=(0,Lo.useCallback)((l,u)=>{let c=e.length-1;if(n.current.set(t.current,u),l==="up"){if(e.length===0)return;r.current=!0,t.current>c&&(t.current=-1);let f=t.current===-1?c:Math.max(0,t.current-1);return t.current=f,n.current.get(f)??e[f]}else{let f=t.current;if(f===-1)return;if(f>c){t.current=-1;return}if(f>=c)return t.current=-1,n.current.get(-1)??"";let d=f+1;return t.current=d,n.current.get(d)??e[d]}},[e]),s=(0,Lo.useCallback)(()=>{t.current=-1,n.current.clear(),r.current=!1},[]),a=(0,Lo.useCallback)(()=>r.current,[]);return{recall:o,reset:s,isActive:a}}var j5=G(ie(),1);function Yd(e){let t=e.state.doc,n=[];return t.descendants(r=>r.type.name==="commandMention"?(n.push(`/${r.attrs.name}`),!1):r.type.name==="text"?(n.push(r.text??""),!1):r.type.name==="hardBreak"?(n.push(` `),!1):!0),n.join("")}function hv(e,t){if(!e)return{type:"doc",content:[]};if(e.startsWith("/")){let i=e.slice(1),o=i.indexOf(" "),s=o===-1?i:i.slice(0,o),a=o===-1?"":i.slice(o+1);if(t.find(u=>u.name===s)){let u=[{type:"commandMention",attrs:{name:s}}];return a&&u.push({type:"text",text:" "+a}),{type:"doc",content:u}}}let n=e.split(` -`),r=[];return n.forEach((i,o)=>{o>0&&r.push({type:"hardBreak"}),i&&r.push({type:"text",text:i})}),{type:"doc",content:r}}var q0=(0,mr.forwardRef)(function({inputId:t,placeholder:n,hasTopShadow:r=!1,slashCommands:i,onHasTextChange:o,onSubmit:s,userMessages:a,submitKey:l,canSubmitEmpty:u},c){let{recall:f,reset:d,isActive:p}=$5(a),h=(0,mr.useRef)(i);h.current=i;let g=(0,mr.useRef)(n);g.current=n;let y=(0,mr.useRef)(s);y.current=s;let b=(0,mr.useRef)(o);b.current=o;let E=(0,mr.useRef)(u);E.current=u;let T=(0,mr.useRef)(d);T.current=d;let S=(0,mr.useRef)(null),v=v5({extensions:[O5.extend({content:"inline*"}),D5,I5,F5,hr.create({name:"submitShortcut",priority:200,addKeyboardShortcuts(){let x=()=>{if(pv.getState(this.editor.view.state)?.active)return!1;let C=Yd(this.editor);return(this.editor.isEmpty||C.trim().length===0)&&!E.current?.()?!1:(y.current(C)&&(this.editor.commands.clearContent(!0),b.current(!1),T.current()),!0)},O={[l==="enter+modifier"?"Mod-Enter":"Enter"]:x};return l==="enter+modifier"&&(O.Enter=()=>this.editor.commands.first(({commands:B})=>[()=>B.newlineInCode(),()=>B.setHardBreak()])),O}}),z5.configure({commands:i,suggestion:{char:"/",allowSpaces:!1,allow({range:x}){return x.from===0},items:({query:x})=>q5(h.current,x),render:()=>K5({paletteId:`${t}-slash-palette`}),command:({editor:x,range:R,props:O})=>{x.chain().focus().deleteRange(R).insertContent([{type:"commandMention",attrs:{name:O.name}},{type:"text",text:" "}]).run()}}})],editorProps:{attributes:x=>{let R=x.doc.content.size===0;return{"aria-label":"Chat message","data-shiny-no-bind-input":"",role:"textbox","aria-multiline":"true",...h.current.length>0?{"aria-haspopup":"listbox"}:{},class:`form-control${r?" shadow":""}${R?" is-empty":""}`,...R?{"data-placeholder":g.current}:{}}},handleKeyDown:(x,R)=>{if(R.isComposing)return!1;if(R.key==="ArrowUp"||R.key==="ArrowDown"){let O=S.current;if(!O)return!1;let B=Yd(O),{$from:C}=x.state.selection,V=C.pos===x.state.doc.content.size-1;if(p()?V:B.length===0){let q=f(R.key==="ArrowUp"?"up":"down",B);if(q!==void 0)return R.preventDefault(),O.commands.setContent(hv(q,h.current)),o(q.trim().length>0),O.commands.focus("end"),!0}return!1}return!1}},onCreate:({editor:x})=>{S.current=x,o(!x.isEmpty)},onUpdate:({editor:x})=>{o(!x.isEmpty)}});return(0,mr.useEffect)(()=>{let x=v?.view?.dom;x&&(i.length>0?x.setAttribute("aria-haspopup","listbox"):x.removeAttribute("aria-haspopup"))},[v,i]),(0,mr.useImperativeHandle)(c,()=>({setInputValue(x,{submit:R=!1,focus:O=!1}={}){if(!v)return;let B=Yd(v);if(v.commands.setContent(hv(x,h.current)),o(x.trim().length>0),R){let C=Yd(v);s(C),v.commands.setContent(hv(B,h.current)),o(B.trim().length>0)}O&&(v.view.dom.focus(),v.commands.setTextSelection(v.state.doc.content.size))},focus(){v?.commands.focus("end")},serializeEditor(){return v?Yd(v):""}}),[v,s,o]),(0,W5.jsx)(ov,{editor:v,id:t})});var ht=G(fe(),1);function kie(e){return{mime:e.type,data_url:e.dataUrl,name:e.name,size:e.size}}function Mie(e){return e.map(t=>({id:Yr(),type:t.mime,family:za(t.mime)??"document",dataUrl:t.data_url,name:t.name,size:t.size}))}function V0({uploadAccept:e,maxUploadSize:t,enableUpload:n,focusEditor:r}){let[i,o]=(0,ht.useState)([]),s=(0,ht.useRef)([]);(0,ht.useEffect)(()=>{s.current=i},[i]);let[a,l]=(0,ht.useState)(!1),[u,c]=(0,ht.useState)(!1),[f,d]=(0,ht.useState)(!1),p=(0,ht.useRef)(null),h=(0,ht.useCallback)(async V=>{let Y=[];for(let I of Array.from(V)){let P=null;try{P=await H6(I,e)}catch{continue}P&&Y.push(P)}if(Y.length===0){r();return}let q=!1,L=!1,H=!1;o(I=>{let P=B6(I),D=[];for(let{file:U,wasDownscaled:_,wasConverted:te}of Y){if(t!==null&&P+U.size>t){q=!0;continue}D.push(U),P+=U.size,_&&(L=!0),te&&(H=!0)}return D.length>0?[...I,...D]:I}),q&&d(!0),L&&l(!0),H&&c(!0),r()},[e,t,r]),g=(0,ht.useCallback)(V=>{d(!1),o(Y=>{let q=Y.filter(L=>L.id!==V);return q.length===0&&(l(!1),c(!1)),q})},[]),y=(0,ht.useRef)([]),b=(0,ht.useRef)(null),E=(0,ht.useCallback)(V=>{let Y=i.length-1;b.current=Y===0?"input":Math.min(V,Y-1),g(i[V].id)},[i,g]);(0,ht.useLayoutEffect)(()=>{y.current.length=i.length;let V=b.current;V!==null&&(b.current=null,V==="input"?r():y.current[V]?.focus())},[i,r]);let T=(0,ht.useCallback)(V=>{if(!n)return;let Y=V.clipboardData;if(!Y)return;let q=[];for(let H of Array.from(Y.items))if(H.kind==="file"&&e.includes(H.type)){let I=H.getAsFile();I&&q.push(I)}if(q.length>0){V.preventDefault(),V.stopPropagation(),h(q);return}let L=Y.getData("text/plain");L.length>D6&&e.includes("text/plain")&&(V.preventDefault(),V.stopPropagation(),h([F6(L)]))},[h,n,e]),S=(0,ht.useCallback)(V=>{n&&V.dataTransfer?.files?.length&&(V.preventDefault(),V.stopPropagation(),h(V.dataTransfer.files))},[h,n]),v=(0,ht.useCallback)(V=>{V.target.files&&h(V.target.files),V.target.value=""},[h]),x=(0,ht.useCallback)(V=>{V.target===V.currentTarget&&(V.preventDefault(),r())},[r]),R=(0,ht.useCallback)(()=>s.current.map(kie),[]),O=(0,ht.useCallback)((V,Y)=>{let q=Mie(V);Y==="append"?o(L=>[...L,...q]):(o(q),l(!1),c(!1),d(!1))},[]),B=(0,ht.useCallback)(()=>o([]),[]),C=(0,ht.useCallback)(()=>{o([]),l(!1),c(!1),d(!1)},[]);return{attachments:i,downscaleNotice:a,gifConvertedNotice:u,sizeNotice:f,fileInputRef:p,attachmentRefs:y,addFiles:h,removeAttachment:g,removeAttachmentByKeyboard:E,onPaste:T,onDrop:S,onFilePick:v,onAttachmentsMouseDown:x,getPayloads:R,applyPayloads:O,clearAttachments:B,resetAll:C}}var mv=G(fe(),1);var Tt=G(ie(),1),G0=(0,mv.memo)(function({staging:t,uploadAccept:n,maxUploadSize:r,enableUpload:i,disabled:o}){let{attachments:s,downscaleNotice:a,gifConvertedNotice:l,sizeNotice:u,fileInputRef:c,attachmentRefs:f,removeAttachmentByKeyboard:d,onFilePick:p,onAttachmentsMouseDown:h}=t;return(0,Tt.jsxs)(Tt.Fragment,{children:[s.length>0&&(0,Tt.jsx)("div",{className:"shiny-chat-input-attachments",onMouseDown:h,children:s.map((g,y)=>(0,Tt.jsx)(Oie,{attachment:g,index:y,onRemove:()=>d(y),registerRef:b=>{f.current[y]=b}},g.id))}),(a||u||l)&&(0,Tt.jsxs)("div",{className:"shiny-chat-input-notice",role:"status",children:[u&&r!==null&&(0,Tt.jsxs)("div",{children:["Attachments exceed the ",pd(r)," limit."]}),a&&(0,Tt.jsx)("div",{children:"Large image(s) were downscaled to fit."}),l&&(0,Tt.jsx)("div",{children:"Animated GIF(s) were converted to a still image."})]}),i&&(0,Tt.jsxs)(Tt.Fragment,{children:[(0,Tt.jsx)("input",{ref:c,type:"file",multiple:!0,accept:k6(n),style:{display:"none"},onChange:p,"data-shiny-no-bind-input":!0}),(0,Tt.jsx)("button",{type:"button",className:"shiny-chat-btn-attach",title:"Attach file","aria-label":"Attach file",disabled:o,onClick:()=>c.current?.click(),dangerouslySetInnerHTML:{__html:gL}})]})]})}),Oie=(0,mv.memo)(function({attachment:t,index:n,onRemove:r,registerRef:i}){let o={tabIndex:0,"aria-label":t.name?`Attachment: ${t.name}. Press Delete to remove.`:"Attachment. Press Delete to remove.",onClick:s=>s.currentTarget.focus(),onKeyDown:s=>{(s.code==="Delete"||s.code==="Backspace")&&(s.preventDefault(),r())}};return t.family==="image"?(0,Tt.jsxs)("div",{ref:i,className:"shiny-chat-input-thumbnail",title:t.name||void 0,...o,children:[(0,Tt.jsx)("img",{src:t.dataUrl,alt:t.name?`Attached image: ${t.name}`:`Attached image ${n+1}`}),(0,Tt.jsx)("button",{type:"button",tabIndex:0,"aria-label":t.name?`Remove ${t.name}`:"Remove image",onClick:r,children:"\xD7"})]}):t.family==="text"?(0,Tt.jsx)(Gg,{dataUrl:t.dataUrl,name:t.name,size:t.size,onRemove:r,rootRef:i,rootProps:o}):(0,Tt.jsxs)("div",{ref:i,className:"shiny-chat-input-attachment-chip",title:t.name||void 0,...o,children:[(0,Tt.jsx)("span",{className:"shiny-chat-attachment-badge",children:qg(t.name,t.type)}),(0,Tt.jsxs)("span",{className:"shiny-chat-attachment-meta",children:[(0,Tt.jsx)("span",{className:"shiny-chat-attachment-name",children:t.name||"attachment"}),(0,Tt.jsx)("span",{className:"shiny-chat-attachment-size",children:pd(t.size)})]}),(0,Tt.jsx)("button",{type:"button",tabIndex:0,"aria-label":t.name?`Remove ${t.name}`:"Remove attachment",onClick:r,children:"\xD7"})]})});var $d=G(fe(),1);var Ft=G(ie(),1),Die=3;function j5({url:e,deriveFavicon:t}){let n=Sx(e),[r,i]=(0,$d.useState)(!1);return!t||!n||r?(0,Ft.jsx)("span",{className:"shiny-sources-favicon shiny-sources-favicon--blank","aria-hidden":"true"}):(0,Ft.jsx)("img",{className:"shiny-sources-favicon",src:n,alt:"",onError:()=>i(!0)})}function Iie({sources:e}){let[t,n]=(0,$d.useState)(!1),r=ou(),{refs:i,floatingStyles:o,context:s,getReferenceProps:a,getFloatingProps:l}=Bg(t,n),u=Pg(i.domReference.current);if(e.length===0)return null;let c=`Sources, ${e.length} ${e.length===1?"source":"sources"}`;return(0,Ft.jsxs)("div",{className:"shiny-sources",children:[(0,Ft.jsxs)("button",{ref:i.setReference,type:"button",className:"shiny-sources-pill","aria-label":c,...a(),children:[r&&(0,Ft.jsx)("span",{className:"shiny-sources-pill__stack",children:e.slice(0,Die).map(f=>(0,Ft.jsx)(j5,{url:f.url,deriveFavicon:r},f.url))}),(0,Ft.jsx)("span",{className:"shiny-sources-pill__label",children:"Sources"})]}),t&&(0,Ft.jsx)(Ig,{children:(0,Ft.jsx)(Lg,{context:s,modal:!1,initialFocus:-1,returnFocus:!0,children:(0,Ft.jsxs)("div",{ref:i.setFloating,className:"shiny-sources-popover",style:{...u.style,...o},"data-bs-theme":u.theme,"aria-label":c,...l(),children:[(0,Ft.jsx)("div",{className:"shiny-sources-popover__title",children:"Sources"}),(0,Ft.jsx)("ul",{className:"shiny-sources-list",children:e.map(f=>(0,Ft.jsx)("li",{className:"shiny-sources-item",children:(0,Ft.jsxs)("a",{className:"shiny-sources-item__link",href:f.url,...Ni,children:[(0,Ft.jsx)(j5,{url:f.url,deriveFavicon:r}),(0,Ft.jsxs)("span",{className:"shiny-sources-item__text",children:[f.domain&&(0,Ft.jsx)("span",{className:"shiny-sources-item__site",children:f.domain}),(0,Ft.jsx)("span",{className:"shiny-sources-item__title",children:f.title??f.domain??f.url})]})]})},f.url))})]})})})]})}var X5=(0,$d.memo)(function(){return(0,Ft.jsx)(Iie,{sources:t6()})});var De=G(ie(),1),Lie=500,Pie=10;function Bie(e,t){if(!e.startsWith("/"))return null;let n=e.slice(1),r=n.indexOf(" "),i=r===-1?n:n.slice(0,r),o=r===-1?"":n.slice(r+1).trim();return t.find(a=>a.name===i)?{commandName:i,remainingText:o}:null}var Q5=(0,tt.memo)(function({message:t,index:n,iconAssistant:r,onEdit:i,onNavigate:o,siblingNavigationPending:s=!1,disabled:a,inputId:l,submitKey:u="enter",isEditing:c=!1,onStartEdit:f,onCancelEdit:d,uploadAccept:p=[],maxUploadSize:h=null,enableUpload:g}){let y=MR(),b=RR(),{supersededRequests:E}=Oh(),[T,S]=(0,tt.useState)(null),[v,x]=(0,tt.useState)(!1),R=(0,tt.useRef)(null),O=t.role==="user",B=(0,tt.useMemo)(()=>t.streaming?lo(t.blocks,b,t.role,!0):t.blocks,[t.streaming,t.blocks,t.role,b]),C=O?void 0:Gu,V=(0,tt.useMemo)(()=>{let j=[];return B.forEach((Se,Xe)=>{if(Se.type!=="tool_loop"){j.push({block:Se,index:Xe});return}let wt=Se.groups.map(xt=>{let w=xt.calls.filter(F=>!(F.status==="running"&&E.has(F.requestId)));return w.length===xt.calls.length?xt:{...xt,calls:w,...iu(w)}}).filter(xt=>xt.calls.length>0);wt.length>0&&j.push({block:{...Se,groups:wt},index:Xe})}),j},[B,E]),Y=O&&!!i&&!a&&!c,[q,L]=(0,tt.useState)(!1),H=(0,tt.useRef)(null),I=(0,tt.useRef)(null),P=(0,tt.useRef)(!1),D=(0,tt.useRef)(null),U=(0,tt.useCallback)(()=>R.current?.focus(),[]),_=V0({uploadAccept:p,maxUploadSize:h,enableUpload:g,focusEditor:U}),{applyPayloads:te,getPayloads:ne,onPaste:A,onDrop:re}=_,se=(0,tt.useRef)(!1);(0,tt.useEffect)(()=>{c&&!se.current&&(R.current?.setInputValue(t.content,{focus:!0}),te(t.attachments??[],"set")),se.current=c},[c,t.content,t.attachments,te]);let xe=(0,tt.useCallback)(j=>a?!1:(i?.(n,j,ne()),d?.(),!0),[i,d,n,a,ne]),Ve=(0,tt.useCallback)(()=>ne().length>0,[ne]),de=(0,tt.useCallback)(()=>{H.current!==null&&(clearTimeout(H.current),H.current=null)},[]),ct=(0,tt.useCallback)(j=>{j.pointerType==="touch"&&(I.current={x:j.clientX,y:j.clientY},P.current=!1,de(),H.current=setTimeout(()=>{H.current=null,P.current=!0,L(!0)},Lie))},[de]),Ge=(0,tt.useCallback)(j=>{let Se=I.current;if(!Se)return;Math.hypot(j.clientX-Se.x,j.clientY-Se.y)>Pie&&(I.current=null,de())},[de]),rt=(0,tt.useCallback)(j=>{let Se=I.current!==null;I.current=null,de(),Se&&P.current&&j.preventDefault()},[de]),he=(0,tt.useCallback)(()=>{I.current=null,de()},[de]),Ce=(0,tt.useCallback)(j=>{(I.current!==null||P.current)&&j.preventDefault()},[]);(0,tt.useEffect)(()=>{if(!q)return;let j=Se=>{D.current?.contains(Se.target)||L(!1)};return document.addEventListener("pointerdown",j,!0),()=>document.removeEventListener("pointerdown",j,!0)},[q]);let Ae=t.content.trim()!==""||V.some(({block:j})=>j.type==="thinking"||j.type==="tool_loop")||(t.attachments?.length??0)>0||t.cancelled,Ne;if(O)Ne=t.icon||void 0;else{let j=t.icon??r;j===""?Ne=void 0:Ne=Ae?j??pL:hL}if(!Ae&&!t.streaming&&!t.isPlaceholder)return null;let me=O?Bie(t.content,y):null,we=O?"shiny-chat-user-message":"shiny-chat-message",ue=t.attachments&&t.attachments.length>0?(0,De.jsx)("div",{className:"shiny-chat-message-attachments",children:t.attachments.map((j,Se)=>{if(j.mime.startsWith("image/")){let Xe=j.name?`Attached image: ${j.name}`:`Attached image ${Se+1}`;return(0,De.jsx)("button",{type:"button",className:"shiny-chat-message-image-btn",title:j.name||void 0,"aria-label":j.name?`View ${j.name}`:`View attached image ${Se+1}`,onClick:()=>S({src:j.data_url,name:j.name,mime:j.mime}),children:(0,De.jsx)("img",{className:"shiny-chat-message-image",src:j.data_url,alt:Xe})},Se)}return za(j.mime)==="text"?(0,De.jsx)(Gg,{dataUrl:j.data_url,name:j.name,size:zg(j.data_url),onActivate:()=>S({src:j.data_url,name:j.name,mime:j.mime})},Se):(0,De.jsxs)("button",{type:"button",className:"shiny-chat-message-attachment-chip",title:j.name||void 0,"aria-label":`View ${j.name||"attachment"}`,onClick:()=>S({src:j.data_url,name:j.name,mime:j.mime}),children:[(0,De.jsx)("span",{className:"shiny-chat-attachment-badge",children:qg(j.name,j.mime)}),(0,De.jsx)("span",{className:"shiny-chat-attachment-name",children:j.name||"attachment"})]},Se)})}):null,St=V.map(({block:j,index:Se})=>{if(j.type==="thinking")return(0,De.jsx)(c6,{thinking:j,messageId:`${t.id}-${Se}`},Se);let Xe=Se===B.length-1;if(j.type==="tool_loop")return(0,De.jsx)("div",{className:"shiny-chat-tool-loop",children:j.groups.map(xt=>(0,De.jsx)(v6,{group:xt},xt.key))},Se);if(me&&Se===0){let xt=(0,De.jsx)(C6,{name:me.commandName}),w=me.remainingText||"";return j.contentType==="text"?(0,De.jsxs)("div",{className:"content-type-text",children:[xt,w&&` ${w}`]},Se):w?(0,De.jsx)(Kt,{content:w,contentType:j.contentType,role:t.role,streaming:t.streaming&&Xe,tagToComponentMap:C,prefix:xt},Se):(0,De.jsx)("p",{children:xt},Se)}let wt=(0,De.jsx)(Kt,{content:j.content,contentType:j.contentType,role:t.role,streaming:t.streaming&&Xe,tagToComponentMap:C},Se);return j.contentType==="text"?(0,De.jsx)("div",{className:"content-type-text",children:wt},Se):wt}),Ie=T&&(0,De.jsx)(V6,{src:T.src,name:T.name,mime:T.mime,onClose:()=>S(null)});return(0,De.jsxs)("div",{ref:D,className:we,"data-touch-revealed":q||void 0,onPointerDown:Y?ct:void 0,onPointerMove:Y?Ge:void 0,onPointerUp:Y?rt:void 0,onPointerCancel:Y?he:void 0,onContextMenu:Y?Ce:void 0,children:[Ne&&(0,De.jsx)("div",{className:"message-icon",dangerouslySetInnerHTML:{__html:Ne}}),(0,De.jsx)("div",{className:"shiny-chat-message-content",children:c?(0,De.jsxs)("div",{className:"shiny-chat-edit-wrap",onKeyDownCapture:j=>{j.key==="Escape"&&(j.preventDefault(),d?.())},children:[(0,De.jsxs)("div",{className:"shiny-chat-edit-box",onDropCapture:re,onDragOver:j=>j.preventDefault(),onPasteCapture:A,children:[(0,De.jsx)(G0,{staging:_,uploadAccept:p,maxUploadSize:h,enableUpload:g,disabled:a}),(0,De.jsx)(q0,{ref:R,inputId:`${l}-edit`,placeholder:"Edit message",slashCommands:[],userMessages:[],submitKey:u,onHasTextChange:x,onSubmit:xe,canSubmitEmpty:Ve}),(0,De.jsx)("button",{type:"button",className:"shiny-chat-btn-send",disabled:a||!v&&_.attachments.length===0,onClick:()=>{let j=R.current?.serializeEditor()??"";xe(j)},"aria-label":"Save and resend",title:"Save and resend",dangerouslySetInnerHTML:{__html:ig}})]}),(0,De.jsx)("button",{type:"button",className:"shiny-chat-edit-cancel-outside",onClick:()=>d?.(),children:"Cancel"})]}):(0,De.jsxs)(De.Fragment,{children:[O&&ue,(0,De.jsxs)(J3,{children:[St,!O&&(0,De.jsx)(X5,{})]}),!O&&ue,t.cancelled&&(0,De.jsx)("div",{className:"shiny-chat-message-cancelled",children:"Response cancelled"})]})}),O&&!c&&(i&&!a||t.siblings&&t.siblings.total>1)&&(0,De.jsxs)("div",{className:"shiny-chat-message-footer",children:[t.siblings&&t.siblings.total>1&&(0,De.jsxs)("div",{className:"shiny-chat-sibling-nav",children:[(0,De.jsx)("button",{type:"button",disabled:t.siblings.index===0||a||s,onClick:()=>o?.(n,"prev"),"aria-label":"Previous version",children:"\u2039"}),(0,De.jsxs)("span",{"aria-live":"polite",children:[t.siblings.index+1," / ",t.siblings.total]}),(0,De.jsx)("button",{type:"button",disabled:t.siblings.index===t.siblings.total-1||a||s,onClick:()=>o?.(n,"next"),"aria-label":"Next version",children:"\u203A"})]}),i&&!a&&(0,De.jsx)("button",{type:"button",className:"shiny-chat-edit-btn",onClick:()=>{L(!1),f?.(t.id)},"aria-label":"Edit message",title:"Edit message",dangerouslySetInnerHTML:{__html:SL}})]}),Ie]})});var Z5=G(fe(),1),J5=G(ie(),1),K0=class extends Z5.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){console.warn("[shinychat] Error rendering message:",t,n)}render(){return this.state.hasError?(0,J5.jsx)("div",{className:"shiny-chat-message-error",role:"alert",children:"Error rendering message"}):this.props.children}};var ac=G(ie(),1),e8=(0,ul.memo)(function({messages:t,iconAssistant:n,onEdit:r,onNavigate:i,siblingNavigationPending:o,disabled:s,inputId:a,submitKey:l,uploadAccept:u,maxUploadSize:c,enableUpload:f}){let[d,p]=(0,ul.useState)(null),h=(0,ul.useCallback)(y=>p(y),[]),g=(0,ul.useCallback)(()=>p(null),[]);return(0,ac.jsx)(ac.Fragment,{children:t.map((y,b)=>(0,ac.jsx)(K0,{children:(0,ac.jsx)(Q5,{message:y,index:b,iconAssistant:n,onEdit:r,onNavigate:i,siblingNavigationPending:o,disabled:s,inputId:a,submitKey:l,uploadAccept:u,maxUploadSize:c,enableUpload:f,isEditing:y.id===d,onStartEdit:h,onCancelEdit:g})},y.id))})});var ci=G(fe(),1);var Y0=G(ie(),1),t8=(0,ci.memo)(function({greeting:t}){let n=Ku(),r=(0,ci.useContext)(hf),i=(0,ci.useRef)(null),[o,s]=(0,ci.useState)(!0),a=t.status==="dismissing";if((0,ci.useEffect)(()=>{if(!o)return;if(n){s(!1);return}let c=i.current;if(!c)return;function f(d){d.animationName==="shiny-chat-greeting-reveal"&&s(!1)}return c.addEventListener("animationend",f),()=>c.removeEventListener("animationend",f)},[o,n]),(0,ci.useEffect)(()=>{if(!a)return;if(n){r?.({type:"greeting_dismissed"});return}let c=i.current;if(!c)return;function f(d){d.animationName==="shiny-chat-greeting-dismiss"&&r?.({type:"greeting_dismissed"})}return c.addEventListener("animationend",f),()=>c.removeEventListener("animationend",f)},[a,n,r]),t.status==="dismissed")return null;let l=t.blocks.length-1;return(0,Y0.jsx)("div",{className:o?"shiny-chat-greeting shiny-chat-greeting--enter":"shiny-chat-greeting",ref:i,...a?{"data-dismissing":""}:{},children:(0,Y0.jsx)("div",{className:"shiny-chat-greeting-content",children:t.blocks.map((c,f)=>(0,Y0.jsx)(Kt,{content:c.content,contentType:c.contentType,role:"assistant",streaming:t.streaming&&f===l,tagToComponentMap:Gu},f))})})});var gr=G(fe(),1);var zs=G(ie(),1);function Uie(e,t){if(!e.startsWith("/"))return null;let n=e.slice(1),r=n.indexOf(" "),i=r===-1?n:n.slice(0,r),o=r===-1?"":n.slice(r+1).trim(),s=t.find(a=>a.name===i);return s?{command:i,userText:o,echo:s.echo}:null}var n8=(0,gr.memo)((0,gr.forwardRef)(function({transport:t,inputId:n,uploadAccept:r,maxUploadSize:i,disabled:o,hasTopShadow:s=!1,placeholder:a,onSend:l,userMessages:u,enableCancel:c,enableUpload:f,cancelRequested:d,isStreaming:p,onCancel:h,slashCommands:g=[],slashCommandId:y="",submitKey:b="enter"},E){let T=Dh(),S=kR(),v=(0,gr.useRef)(null),[x,R]=(0,gr.useState)(!1),O=(0,gr.useCallback)(()=>v.current?.focus(),[]),B=V0({uploadAccept:r,maxUploadSize:i,enableUpload:f,focusEditor:O}),{attachments:C,onPaste:V,onDrop:Y,getPayloads:q,applyPayloads:L,clearAttachments:H,resetAll:I}=B,P=(0,gr.useCallback)(A=>{let re=q();if(A.trim().length===0&&re.length===0||o)return!1;let se=Uie(A,g);if(se){let xe=document.getElementById(n),Ve=xe?.closest("shiny-chat-container")??null,de={id:Ve?.getAttribute("effective-id")??Ve?.id??"",command:se.command,userText:se.userText,echo:se.echo},ct=new CustomEvent("shiny:chat-slash-command",{detail:de,cancelable:!0,bubbles:!0});(Ve??xe)?.dispatchEvent(ct);let Ge=de.echo,rt=ct.defaultPrevented;Ge&&T({type:"INPUT_SENT",content:A,role:"user",awaitResponse:!rt}),rt||t.sendSlashCommand(y,se.command,se.userText,Ge)}else S(A,re),I();return l?.(),!0},[o,T,t,n,l,g,y,S,q,I]),D=(0,gr.useCallback)(()=>q().length>0,[q]);(0,gr.useImperativeHandle)(E,()=>({setInputValue(A,{submit:re=!1,focus:se=!1,attachments:xe,attachmentMode:Ve="append"}={}){let de=v.current;if(!de)return;if(!re){A!==void 0?de.setInputValue(A,{focus:se}):se&&de.focus(),xe!==void 0&&L(xe,Ve);return}let ct=de.serializeEditor();A!==void 0&&de.setInputValue(A);let Ge=de.serializeEditor(),rt=xe??[],he=Ve==="append"?[...q(),...rt]:rt;he.length===0?P(Ge):!o&&he.length>0&&(S(Ge,he),l?.()),A!==void 0?de.setInputValue(ct,{focus:se}):se&&de.focus(),xe!==void 0&&H()},focus(){v.current?.focus()}}),[o,l,P,S,L,q,H]);let U=o||!x&&C.length===0;return(0,zs.jsxs)("div",{className:"shiny-chat-input-dropzone",onDropCapture:Y,onDragOver:A=>A.preventDefault(),onPasteCapture:V,children:[(0,zs.jsx)(G0,{staging:B,uploadAccept:r,maxUploadSize:i,enableUpload:f,disabled:o}),(0,zs.jsx)(q0,{ref:v,inputId:n,placeholder:a,hasTopShadow:s,slashCommands:g,onHasTextChange:R,onSubmit:P,userMessages:u,submitKey:b,canSubmitEmpty:D}),!!c&&!!p&&!d?(0,zs.jsx)("button",{type:"button",className:"shiny-chat-btn-send shiny-chat-btn-cancel",title:"Stop generating","aria-label":"Stop generating",onClick:h,dangerouslySetInnerHTML:{__html:yL}}):o&&!p||!!d?(0,zs.jsx)("button",{type:"button",className:`shiny-chat-btn-send shiny-chat-btn-spinner${d?" shiny-chat-btn-cancel":""}`,"aria-label":"Loading",dangerouslySetInnerHTML:{__html:EL}}):(0,zs.jsx)("button",{type:"button",className:"shiny-chat-btn-send",title:"Send message","aria-label":"Send message",disabled:U,onClick:()=>{let A=v.current?.serializeEditor()??"";P(A)&&(v.current?.setInputValue(""),v.current?.focus())},dangerouslySetInnerHTML:{__html:ig}})]})}));var gv=G(ie(),1);function r8({isAtBottom:e,scrollToBottom:t,streaming:n}){return e?null:(0,gv.jsx)("button",{type:"button",className:n?"shiny-chat-scroll-to-bottom streaming":"shiny-chat-scroll-to-bottom",title:"Scroll to bottom","aria-label":"Scroll to bottom",onClick:()=>t(),children:(0,gv.jsx)("span",{dangerouslySetInnerHTML:{__html:Ru}})})}var lc=G(fe(),1),Ln=G(ie(),1);function i8({url:e,onProceed:t,onAlways:n,onCancel:r}){let i=(0,lc.useRef)(null),o=(0,lc.useRef)(t);o.current=t;let s=(0,lc.useRef)(r);return s.current=r,(0,lc.useEffect)(()=>{let a=i.current;if(!a)return;try{a.showModal()}catch{o.current()}let l=c=>{c.target===a&&s.current()},u=()=>{s.current()};return a.addEventListener("click",l),a.addEventListener("cancel",u),()=>{a.removeEventListener("click",l),a.removeEventListener("cancel",u)}},[]),(0,Ln.jsx)("dialog",{ref:i,className:"shiny-chat-external-link-dialog",children:(0,Ln.jsx)("div",{className:"modal position-relative d-block fade show",children:(0,Ln.jsxs)("div",{className:"modal-content",children:[(0,Ln.jsxs)("div",{className:"modal-header",children:[(0,Ln.jsx)("h5",{className:"modal-title",children:"External Link"}),(0,Ln.jsx)("button",{className:"btn-close shiny-chat-btn-close","data-bs-dismiss":"modal","aria-label":"Close",onClick:r})]}),(0,Ln.jsxs)("div",{className:"modal-body",children:[(0,Ln.jsx)("p",{children:"This link will take you to an external website:"}),(0,Ln.jsx)("p",{className:"link-url text-break",children:e})]}),(0,Ln.jsxs)("div",{className:"modal-footer flex-wrap-reverse",children:[(0,Ln.jsx)("button",{className:"btn btn-sm btn-link shiny-chat-btn-always ps-0 me-auto",onClick:n,children:"Always open external links"}),(0,Ln.jsxs)("div",{className:"d-flex gap-2 justify-content-end",children:[(0,Ln.jsx)("button",{autoFocus:!0,className:"btn btn-sm btn-primary shiny-chat-btn-proceed",onClick:t,children:"Open Link"}),(0,Ln.jsx)("button",{className:"btn btn-sm btn-outline-danger shiny-chat-btn-cancel",onClick:r,children:"Cancel"})]})]})]})})})}var uc=G(fe(),1);var s8=G(ie(),1);function o8({source:e,className:t}){let n=(0,uc.useRef)(null),r=(0,uc.useContext)(ds);return(0,uc.useEffect)(()=>{let i=n.current;if(i){for(r&&r.unbindAll(e);e.firstChild;)i.appendChild(e.firstChild);return r&&r.bindAll(i),()=>{for(r&&r.unbindAll(i);i.firstChild;)e.appendChild(i.firstChild)}}},[e,r]),(0,s8.jsx)("div",{ref:n,className:t})}var lt=G(fe(),1);var ce=G(ie(),1),Fie=300;function a8({isOpen:e,onClose:t,triggerRef:n,conversations:r,activeId:i,busy:o,onSelect:s,onNew:a,onRename:l,onDelete:u}){let[c,f]=(0,lt.useState)(e),[d,p]=(0,lt.useState)(!1),h=(0,lt.useRef)(e);h.current=c;let g=Ku(),[y,b]=(0,lt.useState)(""),[E,T]=(0,lt.useState)(null),[S,v]=(0,lt.useState)(null),[x,R]=(0,lt.useState)(null),O=(0,lt.useRef)(null),B=(0,lt.useRef)(null),C=(0,lt.useCallback)(()=>{b(""),T(null),v(null),R(null),t()},[t]),V=(0,lt.useCallback)(()=>{f(!1),p(!1),n.current?.focus({preventScroll:!0})},[n]);(0,lt.useEffect)(()=>{e?(f(!0),p(!1)):h.current&&p(!0)},[e]),(0,lt.useEffect)(()=>{if(!d)return;if(g){V();return}let P=setTimeout(V,Fie);return()=>clearTimeout(P)},[d,g,V]),(0,lt.useEffect)(()=>{if(!c||d)return;let P=O.current;if(!P)return;let D=U=>{if(U.key==="Escape"){if(x){R(null);return}if(E){T(null);return}C();return}if(U.key==="Tab"){let _=P.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(_.length===0)return;let te=_[0],ne=_[_.length-1],A=document.activeElement===P;U.shiftKey&&(document.activeElement===te||A)?(U.preventDefault(),ne.focus()):!U.shiftKey&&document.activeElement===ne&&(U.preventDefault(),te.focus())}};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[c,d,x,E,C]),(0,lt.useEffect)(()=>{c&&!d&&O.current?.focus({preventScroll:!0})},[c,d]),(0,lt.useEffect)(()=>{if(!E)return;let P=D=>{D.target.closest(`[data-menu-id="${E}"]`)||T(null)};return document.addEventListener("pointerdown",P,!0),()=>document.removeEventListener("pointerdown",P,!0)},[E]);let Y=(0,lt.useMemo)(()=>{let P=y.trim().toLowerCase();return P?r.filter(D=>D.title.toLowerCase().includes(P)):r},[r,y]),q=(0,lt.useMemo)(()=>zie(Y),[Y]);function L(P){P.target===P.currentTarget&&d&&V()}function H(P){o||(s(P),C())}function I(){o||(a(),C())}return c?(0,ce.jsxs)("div",{ref:O,className:"shiny-chat-history","data-closing":d||void 0,role:"dialog","aria-modal":"true","aria-label":"Conversation history",tabIndex:-1,children:[(0,ce.jsx)("div",{className:"shiny-chat-history-scrim",onClick:C}),(0,ce.jsxs)("div",{className:"shiny-chat-history-drawer",onAnimationEnd:L,children:[(0,ce.jsxs)("div",{className:"shiny-chat-history-header",children:[(0,ce.jsx)("h2",{className:"shiny-chat-history-title",children:"History"}),(0,ce.jsx)("button",{type:"button",className:"shiny-chat-history-close","aria-label":"Close history",onClick:C,children:(0,ce.jsx)(u8,{})})]}),(0,ce.jsxs)("div",{className:"shiny-chat-history-toprow",children:[(0,ce.jsxs)("button",{type:"button",className:"shiny-chat-history-new",disabled:o,title:o?"Wait for the response to finish":void 0,"aria-label":"New conversation",onClick:I,children:[(0,ce.jsx)(Vie,{}),"New"]}),(0,ce.jsxs)("span",{className:"shiny-chat-history-search-wrap",children:[(0,ce.jsx)("span",{className:"shiny-chat-history-search-icon",children:(0,ce.jsx)(Gie,{})}),(0,ce.jsx)("input",{className:"shiny-chat-history-search form-control",ref:B,placeholder:"Search\u2026",value:y,onChange:P=>b(P.target.value),"aria-label":"Search conversations"})]})]}),(0,ce.jsxs)("div",{className:"shiny-chat-history-list",children:[Y.length===0&&(0,ce.jsx)("div",{className:"shiny-chat-history-empty",children:y.trim()?"No conversations found":"No conversations yet"}),q.map(([P,D])=>(0,ce.jsxs)(lt.default.Fragment,{children:[(0,ce.jsx)("div",{className:"shiny-chat-history-section",children:P}),D.map(U=>(0,ce.jsx)(Hie,{meta:U,active:U.id===i,busy:o,menuOpen:E===U.id,renaming:S===U.id,confirmingDelete:x===U.id,onToggleMenu:()=>T(E===U.id?null:U.id),onStartRename:()=>{v(U.id),T(null)},onStartDelete:()=>{R(U.id),T(null)},onCancelEdit:()=>{v(null),R(null)},onRename:_=>{l(U.id,_),v(null)},onDelete:()=>{u(U.id),R(null)},onSelect:()=>H(U.id)},U.id))]},P))]})]})]}):null}function Hie({meta:e,active:t,busy:n,menuOpen:r,renaming:i,confirmingDelete:o,onToggleMenu:s,onStartRename:a,onStartDelete:l,onCancelEdit:u,onRename:c,onDelete:f,onSelect:d}){let[p,h]=(0,lt.useState)(e.title);return(0,lt.useEffect)(()=>{i||h(e.title)},[e.title,i]),i?(0,ce.jsx)("div",{className:"shiny-chat-history-item",children:(0,ce.jsx)("input",{className:"shiny-chat-history-rename-input form-control form-control-sm",autoFocus:!0,value:p,onChange:g=>h(g.target.value),onKeyDown:g=>{if(g.key==="Enter"){if(!p.trim())return;c(p);return}g.key==="Escape"&&(g.stopPropagation(),u())},onBlur:u,"aria-label":"Rename conversation"})}):(0,ce.jsxs)("div",{className:`shiny-chat-history-item${t?" active":""}`,children:[(0,ce.jsxs)("button",{type:"button",className:"shiny-chat-history-item-select",disabled:n,title:n?"Wait for the response to finish":void 0,onClick:d,children:[(0,ce.jsx)("span",{className:"shiny-chat-history-item-title",children:e.title}),(0,ce.jsx)("span",{className:"shiny-chat-history-item-time",children:qie(e.updated_at)})]}),o?(0,ce.jsxs)("span",{className:"shiny-chat-history-confirm",children:["Delete?",(0,ce.jsx)("button",{type:"button",className:"shiny-chat-history-confirm-yes",onClick:f,"aria-label":"Confirm delete",children:(0,ce.jsx)(Kie,{})}),(0,ce.jsx)("button",{type:"button",className:"shiny-chat-history-confirm-no",onClick:u,"aria-label":"Cancel delete",children:(0,ce.jsx)(u8,{})})]}):(0,ce.jsxs)("span",{className:"shiny-chat-history-itemmenu","data-menu-id":e.id,children:[(0,ce.jsx)("button",{type:"button","aria-label":"Conversation actions",onClick:s,children:(0,ce.jsx)(Yie,{})}),r&&(0,ce.jsxs)("span",{className:"shiny-chat-history-menu",children:[(0,ce.jsxs)("button",{type:"button",onClick:a,children:[(0,ce.jsx)($ie,{}),"Rename"]}),(0,ce.jsxs)("button",{type:"button",className:"shiny-chat-history-menu-danger",disabled:n,title:n?"Wait for the response to finish":void 0,onClick:l,children:[(0,ce.jsx)(Wie,{}),"Delete"]})]})]})]})}function zie(e){let t=new Date;t.setHours(0,0,0,0);let n=new Date(t);n.setDate(n.getDate()-7);let r=[],i=[],o=[];for(let a of e){let l=new Date(a.updated_at);l>=t?r.push(a):l>=n?i.push(a):o.push(a)}let s=[];return r.length&&s.push(["Today",r]),i.length&&s.push(["Last 7 days",i]),o.length&&s.push(["Previous",o]),s}function qie(e){let t=new Date(e),n=new Date;return n.setHours(0,0,0,0),t>=n?t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function l8(){return(0,ce.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[(0,ce.jsx)("path",{d:"M2.5 3v3h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ce.jsx)("path",{d:"M2.75 6A5.5 5.5 0 1 1 3 9.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ce.jsx)("path",{d:"M8 5v3.2l2.2 1.3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Vie(){return(0,ce.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[(0,ce.jsx)("path",{d:"M8 2.5H3.5A1.5 1.5 0 0 0 2 4v8.5A1.5 1.5 0 0 0 3.5 14H12a1.5 1.5 0 0 0 1.5-1.5V8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ce.jsx)("path",{d:"M11.7 2.3a1.2 1.2 0 0 1 1.7 1.7L8 9.4l-2.3.6.6-2.3 5.4-5.4z",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Gie(){return(0,ce.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[(0,ce.jsx)("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,ce.jsx)("path",{d:"m10.5 10.5 3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function u8(){return(0,ce.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,ce.jsx)("path",{d:"m4 4 8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function Kie(){return(0,ce.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,ce.jsx)("path",{d:"m3.5 8.5 3 3 6-7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Yie(){return(0,ce.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[(0,ce.jsx)("circle",{cx:"3.5",cy:"8",r:"1.35"}),(0,ce.jsx)("circle",{cx:"8",cy:"8",r:"1.35"}),(0,ce.jsx)("circle",{cx:"12.5",cy:"8",r:"1.35"})]})}function $ie(){return(0,ce.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[(0,ce.jsx)("path",{d:"M11.7 2.3a1.2 1.2 0 0 1 1.7 1.7l-8 8-2.8.9.9-2.8 8.2-8.2z",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ce.jsx)("path",{d:"m10.5 3.5 2 2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function Wie(){return(0,ce.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,ce.jsx)("path",{d:"M3 4.5h10M6.5 4.5V3a.8.8 0 0 1 .8-.8h1.4a.8.8 0 0 1 .8.8v1.5M4.5 4.5l.5 8a1 1 0 0 0 1 .95h4a1 1 0 0 0 1-.95l.5-8M6.75 7v3.75M9.25 7v3.75",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}var c8=G(fe(),1);function f8(e){(0,c8.useEffect)(()=>{let t=e.current?.closest("shiny-chat-container");if(!t?.hasAttribute("fill")||!t.classList.contains("html-fill-item"))return;let n=null,r="",i=t;for(;i.parentElement instanceof HTMLElement&&i.parentElement.classList.contains("html-fill-container")&&i.parentElement.children.length===1;){i=i.parentElement;let s=getComputedStyle(i).paddingLeft;if(parseFloat(s)>0){n=i,r=s;break}}if(!n)return;let o=n.style.padding;return n.style.padding="0",t.style.setProperty("--shiny-chat-fill-padding",r),()=>{n.style.padding=o,t.style.removeProperty("--shiny-chat-fill-padding")}},[e])}var $0=G(fe(),1);function d8(e,t){let n=(0,$0.useRef)(t);n.current=t;let{enabled:r=!0,boundarySelector:i}=t;(0,$0.useEffect)(()=>{if(!r)return;let o=e.current;if(!o)return;let s=o.closest(i);if(!s)return;let a=()=>{let{shiftProperty:p,side:h,gap:g=8,maxShiftFraction:y=1/3,shouldSkip:b}=n.current;if(b?.(s))return;let E=(typeof h=="function"?h(s):h)==="right";o.style.setProperty(p,"0px");let T=o.getBoundingClientRect();if(T.width===0||T.height===0)return;let S=E?T.right-1:T.left+1,v=[T.top+2,T.top+T.height/2,T.bottom-2],x=null;for(let B of v){let C=document.elementsFromPoint(S,B).find(q=>!s.contains(q)&&!q.contains(s));if(!C)continue;let V=C.getBoundingClientRect(),Y=E?V.left:V.right;x=x===null?Y:E?Math.min(x,Y):Math.max(x,Y)}if(x===null)return;let R=E?T.right-x+g:x-T.left+g;if(R<=0)return;let O=s.clientWidth*y;o.style.setProperty(p,`${Math.min(R,O)}px`)};a();let l=new ResizeObserver(a);l.observe(s),window.addEventListener("resize",a);let u=s.closest(".bslib-sidebar-layout");u?.addEventListener("transitionend",a);let c=u?new MutationObserver(a):null;c?.observe(u,{attributes:!0,attributeFilter:["class"]});let{watchMutations:f}=n.current,d=f?new MutationObserver(a):null;return d?.observe(s,f),()=>{l.disconnect(),window.removeEventListener("resize",a),u?.removeEventListener("transitionend",a),c?.disconnect(),d?.disconnect()}},[r,i,e])}var un=G(ie(),1);function bv(e){window.open(e,"_blank","noopener,noreferrer")}var h8=(0,nt.forwardRef)(function({transport:t,messages:n,streamingMessage:r,inputDisabled:i,inputPlaceholder:o,iconAssistant:s,inputId:a,uploadAccept:l,maxUploadSize:u,elementId:c,greeting:f,cancelId:d,enableCancel:p,enableUpload:h,cancelRequested:g,footerEl:y,slashCommands:b,slashCommandId:E,submitKey:T,historyEnabled:S,historyConversations:v,historyActiveId:x,onEdit:R,onNavigate:O,siblingNavigationPending:B},C){let V=(0,nt.useMemo)(()=>n.filter(w=>w.role==="user").map(w=>w.content),[n]),Y=(0,nt.useMemo)(()=>r?[...n,r]:n,[n,r]),q=(0,nt.useRef)(null),[L,H]=(0,nt.useState)(!1),I=(0,nt.useRef)(null),[P,D]=(0,nt.useState)(null),U=(0,nt.useRef)(null);U.current=P;let{scrollRef:_,contentRef:te,scrollToBottom:ne,stopScroll:A}=Ph({resize:"smooth"}),re=(0,nt.useRef)(null),se=(0,nt.useRef)(null),xe=(0,nt.useCallback)(w=>{re.current=w,se.current===null&&te(w)},[te]),[Ve,de]=(0,nt.useState)(!0);(0,nt.useEffect)(()=>{let w=_.current;if(!w)return;let F=()=>{let Ke=w.scrollHeight-w.scrollTop-w.clientHeight;de(Ke<=1)};F(),w.addEventListener("scroll",F,{passive:!0});let $=new ResizeObserver(F);$.observe(w);let oe=()=>{Array.from(w.children).forEach(Ke=>$.observe(Ke))};oe();let be=new MutationObserver(()=>{oe(),F()});return be.observe(w,{childList:!0}),()=>{w.removeEventListener("scroll",F),$.disconnect(),be.disconnect()}},[_]);let ct=Dh(),Ge=!!r,rt=(0,nt.useCallback)(()=>{!p||!d||!Ge||g||(ct({type:"CANCEL_REQUESTED"}),t.sendCancel(d))},[p,d,Ge,g,ct,t]),he=(0,nt.useRef)(rt);he.current=rt,(0,nt.useEffect)(()=>{if(!p)return;let w=_.current?.closest("shiny-chat-container");if(!w)return;let F=$=>{$.defaultPrevented||$.key==="Escape"&&he.current()};return w.addEventListener("keydown",F),()=>w.removeEventListener("keydown",F)},[p,_]),f8(_),d8(I,{enabled:S,boundarySelector:"shiny-chat-container",shiftProperty:"--_history-trigger-shift",side:w=>w.getAttribute("data-history-placement")==="right"?"right":"left",shouldSkip:w=>!!w.querySelector(":scope > .shiny-chat-history"),watchMutations:{childList:!0}}),(0,nt.useImperativeHandle)(C,()=>({setInputValue(...w){q.current?.setInputValue(...w)},focus(){q.current?.focus()},beginSiblingNavigation(){let w=_.current;w&&(se.current=w.scrollTop,te(null),A())},endSiblingNavigation(){let w=se.current;w!==null&&requestAnimationFrame(()=>{let F=re.current,$=_.current;!F||!$||(te(F),A(),$.scrollTop=w,se.current=null)})}}));let Ce=(0,nt.useCallback)(w=>{let $=w.target.closest("a[data-shinychat-link]");if(!$||!$.href)return;if(w.preventDefault(),$.origin===window.location.origin||window.shinychat_always_open_external_links){bv($.href);return}if(typeof window.HTMLDialogElement>"u"){bv($.href);return}D($.href)},[]);function Ae(w){if(!(w instanceof HTMLElement))return{};let F=w.closest(".suggestion, [data-suggestion]");return F instanceof HTMLElement?F.classList.contains("suggestion")||F.dataset.suggestion!==void 0?{suggestion:F.dataset.suggestion||F.textContent||void 0,submit:F.classList.contains("submit")||F.dataset.suggestionSubmit===""||F.dataset.suggestionSubmit==="true"}:{}:{}}function Ne(w){let{suggestion:F,submit:$}=Ae(w.target);if(!F)return;w.preventDefault();let oe=w.metaKey||w.ctrlKey?!0:w.altKey?!1:$;q.current?.setInputValue(F,{submit:oe,focus:!oe});let be=w.target.closest(".shiny-chat-suggestion-list-item"),Ke=be?.closest(".shiny-chat-suggestion-list");be&&Ke&&(Ke.querySelectorAll("[data-last-clicked]").forEach(jn=>jn.removeAttribute("data-last-clicked")),be.setAttribute("data-last-clicked",""))}function me(w){Ne(w)}function we(w){Ce(w),me(w)}function ue(w){let F=w.target.closest(".shiny-chat-suggestion-list-item");if(!F)return;let $=F.closest(".shiny-chat-suggestion-list");!$||$.dataset.roved!==void 0||($.dataset.roved="",$.querySelectorAll(".shiny-chat-suggestion-list-item").forEach(oe=>{oe!==F&&(oe.tabIndex=-1)}))}function St(w){let F=w.target.closest(".shiny-chat-suggestion-list-item");if(!F)return;let $=F.closest(".shiny-chat-suggestion-list");if(!$)return;let oe=w.relatedTarget,be=oe?.closest(".shiny-chat-suggestion-list");(!oe||be!==$)&&delete $.dataset.roved}function Ie(w,F,$){switch($){case"ArrowDown":case"ArrowRight":return(w+1)%F;case"ArrowUp":case"ArrowLeft":return(w-1+F)%F;case"Home":return 0;case"End":return F-1;default:return null}}function j(w){let $=w.target.closest(".shiny-chat-suggestion-list-item"),oe=$?.closest(".shiny-chat-suggestion-list");if($&&oe){let Ke=Array.from(oe.querySelectorAll(".shiny-chat-suggestion-list-item")),jn=Ke.indexOf($),Xn=Ie(jn,Ke.length,w.key);if(Xn!==null){w.preventDefault();let Vs=Ke[jn],Po=Ke[Xn];Vs.tabIndex=-1,Po.tabIndex=0,Po.focus();return}}(w.key==="Enter"||w.key===" ")&&Ne(w)}let Se=(0,nt.useCallback)(()=>{let w=U.current;w&&bv(w),D(null)},[]),Xe=(0,nt.useCallback)(()=>{window.shinychat_always_open_external_links=!0,Se()},[Se]),wt=(0,nt.useCallback)(()=>{D(null)},[]),xt=(0,nt.useCallback)(()=>{ne()},[ne]);return(0,un.jsxs)(XE.Provider,{value:b,children:[S&&(0,un.jsx)("button",{type:"button",ref:I,className:"shiny-chat-history-trigger","aria-label":"Conversation history","aria-expanded":L,onClick:()=>H(w=>!w),children:(0,un.jsx)(l8,{})}),(0,un.jsxs)("div",{className:"shiny-chat-wrapper",children:[(0,un.jsxs)("div",{className:"shiny-chat-messages-wrapper",children:[(0,un.jsx)("div",{className:"shiny-chat-messages",ref:_,onClick:we,onFocus:ue,onBlur:St,onKeyDown:j,children:(0,un.jsxs)(YE.Provider,{value:A,children:[f!=null&&(0,un.jsx)(t8,{greeting:f}),(0,un.jsx)("div",{className:"shiny-chat-messages-content",ref:xe,role:"log","aria-live":"polite",...f?.status==="dismissing"?{"data-greeting-dismissing":""}:{},children:(0,un.jsx)(e8,{messages:Y,iconAssistant:s,onEdit:S?R:void 0,onNavigate:S?O:void 0,siblingNavigationPending:B,disabled:Ge,inputId:a,submitKey:T,uploadAccept:l,maxUploadSize:u,enableUpload:h})})]})}),(0,un.jsx)(r8,{isAtBottom:Ve,scrollToBottom:ne,streaming:!!r||!!f?.streaming})]}),(0,un.jsx)("div",{className:i?"shiny-chat-input disabled":"shiny-chat-input",onClick:Ce,children:(0,un.jsx)(n8,{ref:q,transport:t,inputId:a,uploadAccept:l,maxUploadSize:u,disabled:i,hasTopShadow:!Ve,placeholder:o,onSend:xt,userMessages:V,enableCancel:p,enableUpload:h,cancelRequested:g,isStreaming:Ge,onCancel:rt,slashCommands:b,slashCommandId:E,submitKey:T})}),y&&(0,un.jsx)(o8,{source:y,className:"shiny-chat-footer"})]}),S&&(0,un.jsx)(a8,{isOpen:L,onClose:()=>H(!1),triggerRef:I,conversations:v??[],activeId:x??null,busy:Ge,onSelect:w=>{t.sendHistorySelect(c,w)},onNew:()=>t.sendHistoryNew(c),onRename:(w,F)=>t.sendHistoryRename(c,w,F),onDelete:w=>t.sendHistoryDelete(c,w)}),P&&(0,p8.createPortal)((0,un.jsx)(i8,{url:P,onProceed:Se,onAlways:Xe,onCancel:wt}),document.body)]})});var qs=G(ie(),1);function jie(e,t){let r=!(e.options.persistent===!0)&&t>0?"dismissed":"visible";return{content:e.content,contentType:e.contentType,streaming:!1,status:r,options:e.options,blocks:[{type:"content",content:e.content,contentType:e.contentType}]}}function yv({transport:e,shinyLifecycle:t,elementId:n,iconAssistant:r,inputId:i,cancelId:o,uploadAccept:s=[],maxUploadSize:a=null,placeholder:l,initialMessages:u,initialGreeting:c,enableCancel:f,enableUpload:d,asideFavicon:p=!0,toolGrouping:h,footerEl:g,slashCommandId:y="",submitKey:b}){let E=h??uo.toolGrouping,T=(0,ut.useMemo)(()=>(u??[]).map(A=>{let re=A.blocks.flatMap(xe=>xe.type==="content"?Mh(xe.content,xe.contentType):[xe]),se=lo(re,E,A.role);return{...A,blocks:se,content:pf(se)}}),[u,E]),[S,v]=(0,ut.useReducer)(NR,{...uo,inputPlaceholder:l??uo.inputPlaceholder,messages:T,greeting:c?jie(c,T.length):null,enableCancel:f??uo.enableCancel,enableCancelExplicit:f!==void 0,enableUpload:d??uo.enableUpload,enableUploadExplicit:d!==void 0,toolGrouping:E});(0,ut.useEffect)(()=>{v({type:"SET_TOOL_GROUPING",grouping:E})},[E]);let x=(0,ut.useRef)(S);x.current=S;let R=(0,ut.useCallback)(()=>{e.sendMessagesSnapshot(n,KE(x.current))},[e,n]);(0,ut.useEffect)(()=>{R()},[S.messages,R]);let O=(0,ut.useCallback)((A,re)=>{v({type:"INPUT_SENT",content:A,role:"user",...re.length>0?{attachments:re}:{}});let se=KE(x.current);se.push({role:"user",segments:[{content:A,content_type:"markdown"}],...re.length>0?{attachments:re}:{}});let xe=x.current.enableUpload;e.sendInput(i,xe?{text:A,attachments:re}:A),e.sendMessagesSnapshot(n,se)},[v,e,i,n]),B=(0,ut.useRef)(null),C=(0,ut.useRef)(!1),[V,Y]=(0,ut.useState)(!1);(0,ut.useEffect)(()=>e.onMessage(n,re=>{if(re.type==="history_navigate"){JE(n,re.active_id),IR(re.url,re.reload===!0);return}if(re.type==="update_input"){re.placeholder!==void 0&&v({type:"update_input",placeholder:re.placeholder}),re.value!==void 0||re.attachments!==void 0?B.current?.setInputValue(re.value,{submit:re.submit,focus:re.focus,attachments:re.attachments,attachmentMode:re.attachment_mode}):re.focus&&B.current?.focus();return}v(re),re.type==="history_update"&&C.current&&(C.current=!1,Y(!1),B.current?.endSiblingNavigation())}),[e,n]);let[q,L]=(0,ut.useState)(!1);(0,ut.useEffect)(()=>{if(!n)return;let A=document.getElementById(n);if(!A)return;if(typeof IntersectionObserver>"u"){L(!0);return}let re=new IntersectionObserver(se=>L(se[0]?.isIntersecting??!1),{threshold:0});return re.observe(A),()=>re.disconnect()},[n]);let H=q&&S.messages.length===0&&S.greeting===null,I=(0,ut.useRef)(!1);(0,ut.useEffect)(()=>{if(!H){I.current=!1;return}I.current||window.Shiny?.setInputValue&&(I.current=!0,window.Shiny.setInputValue(`${n}_greeting_requested`,Date.now(),{priority:"event"}))},[H,n]);let P=S.greeting?.status==="dismissed",D=(0,ut.useRef)(!1);(0,ut.useEffect)(()=>{window.Shiny?.setInputValue&&(P&&!D.current?(D.current=!0,window.Shiny.setInputValue(`${n}_greeting_dismissed`,Date.now(),{priority:"event"})):!P&&D.current&&(D.current=!1,window.Shiny.setInputValue(`${n}_greeting_dismissed`,null)))},[P,n]),(0,ut.useEffect)(()=>{S.history.enabled&&JE(n,S.history.activeId)},[n,S.history.enabled,S.history.activeId]);let U=(0,ut.useCallback)((A,re,se)=>{e.sendMessageEdit(n,A,re,se)},[e,n]),_=(0,ut.useCallback)((A,re)=>{C.current||(C.current=!0,Y(!0),B.current?.beginSiblingNavigation(),e.sendMessageNavigate(n,A,re))},[e,n]),te=LR(S.messages,S.streamingMessage),ne=(0,ut.useMemo)(()=>({supersededRequests:te}),[te]);return(0,qs.jsx)(ds.Provider,{value:t,children:(0,qs.jsx)($E.Provider,{value:ne,children:(0,qs.jsx)(WE.Provider,{value:S.toolGrouping,children:(0,qs.jsx)(hf.Provider,{value:v,children:(0,qs.jsx)(jE.Provider,{value:O,children:(0,qs.jsx)(QE.Provider,{value:p,children:(0,qs.jsx)(h8,{ref:B,transport:e,messages:S.messages,streamingMessage:S.streamingMessage,inputDisabled:S.inputDisabled,inputPlaceholder:S.inputPlaceholder,iconAssistant:r,inputId:i,uploadAccept:s,maxUploadSize:a,elementId:n,greeting:S.greeting,cancelId:o,enableCancel:S.enableCancel,enableUpload:S.enableUpload,cancelRequested:S.cancelRequested,footerEl:g,slashCommands:S.slashCommands,slashCommandId:y,submitKey:b,historyEnabled:S.history.enabled,historyConversations:S.history.conversations,historyActiveId:S.history.activeId,onEdit:U,onNavigate:_,siblingNavigationPending:V})})})})})})})}function m8(e){if(!e||typeof e!="object")return!1;let t=e;return!(typeof t.id!="string"||!t.action||typeof t.action!="object"||typeof t.action.type!="string")}function W0(){return window.__shinyChatTransport||(window.__shinyChatTransport=new Ev),window.__shinyChatTransport}var Ev=class{listeners=new Map;pendingMessages=new Map;inputSeq=0;constructor(){window.Shiny?.addCustomMessageHandler("shinyChatMessage",async t=>{if(!m8(t)){console.warn("[shinychat] Malformed shinyChatMessage envelope, dropping:",JSON.stringify(t));return}let{id:n,action:r,html_deps:i}=t;i&&Array.isArray(i)&&(await this.renderDependencies(i),(r.type==="message"||r.type==="chunk_start"||r.type==="chunk")&&(r.html_deps=i));let o=this.listeners.get(n);if(!o||o.size===0){this.pendingMessages.has(n)||this.pendingMessages.set(n,[]),this.pendingMessages.get(n).push(r);return}for(let s of o)s(r)})}sendInput(t,n){if(!window.Shiny?.setInputValue)return;let r=typeof n=="string"?{text:n,attachments:[]}:n;this.inputSeq+=1,window.Shiny.setInputValue(`${t}:shinychat.userInput`,{...r,seq:this.inputSeq})}sendCancel(t){window.Shiny?.setInputValue&&window.Shiny.setInputValue(t,Date.now(),{priority:"event"})}sendSlashCommand(t,n,r,i){window.Shiny?.setInputValue&&window.Shiny.setInputValue(t,{command:n,userText:r,echo:i},{priority:"event"})}sendMessagesSnapshot(t,n){window.Shiny?.setInputValue&&window.Shiny.setInputValue(`${t}_messages:shinychat.messages`,n)}sendHistorySelect(t,n){window.Shiny?.setInputValue&&window.Shiny.setInputValue(`${t}_history_select`,{id:n,ts:Date.now()},{priority:"event"})}sendHistoryNew(t){window.Shiny?.setInputValue&&window.Shiny.setInputValue(`${t}_history_new`,Date.now(),{priority:"event"})}sendHistoryRename(t,n,r){window.Shiny?.setInputValue&&window.Shiny.setInputValue(`${t}_history_rename`,{id:n,title:r,ts:Date.now()},{priority:"event"})}sendHistoryDelete(t,n){window.Shiny?.setInputValue&&window.Shiny.setInputValue(`${t}_history_delete`,{id:n,ts:Date.now()},{priority:"event"})}sendMessageEdit(t,n,r,i=[]){window.Shiny?.setInputValue?.(`${t}_message_edit`,{index:n,content:r,attachments:i,ts:Date.now()})}sendMessageNavigate(t,n,r){window.Shiny?.setInputValue?.(`${t}_message_navigate`,{index:n,direction:r,ts:Date.now()})}onMessage(t,n){this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n);let r=this.pendingMessages.get(t);if(r&&r.length>0){this.pendingMessages.delete(t);for(let i of r)n(i)}return()=>{this.listeners.get(t)?.delete(n)}}async renderDependencies(t){if(window.Shiny&&t)try{await window.Shiny.renderDependenciesAsync(t)}catch(n){this.showClientMessage({status:"error",message:`Failed to render HTML dependencies: ${n}`})}}async bindAll(t){if(window?.Shiny?.initializeInputs&&window?.Shiny?.bindAll){try{window.Shiny.initializeInputs(t)}catch(n){this.showClientMessage({status:"error",message:`Failed to initialize Shiny inputs: ${n}`})}try{await window.Shiny.bindAll(t)}catch(n){this.showClientMessage({status:"error",message:`Failed to bind Shiny inputs/outputs: ${n}`})}}}unbindAll(t){if(window?.Shiny?.unbindAll)try{window.Shiny.unbindAll(t)}catch(n){this.showClientMessage({status:"error",message:`Failed to unbind Shiny inputs/outputs: ${n}`})}}showClientMessage(t){document.dispatchEvent(new CustomEvent("shiny:client-message",{detail:{headline:t.headline??"",message:t.message,status:t.status??"warning"}}))}};var j0=W0(),g8="shinychat-browser-token",Tv=null;function Xie(){try{let e=window.localStorage.getItem(g8);return e||(e=crypto.randomUUID(),window.localStorage.setItem(g8,e)),e}catch{return Tv||(Tv=crypto.randomUUID()),Tv}}var Qie="shiny-chat-input",Zie="shiny-chat-message",Jie="shiny-chat-footer";function eoe(e){let t=e.querySelectorAll(Zie),n=[];return t.forEach(r=>{let i=r.getAttribute("content")??"",o=r.getAttribute("data-role")??"assistant",s=r.getAttribute("content-type")??"markdown",a=r.getAttribute("icon")??void 0;n.push({id:Yr(),role:o,content:i,streaming:!1,icon:a,blocks:[{type:"content",content:i,contentType:s}]})}),n}function toe(e){let t=e.getAttribute("greeting");if(t)try{let n=JSON.parse(t);return n.content?{content:n.content,contentType:n.content_type??"markdown",options:n.options??{}}:void 0}catch{return}}function b8(e){return e==="none"||e==="tool"||e==="all"?e:void 0}var xv=class extends HTMLElement{reactRoot=null;footerEl=null;pendingUnmount=null;appProps=null;static observedAttributes=["tool-grouping"];connectedCallback(){if(this.pendingUnmount!==null&&(clearTimeout(this.pendingUnmount),this.pendingUnmount=null),this.reactRoot)return;let t=this.getAttribute("id")??"",n=this.getAttribute("icon-assistant")??void 0,r=this.getAttribute("aside-favicon")!=="false",i=this.getAttribute("enable-cancel"),o=i===null?void 0:i!=="false",s=this.getAttribute("allow-attachments"),a=s===null?void 0:s!=="false",l=b8(this.getAttribute("tool-grouping")),u=this.querySelector(Qie),c=u?.getAttribute("placeholder")??void 0,f=u?.getAttribute("id")??`${t}_user_input`,d=`${t}_cancel`,p=this.getAttribute("attachment-accept"),h=p?p.split(",").map(R=>R.trim()):R6,g=this.getAttribute("max-attachment-size"),y=g?parseInt(g,10):NaN,b=Number.isFinite(y)?y:null,E=eoe(this);this.footerEl||(this.footerEl=this.querySelector(Jie),this.footerEl?.remove());let T=toe(this),v=this.getAttribute("submit-key")==="enter+modifier"?"enter+modifier":"enter",x=`${t}_slash_command`;j0.unbindAll(this),window.Shiny?.initializedPromise.then(()=>{window.Shiny?.setInputValue?.(`${t}_history_browser_token`,Xie()),window.Shiny?.setInputValue?.(`${t}_history_current_id`,DR(t)??""),window.Shiny?.setInputValue?.(`${t}_history_url_id`,OR()??"")}),this.appProps={transport:j0,shinyLifecycle:j0,elementId:t,iconAssistant:n,inputId:f,cancelId:d,uploadAccept:h,maxUploadSize:b,placeholder:c,initialMessages:E,initialGreeting:T,enableCancel:o,enableUpload:a,asideFavicon:r,toolGrouping:l,footerEl:this.footerEl??void 0,slashCommandId:x,submitKey:v},this.reactRoot=(0,y8.createRoot)(this),this.reactRoot.render((0,Sv.createElement)(yv,this.appProps))}attributeChangedCallback(t,n,r){t!=="tool-grouping"||!this.reactRoot||!this.appProps||(this.appProps={...this.appProps,toolGrouping:b8(r)},this.reactRoot.render((0,Sv.createElement)(yv,this.appProps)))}disconnectedCallback(){this.pendingUnmount=setTimeout(()=>{j0.unbindAll(this),this.reactRoot?.unmount(),this.reactRoot=null,this.pendingUnmount=null},0)}};customElements.get("shiny-chat-container")||customElements.define("shiny-chat-container",xv);var _8=G(Ch(),1),vv=G(fe(),1);var cn=G(fe(),1);var Wn=G(fe(),1);function E8({streaming:e,contentDependency:t,bottomTolerance:n=10,scrollOnContentChange:r=!1}){let i=(0,Wn.useRef)(null),[o,s]=(0,Wn.useState)(!0),a=(0,Wn.useRef)(0),l=(0,Wn.useCallback)(()=>{let g=i.current;if(!g)return;let{scrollTop:y,scrollHeight:b,clientHeight:E}=g,T=y+E>=b-n,S=y{u.current()}),f=(0,Wn.useCallback)(g=>{i.current&&i.current.removeEventListener("scroll",c.current),i.current=g,g&&(a.current=g.scrollTop,g.addEventListener("scroll",c.current,{passive:!0}))},[]);(0,Wn.useEffect)(()=>{(e||r)&&o&&i.current&&i.current.scrollTo({top:i.current.scrollHeight,behavior:"smooth"})},[e,o,t,r]);let d=(0,Wn.useCallback)(()=>{s(!0),i.current?.scrollTo({top:i.current.scrollHeight,behavior:"smooth"})},[]),p=(0,Wn.useCallback)(()=>{s(!0)},[]),h=(0,Wn.useCallback)(()=>{let g=i.current;if(!g)return;let{scrollTop:y,scrollHeight:b,clientHeight:E}=g;y+E>=b-n&&s(!0)},[n]);return{containerRef:f,stickToBottom:o,scrollToBottom:d,engageStickToBottom:p,repinIfAtBottom:h}}function T8(e,t){let n=e.parentElement,r=t?.toLowerCase();for(;n&&!(r&&n.tagName.toLowerCase()===r);){let i=getComputedStyle(n),o=i.overflowY!=="hidden"&&i.overflowY!=="clip",s=n.scrollHeight>n.clientHeight;if(o&&s)return n;n=n.parentElement}return null}var _v=G(ie(),1),noe="shiny-chat-container";function S8({initialContent:e="",initialContentType:t="markdown",initialStreaming:n=!1,autoScroll:r=!1,onApiReady:i}){let[o,s]=(0,cn.useState)(e),[a,l]=(0,cn.useState)(t),[u,c]=(0,cn.useState)(n),f=(0,cn.useRef)(null),d=(0,cn.useRef)(null),{containerRef:p,scrollToBottom:h,repinIfAtBottom:g}=E8({streaming:r&&u,contentDependency:o});(0,cn.useLayoutEffect)(()=>{if(!r||!f.current){d.current&&(p(null),d.current=null);return}let T=T8(f.current,noe);T!==d.current&&(p(T),d.current=T)},[r,o,p]),(0,cn.useEffect)(()=>()=>{d.current&&(p(null),d.current=null)},[p]),(0,cn.useEffect)(()=>{u&&r&&h()},[u,r,h]);let y=(0,cn.useCallback)(T=>{g(),s(S=>S+T)},[g]),b=(0,cn.useCallback)(T=>{s(T)},[]),E=(0,cn.useMemo)(()=>({appendContent:y,replaceContent:b,setStreaming:c,setContentType:l}),[y,b]);return(0,cn.useEffect)(()=>{i?.(E)},[E,i]),(0,_v.jsx)("div",{ref:f,children:(0,_v.jsx)(Kt,{content:o,contentType:a,streaming:u})})}var Cv=W0();function v8(e){return"isStreaming"in e}var Av=class extends HTMLElement{reactRoot=null;api=null;pendingMessages=[];pendingUnmount=null;connectedCallback(){if(this.pendingUnmount!==null&&(clearTimeout(this.pendingUnmount),this.pendingUnmount=null),this.reactRoot)return;this.reactRoot=(0,_8.createRoot)(this);let t=this.getAttribute("content")??"",n=this.getAttribute("content-type")??"markdown",r=x8(this,"streaming"),i=x8(this,"auto-scroll");this.reactRoot.render((0,vv.createElement)(ds.Provider,{value:Cv},(0,vv.createElement)(S8,{initialContent:t,initialContentType:n,initialStreaming:r,autoScroll:i,onApiReady:o=>{this.api=o;for(let s of this.pendingMessages)this.dispatchMessage(s);this.pendingMessages=[]}})))}disconnectedCallback(){this.pendingUnmount=setTimeout(()=>{this.reactRoot?.unmount(),this.reactRoot=null,this.api=null,this.pendingMessages=[],this.pendingUnmount=null},0)}handleMessage(t){if(!this.api){this.pendingMessages.push(t);return}this.dispatchMessage(t)}dispatchMessage(t){if(v8(t)){this.api.setStreaming(t.isStreaming);return}t.operation==="replace"?this.api.replaceContent(t.content):t.operation==="append"&&this.api.appendContent(t.content)}};function roe(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function x8(e,t){let n=e.getAttribute(t);if(n===""||n==="true")return!0;if(n==="false")return!1;let r=roe(t),i=e[r];return i===!0||i==="true"}customElements.get("shiny-markdown-stream")||customElements.define("shiny-markdown-stream",Av);window.Shiny?.addCustomMessageHandler("shinyMarkdownStreamMessage",async e=>{let t=document.getElementById(e.id);if(!t){Cv.showClientMessage({status:"error",message:`Unable to handle MarkdownStream() message since element with id ${e.id} wasn't found.`});return}!v8(e)&&e.html_deps&&await Cv.renderDependencies(e.html_deps),t.handleMessage(e)}); +`),r=[];return n.forEach((i,o)=>{o>0&&r.push({type:"hardBreak"}),i&&r.push({type:"text",text:i})}),{type:"doc",content:r}}var q0=(0,mr.forwardRef)(function({inputId:t,placeholder:n,hasTopShadow:r=!1,slashCommands:i,onHasTextChange:o,onSubmit:s,userMessages:a,submitKey:l,canSubmitEmpty:u},c){let{recall:f,reset:d,isActive:p}=W5(a),h=(0,mr.useRef)(i);h.current=i;let g=(0,mr.useRef)(n);g.current=n;let y=(0,mr.useRef)(s);y.current=s;let b=(0,mr.useRef)(o);b.current=o;let E=(0,mr.useRef)(u);E.current=u;let T=(0,mr.useRef)(d);T.current=d;let S=(0,mr.useRef)(null),v=C5({extensions:[D5.extend({content:"inline*"}),I5,L5,H5,hr.create({name:"submitShortcut",priority:200,addKeyboardShortcuts(){let x=()=>{if(pv.getState(this.editor.view.state)?.active)return!1;let C=Yd(this.editor);return(this.editor.isEmpty||C.trim().length===0)&&!E.current?.()?!1:(y.current(C)&&(this.editor.commands.clearContent(!0),b.current(!1),T.current()),!0)},O={[l==="enter+modifier"?"Mod-Enter":"Enter"]:x};return l==="enter+modifier"&&(O.Enter=()=>this.editor.commands.first(({commands:B})=>[()=>B.newlineInCode(),()=>B.setHardBreak()])),O}}),q5.configure({commands:i,suggestion:{char:"/",allowSpaces:!1,allow({range:x}){return x.from===0},items:({query:x})=>V5(h.current,x),render:()=>Y5({paletteId:`${t}-slash-palette`}),command:({editor:x,range:R,props:O})=>{x.chain().focus().deleteRange(R).insertContent([{type:"commandMention",attrs:{name:O.name}},{type:"text",text:" "}]).run()}}})],editorProps:{attributes:x=>{let R=x.doc.content.size===0;return{"aria-label":"Chat message","data-shiny-no-bind-input":"",role:"textbox","aria-multiline":"true",...h.current.length>0?{"aria-haspopup":"listbox"}:{},class:`form-control${r?" shadow":""}${R?" is-empty":""}`,...R?{"data-placeholder":g.current}:{}}},handleKeyDown:(x,R)=>{if(R.isComposing)return!1;if(R.key==="ArrowUp"||R.key==="ArrowDown"){let O=S.current;if(!O)return!1;let B=Yd(O),{$from:C}=x.state.selection,V=C.pos===x.state.doc.content.size-1;if(p()?V:B.length===0){let q=f(R.key==="ArrowUp"?"up":"down",B);if(q!==void 0)return R.preventDefault(),O.commands.setContent(hv(q,h.current)),o(q.trim().length>0),O.commands.focus("end"),!0}return!1}return!1}},onCreate:({editor:x})=>{S.current=x,o(!x.isEmpty)},onUpdate:({editor:x})=>{o(!x.isEmpty)}});return(0,mr.useEffect)(()=>{let x=v?.view?.dom;x&&(i.length>0?x.setAttribute("aria-haspopup","listbox"):x.removeAttribute("aria-haspopup"))},[v,i]),(0,mr.useImperativeHandle)(c,()=>({setInputValue(x,{submit:R=!1,focus:O=!1}={}){if(!v)return;let B=Yd(v);if(v.commands.setContent(hv(x,h.current)),o(x.trim().length>0),R){let C=Yd(v);s(C),v.commands.setContent(hv(B,h.current)),o(B.trim().length>0)}O&&(v.view.dom.focus(),v.commands.setTextSelection(v.state.doc.content.size))},focus(){v?.commands.focus("end")},serializeEditor(){return v?Yd(v):""}}),[v,s,o]),(0,j5.jsx)(ov,{editor:v,id:t})});var ht=G(fe(),1);function Die(e){return{mime:e.type,data_url:e.dataUrl,name:e.name,size:e.size}}function Iie(e){return e.map(t=>({id:Yr(),type:t.mime,family:za(t.mime)??"document",dataUrl:t.data_url,name:t.name,size:t.size}))}function V0({uploadAccept:e,maxUploadSize:t,enableUpload:n,focusEditor:r}){let[i,o]=(0,ht.useState)([]),s=(0,ht.useRef)([]);(0,ht.useEffect)(()=>{s.current=i},[i]);let[a,l]=(0,ht.useState)(!1),[u,c]=(0,ht.useState)(!1),[f,d]=(0,ht.useState)(!1),p=(0,ht.useRef)(null),h=(0,ht.useCallback)(async V=>{let Y=[];for(let I of Array.from(V)){let P=null;try{P=await z6(I,e)}catch{continue}P&&Y.push(P)}if(Y.length===0){r();return}let q=!1,L=!1,H=!1;o(I=>{let P=U6(I),D=[];for(let{file:U,wasDownscaled:_,wasConverted:te}of Y){if(t!==null&&P+U.size>t){q=!0;continue}D.push(U),P+=U.size,_&&(L=!0),te&&(H=!0)}return D.length>0?[...I,...D]:I}),q&&d(!0),L&&l(!0),H&&c(!0),r()},[e,t,r]),g=(0,ht.useCallback)(V=>{d(!1),o(Y=>{let q=Y.filter(L=>L.id!==V);return q.length===0&&(l(!1),c(!1)),q})},[]),y=(0,ht.useRef)([]),b=(0,ht.useRef)(null),E=(0,ht.useCallback)(V=>{let Y=i.length-1;b.current=Y===0?"input":Math.min(V,Y-1),g(i[V].id)},[i,g]);(0,ht.useLayoutEffect)(()=>{y.current.length=i.length;let V=b.current;V!==null&&(b.current=null,V==="input"?r():y.current[V]?.focus())},[i,r]);let T=(0,ht.useCallback)(V=>{if(!n)return;let Y=V.clipboardData;if(!Y)return;let q=[];for(let H of Array.from(Y.items))if(H.kind==="file"&&e.includes(H.type)){let I=H.getAsFile();I&&q.push(I)}if(q.length>0){V.preventDefault(),V.stopPropagation(),h(q);return}let L=Y.getData("text/plain");L.length>I6&&e.includes("text/plain")&&(V.preventDefault(),V.stopPropagation(),h([H6(L)]))},[h,n,e]),S=(0,ht.useCallback)(V=>{n&&V.dataTransfer?.files?.length&&(V.preventDefault(),V.stopPropagation(),h(V.dataTransfer.files))},[h,n]),v=(0,ht.useCallback)(V=>{V.target.files&&h(V.target.files),V.target.value=""},[h]),x=(0,ht.useCallback)(V=>{V.target===V.currentTarget&&(V.preventDefault(),r())},[r]),R=(0,ht.useCallback)(()=>s.current.map(Die),[]),O=(0,ht.useCallback)((V,Y)=>{let q=Iie(V);Y==="append"?o(L=>[...L,...q]):(o(q),l(!1),c(!1),d(!1))},[]),B=(0,ht.useCallback)(()=>o([]),[]),C=(0,ht.useCallback)(()=>{o([]),l(!1),c(!1),d(!1)},[]);return{attachments:i,downscaleNotice:a,gifConvertedNotice:u,sizeNotice:f,fileInputRef:p,attachmentRefs:y,addFiles:h,removeAttachment:g,removeAttachmentByKeyboard:E,onPaste:T,onDrop:S,onFilePick:v,onAttachmentsMouseDown:x,getPayloads:R,applyPayloads:O,clearAttachments:B,resetAll:C}}var mv=G(fe(),1);var Tt=G(ie(),1),G0=(0,mv.memo)(function({staging:t,uploadAccept:n,maxUploadSize:r,enableUpload:i,disabled:o}){let{attachments:s,downscaleNotice:a,gifConvertedNotice:l,sizeNotice:u,fileInputRef:c,attachmentRefs:f,removeAttachmentByKeyboard:d,onFilePick:p,onAttachmentsMouseDown:h}=t;return(0,Tt.jsxs)(Tt.Fragment,{children:[s.length>0&&(0,Tt.jsx)("div",{className:"shiny-chat-input-attachments",onMouseDown:h,children:s.map((g,y)=>(0,Tt.jsx)(Lie,{attachment:g,index:y,onRemove:()=>d(y),registerRef:b=>{f.current[y]=b}},g.id))}),(a||u||l)&&(0,Tt.jsxs)("div",{className:"shiny-chat-input-notice",role:"status",children:[u&&r!==null&&(0,Tt.jsxs)("div",{children:["Attachments exceed the ",pd(r)," limit."]}),a&&(0,Tt.jsx)("div",{children:"Large image(s) were downscaled to fit."}),l&&(0,Tt.jsx)("div",{children:"Animated GIF(s) were converted to a still image."})]}),i&&(0,Tt.jsxs)(Tt.Fragment,{children:[(0,Tt.jsx)("input",{ref:c,type:"file",multiple:!0,accept:M6(n),style:{display:"none"},onChange:p,"data-shiny-no-bind-input":!0}),(0,Tt.jsx)("button",{type:"button",className:"shiny-chat-btn-attach",title:"Attach file","aria-label":"Attach file",disabled:o,onClick:()=>c.current?.click(),dangerouslySetInnerHTML:{__html:bL}})]})]})}),Lie=(0,mv.memo)(function({attachment:t,index:n,onRemove:r,registerRef:i}){let o={tabIndex:0,"aria-label":t.name?`Attachment: ${t.name}. Press Delete to remove.`:"Attachment. Press Delete to remove.",onClick:s=>s.currentTarget.focus(),onKeyDown:s=>{(s.code==="Delete"||s.code==="Backspace")&&(s.preventDefault(),r())}};return t.family==="image"?(0,Tt.jsxs)("div",{ref:i,className:"shiny-chat-input-thumbnail",title:t.name||void 0,...o,children:[(0,Tt.jsx)("img",{src:t.dataUrl,alt:t.name?`Attached image: ${t.name}`:`Attached image ${n+1}`}),(0,Tt.jsx)("button",{type:"button",tabIndex:0,"aria-label":t.name?`Remove ${t.name}`:"Remove image",onClick:r,children:"\xD7"})]}):t.family==="text"?(0,Tt.jsx)(Gg,{dataUrl:t.dataUrl,name:t.name,size:t.size,onRemove:r,rootRef:i,rootProps:o}):(0,Tt.jsxs)("div",{ref:i,className:"shiny-chat-input-attachment-chip",title:t.name||void 0,...o,children:[(0,Tt.jsx)("span",{className:"shiny-chat-attachment-badge",children:qg(t.name,t.type)}),(0,Tt.jsxs)("span",{className:"shiny-chat-attachment-meta",children:[(0,Tt.jsx)("span",{className:"shiny-chat-attachment-name",children:t.name||"attachment"}),(0,Tt.jsx)("span",{className:"shiny-chat-attachment-size",children:pd(t.size)})]}),(0,Tt.jsx)("button",{type:"button",tabIndex:0,"aria-label":t.name?`Remove ${t.name}`:"Remove attachment",onClick:r,children:"\xD7"})]})});var $d=G(fe(),1);var Ft=G(ie(),1),Pie=3;function X5({url:e,deriveFavicon:t}){let n=Sx(e),[r,i]=(0,$d.useState)(!1);return!t||!n||r?(0,Ft.jsx)("span",{className:"shiny-sources-favicon shiny-sources-favicon--blank","aria-hidden":"true"}):(0,Ft.jsx)("img",{className:"shiny-sources-favicon",src:n,alt:"",onError:()=>i(!0)})}function Bie({sources:e}){let[t,n]=(0,$d.useState)(!1),r=ou(),{refs:i,floatingStyles:o,context:s,getReferenceProps:a,getFloatingProps:l}=Bg(t,n),u=Pg(i.domReference.current);if(e.length===0)return null;let c=`Sources, ${e.length} ${e.length===1?"source":"sources"}`;return(0,Ft.jsxs)("div",{className:"shiny-sources",children:[(0,Ft.jsxs)("button",{ref:i.setReference,type:"button",className:"shiny-sources-pill","aria-label":c,...a(),children:[r&&(0,Ft.jsx)("span",{className:"shiny-sources-pill__stack",children:e.slice(0,Pie).map(f=>(0,Ft.jsx)(X5,{url:f.url,deriveFavicon:r},f.url))}),(0,Ft.jsx)("span",{className:"shiny-sources-pill__label",children:"Sources"})]}),t&&(0,Ft.jsx)(Ig,{children:(0,Ft.jsx)(Lg,{context:s,modal:!1,initialFocus:-1,returnFocus:!0,children:(0,Ft.jsxs)("div",{ref:i.setFloating,className:"shiny-sources-popover",style:{...u.style,...o},"data-bs-theme":u.theme,"aria-label":c,...l(),children:[(0,Ft.jsx)("div",{className:"shiny-sources-popover__title",children:"Sources"}),(0,Ft.jsx)("ul",{className:"shiny-sources-list",children:e.map(f=>(0,Ft.jsx)("li",{className:"shiny-sources-item",children:(0,Ft.jsxs)("a",{className:"shiny-sources-item__link",href:f.url,...Ni,children:[(0,Ft.jsx)(X5,{url:f.url,deriveFavicon:r}),(0,Ft.jsxs)("span",{className:"shiny-sources-item__text",children:[f.domain&&(0,Ft.jsx)("span",{className:"shiny-sources-item__site",children:f.domain}),(0,Ft.jsx)("span",{className:"shiny-sources-item__title",children:f.title??f.domain??f.url})]})]})},f.url))})]})})})]})}var Q5=(0,$d.memo)(function(){return(0,Ft.jsx)(Bie,{sources:n6()})});var De=G(ie(),1),Uie=500,Fie=10;function Hie(e,t){if(!e.startsWith("/"))return null;let n=e.slice(1),r=n.indexOf(" "),i=r===-1?n:n.slice(0,r),o=r===-1?"":n.slice(r+1).trim();return t.find(a=>a.name===i)?{commandName:i,remainingText:o}:null}var Z5=(0,tt.memo)(function({message:t,index:n,iconAssistant:r,onEdit:i,onNavigate:o,siblingNavigationPending:s=!1,disabled:a,inputId:l,submitKey:u="enter",isEditing:c=!1,onStartEdit:f,onCancelEdit:d,uploadAccept:p=[],maxUploadSize:h=null,enableUpload:g}){let y=MR(),b=RR(),{supersededRequests:E}=Oh(),[T,S]=(0,tt.useState)(null),[v,x]=(0,tt.useState)(!1),R=(0,tt.useRef)(null),O=t.role==="user",B=(0,tt.useMemo)(()=>t.streaming?lo(t.blocks,b,t.role,!0):t.blocks,[t.streaming,t.blocks,t.role,b]),C=O?void 0:Gu,V=(0,tt.useMemo)(()=>{let j=[];return B.forEach((Se,Xe)=>{if(Se.type!=="tool_loop"){j.push({block:Se,index:Xe});return}let wt=Se.groups.map(xt=>{let w=xt.calls.filter(F=>!(F.status==="running"&&E.has(F.requestId)));return w.length===xt.calls.length?xt:{...xt,calls:w,...iu(w)}}).filter(xt=>xt.calls.length>0);wt.length>0&&j.push({block:{...Se,groups:wt},index:Xe})}),j},[B,E]),Y=O&&!!i&&!a&&!c,[q,L]=(0,tt.useState)(!1),H=(0,tt.useRef)(null),I=(0,tt.useRef)(null),P=(0,tt.useRef)(!1),D=(0,tt.useRef)(null),U=(0,tt.useCallback)(()=>R.current?.focus(),[]),_=V0({uploadAccept:p,maxUploadSize:h,enableUpload:g,focusEditor:U}),{applyPayloads:te,getPayloads:ne,onPaste:A,onDrop:re}=_,se=(0,tt.useRef)(!1);(0,tt.useEffect)(()=>{c&&!se.current&&(R.current?.setInputValue(t.content,{focus:!0}),te(t.attachments??[],"set")),se.current=c},[c,t.content,t.attachments,te]);let xe=(0,tt.useCallback)(j=>a?!1:(i?.(n,j,ne()),d?.(),!0),[i,d,n,a,ne]),Ve=(0,tt.useCallback)(()=>ne().length>0,[ne]),de=(0,tt.useCallback)(()=>{H.current!==null&&(clearTimeout(H.current),H.current=null)},[]),ct=(0,tt.useCallback)(j=>{j.pointerType==="touch"&&(I.current={x:j.clientX,y:j.clientY},P.current=!1,de(),H.current=setTimeout(()=>{H.current=null,P.current=!0,L(!0)},Uie))},[de]),Ge=(0,tt.useCallback)(j=>{let Se=I.current;if(!Se)return;Math.hypot(j.clientX-Se.x,j.clientY-Se.y)>Fie&&(I.current=null,de())},[de]),rt=(0,tt.useCallback)(j=>{let Se=I.current!==null;I.current=null,de(),Se&&P.current&&j.preventDefault()},[de]),he=(0,tt.useCallback)(()=>{I.current=null,de()},[de]),Ce=(0,tt.useCallback)(j=>{(I.current!==null||P.current)&&j.preventDefault()},[]);(0,tt.useEffect)(()=>{if(!q)return;let j=Se=>{D.current?.contains(Se.target)||L(!1)};return document.addEventListener("pointerdown",j,!0),()=>document.removeEventListener("pointerdown",j,!0)},[q]);let Ae=t.content.trim()!==""||V.some(({block:j})=>j.type==="thinking"||j.type==="tool_loop")||(t.attachments?.length??0)>0||t.cancelled,Ne;if(O)Ne=t.icon||void 0;else{let j=t.icon??r;j===""?Ne=void 0:Ne=Ae?j??hL:mL}if(!Ae&&!t.streaming&&!t.isPlaceholder)return null;let me=O?Hie(t.content,y):null,we=O?"shiny-chat-user-message":"shiny-chat-message",ue=t.attachments&&t.attachments.length>0?(0,De.jsx)("div",{className:"shiny-chat-message-attachments",children:t.attachments.map((j,Se)=>{if(j.mime.startsWith("image/")){let Xe=j.name?`Attached image: ${j.name}`:`Attached image ${Se+1}`;return(0,De.jsx)("button",{type:"button",className:"shiny-chat-message-image-btn",title:j.name||void 0,"aria-label":j.name?`View ${j.name}`:`View attached image ${Se+1}`,onClick:()=>S({src:j.data_url,name:j.name,mime:j.mime}),children:(0,De.jsx)("img",{className:"shiny-chat-message-image",src:j.data_url,alt:Xe})},Se)}return za(j.mime)==="text"?(0,De.jsx)(Gg,{dataUrl:j.data_url,name:j.name,size:zg(j.data_url),onActivate:()=>S({src:j.data_url,name:j.name,mime:j.mime})},Se):(0,De.jsxs)("button",{type:"button",className:"shiny-chat-message-attachment-chip",title:j.name||void 0,"aria-label":`View ${j.name||"attachment"}`,onClick:()=>S({src:j.data_url,name:j.name,mime:j.mime}),children:[(0,De.jsx)("span",{className:"shiny-chat-attachment-badge",children:qg(j.name,j.mime)}),(0,De.jsx)("span",{className:"shiny-chat-attachment-name",children:j.name||"attachment"})]},Se)})}):null,St=V.map(({block:j,index:Se})=>{if(j.type==="thinking")return(0,De.jsx)(f6,{thinking:j,messageId:`${t.id}-${Se}`},Se);let Xe=Se===B.length-1;if(j.type==="tool_loop")return(0,De.jsx)("div",{className:"shiny-chat-tool-loop",children:j.groups.map(xt=>(0,De.jsx)(C6,{group:xt},xt.key))},Se);if(me&&Se===0){let xt=(0,De.jsx)(A6,{name:me.commandName}),w=me.remainingText||"";return j.contentType==="text"?(0,De.jsxs)("div",{className:"content-type-text",children:[xt,w&&` ${w}`]},Se):w?(0,De.jsx)(Kt,{content:w,contentType:j.contentType,role:t.role,streaming:t.streaming&&Xe,tagToComponentMap:C,prefix:xt},Se):(0,De.jsx)("p",{children:xt},Se)}let wt=(0,De.jsx)(Kt,{content:j.content,contentType:j.contentType,role:t.role,streaming:t.streaming&&Xe,tagToComponentMap:C},Se);return j.contentType==="text"?(0,De.jsx)("div",{className:"content-type-text",children:wt},Se):wt}),Ie=T&&(0,De.jsx)(G6,{src:T.src,name:T.name,mime:T.mime,onClose:()=>S(null)});return(0,De.jsxs)("div",{ref:D,className:we,"data-touch-revealed":q||void 0,onPointerDown:Y?ct:void 0,onPointerMove:Y?Ge:void 0,onPointerUp:Y?rt:void 0,onPointerCancel:Y?he:void 0,onContextMenu:Y?Ce:void 0,children:[Ne&&(0,De.jsx)("div",{className:"message-icon",dangerouslySetInnerHTML:{__html:Ne}}),(0,De.jsx)("div",{className:"shiny-chat-message-content",children:c?(0,De.jsxs)("div",{className:"shiny-chat-edit-wrap",onKeyDownCapture:j=>{j.key==="Escape"&&(j.preventDefault(),d?.())},children:[(0,De.jsxs)("div",{className:"shiny-chat-edit-box",onDropCapture:re,onDragOver:j=>j.preventDefault(),onPasteCapture:A,children:[(0,De.jsx)(G0,{staging:_,uploadAccept:p,maxUploadSize:h,enableUpload:g,disabled:a}),(0,De.jsx)(q0,{ref:R,inputId:`${l}-edit`,placeholder:"Edit message",slashCommands:[],userMessages:[],submitKey:u,onHasTextChange:x,onSubmit:xe,canSubmitEmpty:Ve}),(0,De.jsx)("button",{type:"button",className:"shiny-chat-btn-send",disabled:a||!v&&_.attachments.length===0,onClick:()=>{let j=R.current?.serializeEditor()??"";xe(j)},"aria-label":"Save and resend",title:"Save and resend",dangerouslySetInnerHTML:{__html:ig}})]}),(0,De.jsx)("button",{type:"button",className:"shiny-chat-edit-cancel-outside",onClick:()=>d?.(),children:"Cancel"})]}):(0,De.jsxs)(De.Fragment,{children:[O&&ue,(0,De.jsxs)(e6,{children:[St,!O&&(0,De.jsx)(Q5,{})]}),!O&&ue,t.cancelled&&(0,De.jsx)("div",{className:"shiny-chat-message-cancelled",children:"Response cancelled"})]})}),O&&!c&&(i&&!a||t.siblings&&t.siblings.total>1)&&(0,De.jsxs)("div",{className:"shiny-chat-message-footer",children:[t.siblings&&t.siblings.total>1&&(0,De.jsxs)("div",{className:"shiny-chat-sibling-nav",children:[(0,De.jsx)("button",{type:"button",disabled:t.siblings.index===0||a||s,onClick:()=>o?.(n,"prev"),"aria-label":"Previous version",children:"\u2039"}),(0,De.jsxs)("span",{"aria-live":"polite",children:[t.siblings.index+1," / ",t.siblings.total]}),(0,De.jsx)("button",{type:"button",disabled:t.siblings.index===t.siblings.total-1||a||s,onClick:()=>o?.(n,"next"),"aria-label":"Next version",children:"\u203A"})]}),i&&!a&&(0,De.jsx)("button",{type:"button",className:"shiny-chat-edit-btn",onClick:()=>{L(!1),f?.(t.id)},"aria-label":"Edit message",title:"Edit message",dangerouslySetInnerHTML:{__html:xL}})]}),Ie]})});var J5=G(fe(),1),e8=G(ie(),1),K0=class extends J5.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){console.warn("[shinychat] Error rendering message:",t,n)}render(){return this.state.hasError?(0,e8.jsx)("div",{className:"shiny-chat-message-error",role:"alert",children:"Error rendering message"}):this.props.children}};var ac=G(ie(),1),t8=(0,ul.memo)(function({messages:t,iconAssistant:n,onEdit:r,onNavigate:i,siblingNavigationPending:o,disabled:s,inputId:a,submitKey:l,uploadAccept:u,maxUploadSize:c,enableUpload:f}){let[d,p]=(0,ul.useState)(null),h=(0,ul.useCallback)(y=>p(y),[]),g=(0,ul.useCallback)(()=>p(null),[]);return(0,ac.jsx)(ac.Fragment,{children:t.map((y,b)=>(0,ac.jsx)(K0,{children:(0,ac.jsx)(Z5,{message:y,index:b,iconAssistant:n,onEdit:r,onNavigate:i,siblingNavigationPending:o,disabled:s,inputId:a,submitKey:l,uploadAccept:u,maxUploadSize:c,enableUpload:f,isEditing:y.id===d,onStartEdit:h,onCancelEdit:g})},y.id))})});var ci=G(fe(),1);var Y0=G(ie(),1),n8=(0,ci.memo)(function({greeting:t}){let n=Ku(),r=(0,ci.useContext)(hf),i=(0,ci.useRef)(null),[o,s]=(0,ci.useState)(!0),a=t.status==="dismissing";if((0,ci.useEffect)(()=>{if(!o)return;if(n){s(!1);return}let c=i.current;if(!c)return;function f(d){d.animationName==="shiny-chat-greeting-reveal"&&s(!1)}return c.addEventListener("animationend",f),()=>c.removeEventListener("animationend",f)},[o,n]),(0,ci.useEffect)(()=>{if(!a)return;if(n){r?.({type:"greeting_dismissed"});return}let c=i.current;if(!c)return;function f(d){d.animationName==="shiny-chat-greeting-dismiss"&&r?.({type:"greeting_dismissed"})}return c.addEventListener("animationend",f),()=>c.removeEventListener("animationend",f)},[a,n,r]),t.status==="dismissed")return null;let l=t.blocks.length-1;return(0,Y0.jsx)("div",{className:o?"shiny-chat-greeting shiny-chat-greeting--enter":"shiny-chat-greeting",ref:i,...a?{"data-dismissing":""}:{},children:(0,Y0.jsx)("div",{className:"shiny-chat-greeting-content",children:t.blocks.map((c,f)=>(0,Y0.jsx)(Kt,{content:c.content,contentType:c.contentType,role:"assistant",streaming:t.streaming&&f===l,tagToComponentMap:Gu},f))})})});var gr=G(fe(),1);var zs=G(ie(),1);function zie(e,t){if(!e.startsWith("/"))return null;let n=e.slice(1),r=n.indexOf(" "),i=r===-1?n:n.slice(0,r),o=r===-1?"":n.slice(r+1).trim(),s=t.find(a=>a.name===i);return s?{command:i,userText:o,echo:s.echo}:null}var r8=(0,gr.memo)((0,gr.forwardRef)(function({transport:t,inputId:n,uploadAccept:r,maxUploadSize:i,disabled:o,hasTopShadow:s=!1,placeholder:a,onSend:l,userMessages:u,enableCancel:c,enableUpload:f,cancelRequested:d,isStreaming:p,onCancel:h,slashCommands:g=[],slashCommandId:y="",submitKey:b="enter"},E){let T=Dh(),S=kR(),v=(0,gr.useRef)(null),[x,R]=(0,gr.useState)(!1),O=(0,gr.useCallback)(()=>v.current?.focus(),[]),B=V0({uploadAccept:r,maxUploadSize:i,enableUpload:f,focusEditor:O}),{attachments:C,onPaste:V,onDrop:Y,getPayloads:q,applyPayloads:L,clearAttachments:H,resetAll:I}=B,P=(0,gr.useCallback)(A=>{let re=q();if(A.trim().length===0&&re.length===0||o)return!1;let se=zie(A,g);if(se){let xe=document.getElementById(n),Ve=xe?.closest("shiny-chat-container")??null,de={id:Ve?.getAttribute("effective-id")??Ve?.id??"",command:se.command,userText:se.userText,echo:se.echo},ct=new CustomEvent("shiny:chat-slash-command",{detail:de,cancelable:!0,bubbles:!0});(Ve??xe)?.dispatchEvent(ct);let Ge=de.echo,rt=ct.defaultPrevented;Ge&&T({type:"INPUT_SENT",content:A,role:"user",awaitResponse:!rt}),rt||t.sendSlashCommand(y,se.command,se.userText,Ge)}else S(A,re),I();return l?.(),!0},[o,T,t,n,l,g,y,S,q,I]),D=(0,gr.useCallback)(()=>q().length>0,[q]);(0,gr.useImperativeHandle)(E,()=>({setInputValue(A,{submit:re=!1,focus:se=!1,attachments:xe,attachmentMode:Ve="append"}={}){let de=v.current;if(!de)return;if(!re){A!==void 0?de.setInputValue(A,{focus:se}):se&&de.focus(),xe!==void 0&&L(xe,Ve);return}let ct=de.serializeEditor();A!==void 0&&de.setInputValue(A);let Ge=de.serializeEditor(),rt=xe??[],he=Ve==="append"?[...q(),...rt]:rt;he.length===0?P(Ge):!o&&he.length>0&&(S(Ge,he),l?.()),A!==void 0?de.setInputValue(ct,{focus:se}):se&&de.focus(),xe!==void 0&&H()},focus(){v.current?.focus()}}),[o,l,P,S,L,q,H]);let U=o||!x&&C.length===0;return(0,zs.jsxs)("div",{className:"shiny-chat-input-dropzone",onDropCapture:Y,onDragOver:A=>A.preventDefault(),onPasteCapture:V,children:[(0,zs.jsx)(G0,{staging:B,uploadAccept:r,maxUploadSize:i,enableUpload:f,disabled:o}),(0,zs.jsx)(q0,{ref:v,inputId:n,placeholder:a,hasTopShadow:s,slashCommands:g,onHasTextChange:R,onSubmit:P,userMessages:u,submitKey:b,canSubmitEmpty:D}),!!c&&!!p&&!d?(0,zs.jsx)("button",{type:"button",className:"shiny-chat-btn-send shiny-chat-btn-cancel",title:"Stop generating","aria-label":"Stop generating",onClick:h,dangerouslySetInnerHTML:{__html:EL}}):o&&!p||!!d?(0,zs.jsx)("button",{type:"button",className:`shiny-chat-btn-send shiny-chat-btn-spinner${d?" shiny-chat-btn-cancel":""}`,"aria-label":"Loading",dangerouslySetInnerHTML:{__html:TL}}):(0,zs.jsx)("button",{type:"button",className:"shiny-chat-btn-send",title:"Send message","aria-label":"Send message",disabled:U,onClick:()=>{let A=v.current?.serializeEditor()??"";P(A)&&(v.current?.setInputValue(""),v.current?.focus())},dangerouslySetInnerHTML:{__html:ig}})]})}));var gv=G(ie(),1);function i8({isAtBottom:e,scrollToBottom:t,streaming:n}){return e?null:(0,gv.jsx)("button",{type:"button",className:n?"shiny-chat-scroll-to-bottom streaming":"shiny-chat-scroll-to-bottom",title:"Scroll to bottom","aria-label":"Scroll to bottom",onClick:()=>t(),children:(0,gv.jsx)("span",{dangerouslySetInnerHTML:{__html:Ru}})})}var lc=G(fe(),1),Ln=G(ie(),1);function o8({url:e,onProceed:t,onAlways:n,onCancel:r}){let i=(0,lc.useRef)(null),o=(0,lc.useRef)(t);o.current=t;let s=(0,lc.useRef)(r);return s.current=r,(0,lc.useEffect)(()=>{let a=i.current;if(!a)return;try{a.showModal()}catch{o.current()}let l=c=>{c.target===a&&s.current()},u=()=>{s.current()};return a.addEventListener("click",l),a.addEventListener("cancel",u),()=>{a.removeEventListener("click",l),a.removeEventListener("cancel",u)}},[]),(0,Ln.jsx)("dialog",{ref:i,className:"shiny-chat-external-link-dialog",children:(0,Ln.jsx)("div",{className:"modal position-relative d-block fade show",children:(0,Ln.jsxs)("div",{className:"modal-content",children:[(0,Ln.jsxs)("div",{className:"modal-header",children:[(0,Ln.jsx)("h5",{className:"modal-title",children:"External Link"}),(0,Ln.jsx)("button",{className:"btn-close shiny-chat-btn-close","data-bs-dismiss":"modal","aria-label":"Close",onClick:r})]}),(0,Ln.jsxs)("div",{className:"modal-body",children:[(0,Ln.jsx)("p",{children:"This link will take you to an external website:"}),(0,Ln.jsx)("p",{className:"link-url text-break",children:e})]}),(0,Ln.jsxs)("div",{className:"modal-footer flex-wrap-reverse",children:[(0,Ln.jsx)("button",{className:"btn btn-sm btn-link shiny-chat-btn-always ps-0 me-auto",onClick:n,children:"Always open external links"}),(0,Ln.jsxs)("div",{className:"d-flex gap-2 justify-content-end",children:[(0,Ln.jsx)("button",{autoFocus:!0,className:"btn btn-sm btn-primary shiny-chat-btn-proceed",onClick:t,children:"Open Link"}),(0,Ln.jsx)("button",{className:"btn btn-sm btn-outline-danger shiny-chat-btn-cancel",onClick:r,children:"Cancel"})]})]})]})})})}var uc=G(fe(),1);var a8=G(ie(),1);function s8({source:e,className:t}){let n=(0,uc.useRef)(null),r=(0,uc.useContext)(ds);return(0,uc.useEffect)(()=>{let i=n.current;if(i){for(r&&r.unbindAll(e);e.firstChild;)i.appendChild(e.firstChild);return r&&r.bindAll(i),()=>{for(r&&r.unbindAll(i);i.firstChild;)e.appendChild(i.firstChild)}}},[e,r]),(0,a8.jsx)("div",{ref:n,className:t})}var lt=G(fe(),1);var ce=G(ie(),1),qie=300;function l8({isOpen:e,onClose:t,triggerRef:n,conversations:r,activeId:i,busy:o,onSelect:s,onNew:a,onRename:l,onDelete:u}){let[c,f]=(0,lt.useState)(e),[d,p]=(0,lt.useState)(!1),h=(0,lt.useRef)(e);h.current=c;let g=Ku(),[y,b]=(0,lt.useState)(""),[E,T]=(0,lt.useState)(null),[S,v]=(0,lt.useState)(null),[x,R]=(0,lt.useState)(null),O=(0,lt.useRef)(null),B=(0,lt.useRef)(null),C=(0,lt.useCallback)(()=>{b(""),T(null),v(null),R(null),t()},[t]),V=(0,lt.useCallback)(()=>{f(!1),p(!1),n.current?.focus({preventScroll:!0})},[n]);(0,lt.useEffect)(()=>{e?(f(!0),p(!1)):h.current&&p(!0)},[e]),(0,lt.useEffect)(()=>{if(!d)return;if(g){V();return}let P=setTimeout(V,qie);return()=>clearTimeout(P)},[d,g,V]),(0,lt.useEffect)(()=>{if(!c||d)return;let P=O.current;if(!P)return;let D=U=>{if(U.key==="Escape"){if(x){R(null);return}if(E){T(null);return}C();return}if(U.key==="Tab"){let _=P.querySelectorAll('button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(_.length===0)return;let te=_[0],ne=_[_.length-1],A=document.activeElement===P;U.shiftKey&&(document.activeElement===te||A)?(U.preventDefault(),ne.focus()):!U.shiftKey&&document.activeElement===ne&&(U.preventDefault(),te.focus())}};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[c,d,x,E,C]),(0,lt.useEffect)(()=>{c&&!d&&O.current?.focus({preventScroll:!0})},[c,d]),(0,lt.useEffect)(()=>{if(!E)return;let P=D=>{D.target.closest(`[data-menu-id="${E}"]`)||T(null)};return document.addEventListener("pointerdown",P,!0),()=>document.removeEventListener("pointerdown",P,!0)},[E]);let Y=(0,lt.useMemo)(()=>{let P=y.trim().toLowerCase();return P?r.filter(D=>D.title.toLowerCase().includes(P)):r},[r,y]),q=(0,lt.useMemo)(()=>Gie(Y),[Y]);function L(P){P.target===P.currentTarget&&d&&V()}function H(P){o||(s(P),C())}function I(){o||(a(),C())}return c?(0,ce.jsxs)("div",{ref:O,className:"shiny-chat-history","data-closing":d||void 0,role:"dialog","aria-modal":"true","aria-label":"Conversation history",tabIndex:-1,children:[(0,ce.jsx)("div",{className:"shiny-chat-history-scrim",onClick:C}),(0,ce.jsxs)("div",{className:"shiny-chat-history-drawer",onAnimationEnd:L,children:[(0,ce.jsxs)("div",{className:"shiny-chat-history-header",children:[(0,ce.jsx)("h2",{className:"shiny-chat-history-title",children:"History"}),(0,ce.jsx)("button",{type:"button",className:"shiny-chat-history-close","aria-label":"Close history",onClick:C,children:(0,ce.jsx)(c8,{})})]}),(0,ce.jsxs)("div",{className:"shiny-chat-history-toprow",children:[(0,ce.jsxs)("button",{type:"button",className:"shiny-chat-history-new",disabled:o,title:o?"Wait for the response to finish":void 0,"aria-label":"New conversation",onClick:I,children:[(0,ce.jsx)(Yie,{}),"New"]}),(0,ce.jsxs)("span",{className:"shiny-chat-history-search-wrap",children:[(0,ce.jsx)("span",{className:"shiny-chat-history-search-icon",children:(0,ce.jsx)($ie,{})}),(0,ce.jsx)("input",{className:"shiny-chat-history-search form-control",ref:B,placeholder:"Search\u2026",value:y,onChange:P=>b(P.target.value),"aria-label":"Search conversations"})]})]}),(0,ce.jsxs)("div",{className:"shiny-chat-history-list",children:[Y.length===0&&(0,ce.jsx)("div",{className:"shiny-chat-history-empty",children:y.trim()?"No conversations found":"No conversations yet"}),q.map(([P,D])=>(0,ce.jsxs)(lt.default.Fragment,{children:[(0,ce.jsx)("div",{className:"shiny-chat-history-section",children:P}),D.map(U=>(0,ce.jsx)(Vie,{meta:U,active:U.id===i,busy:o,menuOpen:E===U.id,renaming:S===U.id,confirmingDelete:x===U.id,onToggleMenu:()=>T(E===U.id?null:U.id),onStartRename:()=>{v(U.id),T(null)},onStartDelete:()=>{R(U.id),T(null)},onCancelEdit:()=>{v(null),R(null)},onRename:_=>{l(U.id,_),v(null)},onDelete:()=>{u(U.id),R(null)},onSelect:()=>H(U.id)},U.id))]},P))]})]})]}):null}function Vie({meta:e,active:t,busy:n,menuOpen:r,renaming:i,confirmingDelete:o,onToggleMenu:s,onStartRename:a,onStartDelete:l,onCancelEdit:u,onRename:c,onDelete:f,onSelect:d}){let[p,h]=(0,lt.useState)(e.title);return(0,lt.useEffect)(()=>{i||h(e.title)},[e.title,i]),i?(0,ce.jsx)("div",{className:"shiny-chat-history-item",children:(0,ce.jsx)("input",{className:"shiny-chat-history-rename-input form-control form-control-sm",autoFocus:!0,value:p,onChange:g=>h(g.target.value),onKeyDown:g=>{if(g.key==="Enter"){if(!p.trim())return;c(p);return}g.key==="Escape"&&(g.stopPropagation(),u())},onBlur:u,"aria-label":"Rename conversation"})}):(0,ce.jsxs)("div",{className:`shiny-chat-history-item${t?" active":""}`,children:[(0,ce.jsxs)("button",{type:"button",className:"shiny-chat-history-item-select",disabled:n,title:n?"Wait for the response to finish":void 0,onClick:d,children:[(0,ce.jsx)("span",{className:"shiny-chat-history-item-title",children:e.title}),(0,ce.jsx)("span",{className:"shiny-chat-history-item-time",children:Kie(e.updated_at)})]}),o?(0,ce.jsxs)("span",{className:"shiny-chat-history-confirm",children:["Delete?",(0,ce.jsx)("button",{type:"button",className:"shiny-chat-history-confirm-yes",onClick:f,"aria-label":"Confirm delete",children:(0,ce.jsx)(Wie,{})}),(0,ce.jsx)("button",{type:"button",className:"shiny-chat-history-confirm-no",onClick:u,"aria-label":"Cancel delete",children:(0,ce.jsx)(c8,{})})]}):(0,ce.jsxs)("span",{className:"shiny-chat-history-itemmenu","data-menu-id":e.id,children:[(0,ce.jsx)("button",{type:"button","aria-label":"Conversation actions",onClick:s,children:(0,ce.jsx)(jie,{})}),r&&(0,ce.jsxs)("span",{className:"shiny-chat-history-menu",children:[(0,ce.jsxs)("button",{type:"button",onClick:a,children:[(0,ce.jsx)(Xie,{}),"Rename"]}),(0,ce.jsxs)("button",{type:"button",className:"shiny-chat-history-menu-danger",disabled:n,title:n?"Wait for the response to finish":void 0,onClick:l,children:[(0,ce.jsx)(Qie,{}),"Delete"]})]})]})]})}function Gie(e){let t=new Date;t.setHours(0,0,0,0);let n=new Date(t);n.setDate(n.getDate()-7);let r=[],i=[],o=[];for(let a of e){let l=new Date(a.updated_at);l>=t?r.push(a):l>=n?i.push(a):o.push(a)}let s=[];return r.length&&s.push(["Today",r]),i.length&&s.push(["Last 7 days",i]),o.length&&s.push(["Previous",o]),s}function Kie(e){let t=new Date(e),n=new Date;return n.setHours(0,0,0,0),t>=n?t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function u8(){return(0,ce.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[(0,ce.jsx)("path",{d:"M2.5 3v3h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ce.jsx)("path",{d:"M2.75 6A5.5 5.5 0 1 1 3 9.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ce.jsx)("path",{d:"M8 5v3.2l2.2 1.3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Yie(){return(0,ce.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[(0,ce.jsx)("path",{d:"M8 2.5H3.5A1.5 1.5 0 0 0 2 4v8.5A1.5 1.5 0 0 0 3.5 14H12a1.5 1.5 0 0 0 1.5-1.5V8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ce.jsx)("path",{d:"M11.7 2.3a1.2 1.2 0 0 1 1.7 1.7L8 9.4l-2.3.6.6-2.3 5.4-5.4z",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}function $ie(){return(0,ce.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[(0,ce.jsx)("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),(0,ce.jsx)("path",{d:"m10.5 10.5 3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function c8(){return(0,ce.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,ce.jsx)("path",{d:"m4 4 8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function Wie(){return(0,ce.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,ce.jsx)("path",{d:"m3.5 8.5 3 3 6-7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function jie(){return(0,ce.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[(0,ce.jsx)("circle",{cx:"3.5",cy:"8",r:"1.35"}),(0,ce.jsx)("circle",{cx:"8",cy:"8",r:"1.35"}),(0,ce.jsx)("circle",{cx:"12.5",cy:"8",r:"1.35"})]})}function Xie(){return(0,ce.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[(0,ce.jsx)("path",{d:"M11.7 2.3a1.2 1.2 0 0 1 1.7 1.7l-8 8-2.8.9.9-2.8 8.2-8.2z",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),(0,ce.jsx)("path",{d:"m10.5 3.5 2 2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function Qie(){return(0,ce.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,ce.jsx)("path",{d:"M3 4.5h10M6.5 4.5V3a.8.8 0 0 1 .8-.8h1.4a.8.8 0 0 1 .8.8v1.5M4.5 4.5l.5 8a1 1 0 0 0 1 .95h4a1 1 0 0 0 1-.95l.5-8M6.75 7v3.75M9.25 7v3.75",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}var f8=G(fe(),1);function d8(e){(0,f8.useEffect)(()=>{let t=e.current?.closest("shiny-chat-container");if(!t?.hasAttribute("fill")||!t.classList.contains("html-fill-item"))return;let n=null,r="",i=t;for(;i.parentElement instanceof HTMLElement&&i.parentElement.classList.contains("html-fill-container")&&i.parentElement.children.length===1;){i=i.parentElement;let s=getComputedStyle(i).paddingLeft;if(parseFloat(s)>0){n=i,r=s;break}}if(!n)return;let o=n.style.padding;return n.style.padding="0",t.style.setProperty("--shiny-chat-fill-padding",r),()=>{n.style.padding=o,t.style.removeProperty("--shiny-chat-fill-padding")}},[e])}var $0=G(fe(),1);function p8(e,t){let n=(0,$0.useRef)(t);n.current=t;let{enabled:r=!0,boundarySelector:i}=t;(0,$0.useEffect)(()=>{if(!r)return;let o=e.current;if(!o)return;let s=o.closest(i);if(!s)return;let a=()=>{let{shiftProperty:p,side:h,gap:g=8,maxShiftFraction:y=1/3,shouldSkip:b}=n.current;if(b?.(s))return;let E=(typeof h=="function"?h(s):h)==="right";o.style.setProperty(p,"0px");let T=o.getBoundingClientRect();if(T.width===0||T.height===0)return;let S=E?T.right-1:T.left+1,v=[T.top+2,T.top+T.height/2,T.bottom-2],x=null;for(let B of v){let C=document.elementsFromPoint(S,B).find(q=>!s.contains(q)&&!q.contains(s));if(!C)continue;let V=C.getBoundingClientRect(),Y=E?V.left:V.right;x=x===null?Y:E?Math.min(x,Y):Math.max(x,Y)}if(x===null)return;let R=E?T.right-x+g:x-T.left+g;if(R<=0)return;let O=s.clientWidth*y;o.style.setProperty(p,`${Math.min(R,O)}px`)};a();let l=new ResizeObserver(a);l.observe(s),window.addEventListener("resize",a);let u=s.closest(".bslib-sidebar-layout");u?.addEventListener("transitionend",a);let c=u?new MutationObserver(a):null;c?.observe(u,{attributes:!0,attributeFilter:["class"]});let{watchMutations:f}=n.current,d=f?new MutationObserver(a):null;return d?.observe(s,f),()=>{l.disconnect(),window.removeEventListener("resize",a),u?.removeEventListener("transitionend",a),c?.disconnect(),d?.disconnect()}},[r,i,e])}var un=G(ie(),1);function bv(e){window.open(e,"_blank","noopener,noreferrer")}var m8=(0,nt.forwardRef)(function({transport:t,messages:n,streamingMessage:r,inputDisabled:i,inputPlaceholder:o,iconAssistant:s,inputId:a,uploadAccept:l,maxUploadSize:u,elementId:c,greeting:f,cancelId:d,enableCancel:p,enableUpload:h,cancelRequested:g,footerEl:y,slashCommands:b,slashCommandId:E,submitKey:T,historyEnabled:S,historyConversations:v,historyActiveId:x,onEdit:R,onNavigate:O,siblingNavigationPending:B},C){let V=(0,nt.useMemo)(()=>n.filter(w=>w.role==="user").map(w=>w.content),[n]),Y=(0,nt.useMemo)(()=>r?[...n,r]:n,[n,r]),q=(0,nt.useRef)(null),[L,H]=(0,nt.useState)(!1),I=(0,nt.useRef)(null),[P,D]=(0,nt.useState)(null),U=(0,nt.useRef)(null);U.current=P;let{scrollRef:_,contentRef:te,scrollToBottom:ne,stopScroll:A}=Ph({resize:"smooth"}),re=(0,nt.useRef)(null),se=(0,nt.useRef)(null),xe=(0,nt.useCallback)(w=>{re.current=w,se.current===null&&te(w)},[te]),[Ve,de]=(0,nt.useState)(!0);(0,nt.useEffect)(()=>{let w=_.current;if(!w)return;let F=()=>{let Ke=w.scrollHeight-w.scrollTop-w.clientHeight;de(Ke<=1)};F(),w.addEventListener("scroll",F,{passive:!0});let $=new ResizeObserver(F);$.observe(w);let oe=()=>{Array.from(w.children).forEach(Ke=>$.observe(Ke))};oe();let be=new MutationObserver(()=>{oe(),F()});return be.observe(w,{childList:!0}),()=>{w.removeEventListener("scroll",F),$.disconnect(),be.disconnect()}},[_]);let ct=Dh(),Ge=!!r,rt=(0,nt.useCallback)(()=>{!p||!d||!Ge||g||(ct({type:"CANCEL_REQUESTED"}),t.sendCancel(d))},[p,d,Ge,g,ct,t]),he=(0,nt.useRef)(rt);he.current=rt,(0,nt.useEffect)(()=>{if(!p)return;let w=_.current?.closest("shiny-chat-container");if(!w)return;let F=$=>{$.defaultPrevented||$.key==="Escape"&&he.current()};return w.addEventListener("keydown",F),()=>w.removeEventListener("keydown",F)},[p,_]),d8(_),p8(I,{enabled:S,boundarySelector:"shiny-chat-container",shiftProperty:"--_history-trigger-shift",side:w=>w.getAttribute("data-history-placement")==="right"?"right":"left",shouldSkip:w=>!!w.querySelector(":scope > .shiny-chat-history"),watchMutations:{childList:!0}}),(0,nt.useImperativeHandle)(C,()=>({setInputValue(...w){q.current?.setInputValue(...w)},focus(){q.current?.focus()},beginSiblingNavigation(){let w=_.current;w&&(se.current=w.scrollTop,te(null),A())},endSiblingNavigation(){let w=se.current;w!==null&&requestAnimationFrame(()=>{let F=re.current,$=_.current;!F||!$||(te(F),A(),$.scrollTop=w,se.current=null)})}}));let Ce=(0,nt.useCallback)(w=>{let $=w.target.closest("a[data-shinychat-link]");if(!$||!$.href)return;if(w.preventDefault(),$.origin===window.location.origin||window.shinychat_always_open_external_links){bv($.href);return}if(typeof window.HTMLDialogElement>"u"){bv($.href);return}D($.href)},[]);function Ae(w){if(!(w instanceof HTMLElement))return{};let F=w.closest(".suggestion, [data-suggestion]");return F instanceof HTMLElement?F.classList.contains("suggestion")||F.dataset.suggestion!==void 0?{suggestion:F.dataset.suggestion||F.textContent||void 0,submit:F.classList.contains("submit")||F.dataset.suggestionSubmit===""||F.dataset.suggestionSubmit==="true"}:{}:{}}function Ne(w){let{suggestion:F,submit:$}=Ae(w.target);if(!F)return;w.preventDefault();let oe=w.metaKey||w.ctrlKey?!0:w.altKey?!1:$;q.current?.setInputValue(F,{submit:oe,focus:!oe});let be=w.target.closest(".shiny-chat-suggestion-list-item"),Ke=be?.closest(".shiny-chat-suggestion-list");be&&Ke&&(Ke.querySelectorAll("[data-last-clicked]").forEach(jn=>jn.removeAttribute("data-last-clicked")),be.setAttribute("data-last-clicked",""))}function me(w){Ne(w)}function we(w){Ce(w),me(w)}function ue(w){let F=w.target.closest(".shiny-chat-suggestion-list-item");if(!F)return;let $=F.closest(".shiny-chat-suggestion-list");!$||$.dataset.roved!==void 0||($.dataset.roved="",$.querySelectorAll(".shiny-chat-suggestion-list-item").forEach(oe=>{oe!==F&&(oe.tabIndex=-1)}))}function St(w){let F=w.target.closest(".shiny-chat-suggestion-list-item");if(!F)return;let $=F.closest(".shiny-chat-suggestion-list");if(!$)return;let oe=w.relatedTarget,be=oe?.closest(".shiny-chat-suggestion-list");(!oe||be!==$)&&delete $.dataset.roved}function Ie(w,F,$){switch($){case"ArrowDown":case"ArrowRight":return(w+1)%F;case"ArrowUp":case"ArrowLeft":return(w-1+F)%F;case"Home":return 0;case"End":return F-1;default:return null}}function j(w){let $=w.target.closest(".shiny-chat-suggestion-list-item"),oe=$?.closest(".shiny-chat-suggestion-list");if($&&oe){let Ke=Array.from(oe.querySelectorAll(".shiny-chat-suggestion-list-item")),jn=Ke.indexOf($),Xn=Ie(jn,Ke.length,w.key);if(Xn!==null){w.preventDefault();let Vs=Ke[jn],Po=Ke[Xn];Vs.tabIndex=-1,Po.tabIndex=0,Po.focus();return}}(w.key==="Enter"||w.key===" ")&&Ne(w)}let Se=(0,nt.useCallback)(()=>{let w=U.current;w&&bv(w),D(null)},[]),Xe=(0,nt.useCallback)(()=>{window.shinychat_always_open_external_links=!0,Se()},[Se]),wt=(0,nt.useCallback)(()=>{D(null)},[]),xt=(0,nt.useCallback)(()=>{ne()},[ne]);return(0,un.jsxs)(XE.Provider,{value:b,children:[S&&(0,un.jsx)("button",{type:"button",ref:I,className:"shiny-chat-history-trigger","aria-label":"Conversation history","aria-expanded":L,onClick:()=>H(w=>!w),children:(0,un.jsx)(u8,{})}),(0,un.jsxs)("div",{className:"shiny-chat-wrapper",children:[(0,un.jsxs)("div",{className:"shiny-chat-messages-wrapper",children:[(0,un.jsx)("div",{className:"shiny-chat-messages",ref:_,onClick:we,onFocus:ue,onBlur:St,onKeyDown:j,children:(0,un.jsxs)(YE.Provider,{value:A,children:[f!=null&&(0,un.jsx)(n8,{greeting:f}),(0,un.jsx)("div",{className:"shiny-chat-messages-content",ref:xe,role:"log","aria-live":"polite",...f?.status==="dismissing"?{"data-greeting-dismissing":""}:{},children:(0,un.jsx)(t8,{messages:Y,iconAssistant:s,onEdit:S?R:void 0,onNavigate:S?O:void 0,siblingNavigationPending:B,disabled:Ge,inputId:a,submitKey:T,uploadAccept:l,maxUploadSize:u,enableUpload:h})})]})}),(0,un.jsx)(i8,{isAtBottom:Ve,scrollToBottom:ne,streaming:!!r||!!f?.streaming})]}),(0,un.jsx)("div",{className:i?"shiny-chat-input disabled":"shiny-chat-input",onClick:Ce,children:(0,un.jsx)(r8,{ref:q,transport:t,inputId:a,uploadAccept:l,maxUploadSize:u,disabled:i,hasTopShadow:!Ve,placeholder:o,onSend:xt,userMessages:V,enableCancel:p,enableUpload:h,cancelRequested:g,isStreaming:Ge,onCancel:rt,slashCommands:b,slashCommandId:E,submitKey:T})}),y&&(0,un.jsx)(s8,{source:y,className:"shiny-chat-footer"})]}),S&&(0,un.jsx)(l8,{isOpen:L,onClose:()=>H(!1),triggerRef:I,conversations:v??[],activeId:x??null,busy:Ge,onSelect:w=>{t.sendHistorySelect(c,w)},onNew:()=>t.sendHistoryNew(c),onRename:(w,F)=>t.sendHistoryRename(c,w,F),onDelete:w=>t.sendHistoryDelete(c,w)}),P&&(0,h8.createPortal)((0,un.jsx)(o8,{url:P,onProceed:Se,onAlways:Xe,onCancel:wt}),document.body)]})});var qs=G(ie(),1);function Zie(e,t){let r=!(e.options.persistent===!0)&&t>0?"dismissed":"visible";return{content:e.content,contentType:e.contentType,streaming:!1,status:r,options:e.options,blocks:[{type:"content",content:e.content,contentType:e.contentType}]}}function yv({transport:e,shinyLifecycle:t,elementId:n,iconAssistant:r,inputId:i,cancelId:o,uploadAccept:s=[],maxUploadSize:a=null,placeholder:l,initialMessages:u,initialGreeting:c,enableCancel:f,enableUpload:d,asideFavicon:p=!0,toolGrouping:h,footerEl:g,slashCommandId:y="",submitKey:b}){let E=h??uo.toolGrouping,T=(0,ut.useMemo)(()=>(u??[]).map(A=>{let re=A.blocks.flatMap(xe=>xe.type==="content"?Mh(xe.content,xe.contentType):[xe]),se=lo(re,E,A.role);return{...A,blocks:se,content:pf(se)}}),[u,E]),[S,v]=(0,ut.useReducer)(NR,{...uo,inputPlaceholder:l??uo.inputPlaceholder,messages:T,greeting:c?Zie(c,T.length):null,enableCancel:f??uo.enableCancel,enableCancelExplicit:f!==void 0,enableUpload:d??uo.enableUpload,enableUploadExplicit:d!==void 0,toolGrouping:E});(0,ut.useEffect)(()=>{v({type:"SET_TOOL_GROUPING",grouping:E})},[E]);let x=(0,ut.useRef)(S);x.current=S;let R=(0,ut.useCallback)(()=>{e.sendMessagesSnapshot(n,KE(x.current))},[e,n]);(0,ut.useEffect)(()=>{R()},[S.messages,R]);let O=(0,ut.useCallback)((A,re)=>{v({type:"INPUT_SENT",content:A,role:"user",...re.length>0?{attachments:re}:{}});let se=KE(x.current);se.push({role:"user",segments:[{content:A,content_type:"markdown"}],...re.length>0?{attachments:re}:{}});let xe=x.current.enableUpload;e.sendInput(i,xe?{text:A,attachments:re}:A),e.sendMessagesSnapshot(n,se)},[v,e,i,n]),B=(0,ut.useRef)(null),C=(0,ut.useRef)(!1),[V,Y]=(0,ut.useState)(!1);(0,ut.useEffect)(()=>e.onMessage(n,re=>{if(re.type==="history_navigate"){JE(n,re.active_id),IR(re.url,re.reload===!0);return}if(re.type==="update_input"){re.placeholder!==void 0&&v({type:"update_input",placeholder:re.placeholder}),re.value!==void 0||re.attachments!==void 0?B.current?.setInputValue(re.value,{submit:re.submit,focus:re.focus,attachments:re.attachments,attachmentMode:re.attachment_mode}):re.focus&&B.current?.focus();return}v(re),re.type==="history_update"&&C.current&&(C.current=!1,Y(!1),B.current?.endSiblingNavigation())}),[e,n]);let[q,L]=(0,ut.useState)(!1);(0,ut.useEffect)(()=>{if(!n)return;let A=document.getElementById(n);if(!A)return;if(typeof IntersectionObserver>"u"){L(!0);return}let re=new IntersectionObserver(se=>L(se[0]?.isIntersecting??!1),{threshold:0});return re.observe(A),()=>re.disconnect()},[n]);let H=q&&S.messages.length===0&&S.greeting===null,I=(0,ut.useRef)(!1);(0,ut.useEffect)(()=>{if(!H){I.current=!1;return}I.current||window.Shiny?.setInputValue&&(I.current=!0,window.Shiny.setInputValue(`${n}_greeting_requested`,Date.now(),{priority:"event"}))},[H,n]);let P=S.greeting?.status==="dismissed",D=(0,ut.useRef)(!1);(0,ut.useEffect)(()=>{window.Shiny?.setInputValue&&(P&&!D.current?(D.current=!0,window.Shiny.setInputValue(`${n}_greeting_dismissed`,Date.now(),{priority:"event"})):!P&&D.current&&(D.current=!1,window.Shiny.setInputValue(`${n}_greeting_dismissed`,null)))},[P,n]),(0,ut.useEffect)(()=>{S.history.enabled&&JE(n,S.history.activeId)},[n,S.history.enabled,S.history.activeId]);let U=(0,ut.useCallback)((A,re,se)=>{e.sendMessageEdit(n,A,re,se)},[e,n]),_=(0,ut.useCallback)((A,re)=>{C.current||(C.current=!0,Y(!0),B.current?.beginSiblingNavigation(),e.sendMessageNavigate(n,A,re))},[e,n]),te=LR(S.messages,S.streamingMessage),ne=(0,ut.useMemo)(()=>({supersededRequests:te}),[te]);return(0,qs.jsx)(ds.Provider,{value:t,children:(0,qs.jsx)($E.Provider,{value:ne,children:(0,qs.jsx)(WE.Provider,{value:S.toolGrouping,children:(0,qs.jsx)(hf.Provider,{value:v,children:(0,qs.jsx)(jE.Provider,{value:O,children:(0,qs.jsx)(QE.Provider,{value:p,children:(0,qs.jsx)(m8,{ref:B,transport:e,messages:S.messages,streamingMessage:S.streamingMessage,inputDisabled:S.inputDisabled,inputPlaceholder:S.inputPlaceholder,iconAssistant:r,inputId:i,uploadAccept:s,maxUploadSize:a,elementId:n,greeting:S.greeting,cancelId:o,enableCancel:S.enableCancel,enableUpload:S.enableUpload,cancelRequested:S.cancelRequested,footerEl:g,slashCommands:S.slashCommands,slashCommandId:y,submitKey:b,historyEnabled:S.history.enabled,historyConversations:S.history.conversations,historyActiveId:S.history.activeId,onEdit:U,onNavigate:_,siblingNavigationPending:V})})})})})})})}function g8(e){if(!e||typeof e!="object")return!1;let t=e;return!(typeof t.id!="string"||!t.action||typeof t.action!="object"||typeof t.action.type!="string")}function W0(){return window.__shinyChatTransport||(window.__shinyChatTransport=new Ev),window.__shinyChatTransport}var Ev=class{listeners=new Map;pendingMessages=new Map;inputSeq=0;constructor(){window.Shiny?.addCustomMessageHandler("shinyChatMessage",async t=>{if(!g8(t)){console.warn("[shinychat] Malformed shinyChatMessage envelope, dropping:",JSON.stringify(t));return}let{id:n,action:r,html_deps:i}=t;i&&Array.isArray(i)&&(await this.renderDependencies(i),(r.type==="message"||r.type==="chunk_start"||r.type==="chunk")&&(r.html_deps=i));let o=this.listeners.get(n);if(!o||o.size===0){this.pendingMessages.has(n)||this.pendingMessages.set(n,[]),this.pendingMessages.get(n).push(r);return}for(let s of o)s(r)})}sendInput(t,n){if(!window.Shiny?.setInputValue)return;let r=typeof n=="string"?{text:n,attachments:[]}:n;this.inputSeq+=1,window.Shiny.setInputValue(`${t}:shinychat.userInput`,{...r,seq:this.inputSeq})}sendCancel(t){window.Shiny?.setInputValue&&window.Shiny.setInputValue(t,Date.now(),{priority:"event"})}sendSlashCommand(t,n,r,i){window.Shiny?.setInputValue&&window.Shiny.setInputValue(t,{command:n,userText:r,echo:i},{priority:"event"})}sendMessagesSnapshot(t,n){window.Shiny?.setInputValue&&window.Shiny.setInputValue(`${t}_messages:shinychat.messages`,n)}sendHistorySelect(t,n){window.Shiny?.setInputValue&&window.Shiny.setInputValue(`${t}_history_select`,{id:n,ts:Date.now()},{priority:"event"})}sendHistoryNew(t){window.Shiny?.setInputValue&&window.Shiny.setInputValue(`${t}_history_new`,Date.now(),{priority:"event"})}sendHistoryRename(t,n,r){window.Shiny?.setInputValue&&window.Shiny.setInputValue(`${t}_history_rename`,{id:n,title:r,ts:Date.now()},{priority:"event"})}sendHistoryDelete(t,n){window.Shiny?.setInputValue&&window.Shiny.setInputValue(`${t}_history_delete`,{id:n,ts:Date.now()},{priority:"event"})}sendMessageEdit(t,n,r,i=[]){window.Shiny?.setInputValue?.(`${t}_message_edit`,{index:n,content:r,attachments:i,ts:Date.now()})}sendMessageNavigate(t,n,r){window.Shiny?.setInputValue?.(`${t}_message_navigate`,{index:n,direction:r,ts:Date.now()})}onMessage(t,n){this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(n);let r=this.pendingMessages.get(t);if(r&&r.length>0){this.pendingMessages.delete(t);for(let i of r)n(i)}return()=>{this.listeners.get(t)?.delete(n)}}async renderDependencies(t){if(window.Shiny&&t)try{await window.Shiny.renderDependenciesAsync(t)}catch(n){this.showClientMessage({status:"error",message:`Failed to render HTML dependencies: ${n}`})}}async bindAll(t){if(window?.Shiny?.initializeInputs&&window?.Shiny?.bindAll){try{window.Shiny.initializeInputs(t)}catch(n){this.showClientMessage({status:"error",message:`Failed to initialize Shiny inputs: ${n}`})}try{await window.Shiny.bindAll(t)}catch(n){this.showClientMessage({status:"error",message:`Failed to bind Shiny inputs/outputs: ${n}`})}}}unbindAll(t){if(window?.Shiny?.unbindAll)try{window.Shiny.unbindAll(t)}catch(n){this.showClientMessage({status:"error",message:`Failed to unbind Shiny inputs/outputs: ${n}`})}}showClientMessage(t){document.dispatchEvent(new CustomEvent("shiny:client-message",{detail:{headline:t.headline??"",message:t.message,status:t.status??"warning"}}))}};var j0=W0(),b8="shinychat-browser-token",Tv=null;function Jie(){try{let e=window.localStorage.getItem(b8);return e||(e=crypto.randomUUID(),window.localStorage.setItem(b8,e)),e}catch{return Tv||(Tv=crypto.randomUUID()),Tv}}var eoe="shiny-chat-input",toe="shiny-chat-message",noe="shiny-chat-footer";function roe(e){let t=e.querySelectorAll(toe),n=[];return t.forEach(r=>{let i=r.getAttribute("content")??"",o=r.getAttribute("data-role")??"assistant",s=r.getAttribute("content-type")??"markdown",a=r.getAttribute("icon")??void 0;n.push({id:Yr(),role:o,content:i,streaming:!1,icon:a,blocks:[{type:"content",content:i,contentType:s}]})}),n}function ioe(e){let t=e.getAttribute("greeting");if(t)try{let n=JSON.parse(t);return n.content?{content:n.content,contentType:n.content_type??"markdown",options:n.options??{}}:void 0}catch{return}}function y8(e){return e==="none"||e==="tool"||e==="all"?e:void 0}var xv=class extends HTMLElement{reactRoot=null;footerEl=null;pendingUnmount=null;appProps=null;static observedAttributes=["tool-grouping"];connectedCallback(){if(this.pendingUnmount!==null&&(clearTimeout(this.pendingUnmount),this.pendingUnmount=null),this.reactRoot)return;let t=this.getAttribute("id")??"",n=this.getAttribute("icon-assistant")??void 0,r=this.getAttribute("aside-favicon")!=="false",i=this.getAttribute("enable-cancel"),o=i===null?void 0:i!=="false",s=this.getAttribute("allow-attachments"),a=s===null?void 0:s!=="false",l=y8(this.getAttribute("tool-grouping")),u=this.querySelector(eoe),c=u?.getAttribute("placeholder")??void 0,f=u?.getAttribute("id")??`${t}_user_input`,d=`${t}_cancel`,p=this.getAttribute("attachment-accept"),h=p?p.split(",").map(R=>R.trim()):k6,g=this.getAttribute("max-attachment-size"),y=g?parseInt(g,10):NaN,b=Number.isFinite(y)?y:null,E=roe(this);this.footerEl||(this.footerEl=this.querySelector(noe),this.footerEl?.remove());let T=ioe(this),v=this.getAttribute("submit-key")==="enter+modifier"?"enter+modifier":"enter",x=`${t}_slash_command`;j0.unbindAll(this),window.Shiny?.initializedPromise.then(()=>{window.Shiny?.setInputValue?.(`${t}_history_browser_token`,Jie()),window.Shiny?.setInputValue?.(`${t}_history_current_id`,DR(t)??""),window.Shiny?.setInputValue?.(`${t}_history_url_id`,OR()??"")}),this.appProps={transport:j0,shinyLifecycle:j0,elementId:t,iconAssistant:n,inputId:f,cancelId:d,uploadAccept:h,maxUploadSize:b,placeholder:c,initialMessages:E,initialGreeting:T,enableCancel:o,enableUpload:a,asideFavicon:r,toolGrouping:l,footerEl:this.footerEl??void 0,slashCommandId:x,submitKey:v},this.reactRoot=(0,E8.createRoot)(this),this.reactRoot.render((0,Sv.createElement)(yv,this.appProps))}attributeChangedCallback(t,n,r){t!=="tool-grouping"||!this.reactRoot||!this.appProps||(this.appProps={...this.appProps,toolGrouping:y8(r)},this.reactRoot.render((0,Sv.createElement)(yv,this.appProps)))}disconnectedCallback(){this.pendingUnmount=setTimeout(()=>{j0.unbindAll(this),this.reactRoot?.unmount(),this.reactRoot=null,this.pendingUnmount=null},0)}};customElements.get("shiny-chat-container")||customElements.define("shiny-chat-container",xv);var v8=G(Ch(),1),vv=G(fe(),1);var cn=G(fe(),1);var Wn=G(fe(),1);function T8({streaming:e,contentDependency:t,bottomTolerance:n=10,scrollOnContentChange:r=!1}){let i=(0,Wn.useRef)(null),[o,s]=(0,Wn.useState)(!0),a=(0,Wn.useRef)(0),l=(0,Wn.useCallback)(()=>{let g=i.current;if(!g)return;let{scrollTop:y,scrollHeight:b,clientHeight:E}=g,T=y+E>=b-n,S=y{u.current()}),f=(0,Wn.useCallback)(g=>{i.current&&i.current.removeEventListener("scroll",c.current),i.current=g,g&&(a.current=g.scrollTop,g.addEventListener("scroll",c.current,{passive:!0}))},[]);(0,Wn.useEffect)(()=>{(e||r)&&o&&i.current&&i.current.scrollTo({top:i.current.scrollHeight,behavior:"smooth"})},[e,o,t,r]);let d=(0,Wn.useCallback)(()=>{s(!0),i.current?.scrollTo({top:i.current.scrollHeight,behavior:"smooth"})},[]),p=(0,Wn.useCallback)(()=>{s(!0)},[]),h=(0,Wn.useCallback)(()=>{let g=i.current;if(!g)return;let{scrollTop:y,scrollHeight:b,clientHeight:E}=g;y+E>=b-n&&s(!0)},[n]);return{containerRef:f,stickToBottom:o,scrollToBottom:d,engageStickToBottom:p,repinIfAtBottom:h}}function S8(e,t){let n=e.parentElement,r=t?.toLowerCase();for(;n&&!(r&&n.tagName.toLowerCase()===r);){let i=getComputedStyle(n),o=i.overflowY!=="hidden"&&i.overflowY!=="clip",s=n.scrollHeight>n.clientHeight;if(o&&s)return n;n=n.parentElement}return null}var _v=G(ie(),1),ooe="shiny-chat-container";function x8({initialContent:e="",initialContentType:t="markdown",initialStreaming:n=!1,autoScroll:r=!1,onApiReady:i}){let[o,s]=(0,cn.useState)(e),[a,l]=(0,cn.useState)(t),[u,c]=(0,cn.useState)(n),f=(0,cn.useRef)(null),d=(0,cn.useRef)(null),{containerRef:p,scrollToBottom:h,repinIfAtBottom:g}=T8({streaming:r&&u,contentDependency:o});(0,cn.useLayoutEffect)(()=>{if(!r||!f.current){d.current&&(p(null),d.current=null);return}let T=S8(f.current,ooe);T!==d.current&&(p(T),d.current=T)},[r,o,p]),(0,cn.useEffect)(()=>()=>{d.current&&(p(null),d.current=null)},[p]),(0,cn.useEffect)(()=>{u&&r&&h()},[u,r,h]);let y=(0,cn.useCallback)(T=>{g(),s(S=>S+T)},[g]),b=(0,cn.useCallback)(T=>{s(T)},[]),E=(0,cn.useMemo)(()=>({appendContent:y,replaceContent:b,setStreaming:c,setContentType:l}),[y,b]);return(0,cn.useEffect)(()=>{i?.(E)},[E,i]),(0,_v.jsx)("div",{ref:f,children:(0,_v.jsx)(Kt,{content:o,contentType:a,streaming:u})})}var Cv=W0();function C8(e){return"isStreaming"in e}var Av=class extends HTMLElement{reactRoot=null;api=null;pendingMessages=[];pendingUnmount=null;connectedCallback(){if(this.pendingUnmount!==null&&(clearTimeout(this.pendingUnmount),this.pendingUnmount=null),this.reactRoot)return;this.reactRoot=(0,v8.createRoot)(this);let t=this.getAttribute("content")??"",n=this.getAttribute("content-type")??"markdown",r=_8(this,"streaming"),i=_8(this,"auto-scroll");this.reactRoot.render((0,vv.createElement)(ds.Provider,{value:Cv},(0,vv.createElement)(x8,{initialContent:t,initialContentType:n,initialStreaming:r,autoScroll:i,onApiReady:o=>{this.api=o;for(let s of this.pendingMessages)this.dispatchMessage(s);this.pendingMessages=[]}})))}disconnectedCallback(){this.pendingUnmount=setTimeout(()=>{this.reactRoot?.unmount(),this.reactRoot=null,this.api=null,this.pendingMessages=[],this.pendingUnmount=null},0)}handleMessage(t){if(!this.api){this.pendingMessages.push(t);return}this.dispatchMessage(t)}dispatchMessage(t){if(C8(t)){this.api.setStreaming(t.isStreaming);return}t.operation==="replace"?this.api.replaceContent(t.content):t.operation==="append"&&this.api.appendContent(t.content)}};function soe(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function _8(e,t){let n=e.getAttribute(t);if(n===""||n==="true")return!0;if(n==="false")return!1;let r=soe(t),i=e[r];return i===!0||i==="true"}customElements.get("shiny-markdown-stream")||customElements.define("shiny-markdown-stream",Av);window.Shiny?.addCustomMessageHandler("shinyMarkdownStreamMessage",async e=>{let t=document.getElementById(e.id);if(!t){Cv.showClientMessage({status:"error",message:`Unable to handle MarkdownStream() message since element with id ${e.id} wasn't found.`});return}!C8(e)&&e.html_deps&&await Cv.renderDependencies(e.html_deps),t.handleMessage(e)}); /*! Bundled license information: scheduler/cjs/scheduler.production.js: diff --git a/js/dist/shinychat.js.map b/js/dist/shinychat.js.map index bbc7f02a9..03225f566 100644 --- a/js/dist/shinychat.js.map +++ b/js/dist/shinychat.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../node_modules/scheduler/cjs/scheduler.production.js", "../node_modules/scheduler/index.js", "../node_modules/react/cjs/react.production.js", "../node_modules/react/index.js", "../node_modules/react-dom/cjs/react-dom.production.js", "../node_modules/react-dom/index.js", "../node_modules/react-dom/cjs/react-dom-client.production.js", "../node_modules/react-dom/client.js", "../node_modules/inline-style-parser/index.js", "../node_modules/style-to-object/src/index.ts", "../node_modules/style-to-js/src/utilities.ts", "../node_modules/style-to-js/src/index.ts", "../node_modules/react/cjs/react-jsx-runtime.production.js", "../node_modules/react/jsx-runtime.js", "../node_modules/extend/index.js", "../node_modules/highlight.js/lib/core.js", "../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js", "../node_modules/use-sync-external-store/shim/index.js", "../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js", "../node_modules/use-sync-external-store/shim/with-selector.js", "../src/chat/chat-entry.ts", "../src/chat/ChatApp.tsx", "../src/chat/context.ts", "../src/utils/uuid.ts", "../src/chat/markdown-code-ranges.ts", "../src/chat/tool-protocol.ts", "../src/chat/tool-model.ts", "../src/chat/state.ts", "../src/chat/currentConversation.ts", "../src/utils/navigate.ts", "../src/chat/useSupersededRequests.ts", "../src/chat/ChatContainer.tsx", "../node_modules/use-stick-to-bottom/dist/useStickToBottom.js", "../src/chat/ChatMessages.tsx", "../src/chat/ChatMessage.tsx", "../src/markdown/MarkdownContent.tsx", "../node_modules/html-void-elements/index.js", "../node_modules/property-information/lib/util/schema.js", "../node_modules/property-information/lib/util/merge.js", "../node_modules/property-information/lib/normalize.js", "../node_modules/property-information/lib/util/info.js", "../node_modules/property-information/lib/util/types.js", "../node_modules/property-information/lib/util/defined-info.js", "../node_modules/property-information/lib/util/create.js", "../node_modules/property-information/lib/aria.js", "../node_modules/property-information/lib/util/case-sensitive-transform.js", "../node_modules/property-information/lib/util/case-insensitive-transform.js", "../node_modules/property-information/lib/html.js", "../node_modules/property-information/lib/svg.js", "../node_modules/property-information/lib/xlink.js", "../node_modules/property-information/lib/xmlns.js", "../node_modules/property-information/lib/xml.js", "../node_modules/property-information/lib/hast-to-react.js", "../node_modules/property-information/lib/find.js", "../node_modules/property-information/index.js", "../node_modules/zwitch/index.js", "../node_modules/stringify-entities/lib/core.js", "../node_modules/stringify-entities/lib/util/to-hexadecimal.js", "../node_modules/stringify-entities/lib/util/to-decimal.js", "../node_modules/character-entities-legacy/index.js", "../node_modules/character-entities-html4/index.js", "../node_modules/stringify-entities/lib/constant/dangerous.js", "../node_modules/stringify-entities/lib/util/to-named.js", "../node_modules/stringify-entities/lib/util/format-smart.js", "../node_modules/stringify-entities/lib/index.js", "../node_modules/hast-util-to-html/lib/handle/comment.js", "../node_modules/hast-util-to-html/lib/handle/doctype.js", "../node_modules/ccount/index.js", "../node_modules/comma-separated-tokens/index.js", "../node_modules/space-separated-tokens/index.js", "../node_modules/hast-util-whitespace/lib/index.js", "../node_modules/hast-util-to-html/lib/omission/util/siblings.js", "../node_modules/hast-util-to-html/lib/omission/omission.js", "../node_modules/hast-util-to-html/lib/omission/closing.js", "../node_modules/hast-util-to-html/lib/omission/opening.js", "../node_modules/hast-util-to-html/lib/handle/element.js", "../node_modules/hast-util-to-html/lib/handle/text.js", "../node_modules/hast-util-to-html/lib/handle/raw.js", "../node_modules/hast-util-to-html/lib/handle/root.js", "../node_modules/hast-util-to-html/lib/handle/index.js", "../node_modules/hast-util-to-html/lib/index.js", "../node_modules/estree-util-is-identifier-name/lib/index.js", "../node_modules/hast-util-to-jsx-runtime/lib/index.js", "../node_modules/unist-util-position/lib/index.js", "../node_modules/unist-util-stringify-position/lib/index.js", "../node_modules/vfile-message/lib/index.js", "../node_modules/hast-util-parse-selector/lib/index.js", "../node_modules/hastscript/lib/create-h.js", "../node_modules/hastscript/lib/svg-case-sensitive-tag-names.js", "../node_modules/hastscript/lib/index.js", "../node_modules/vfile-location/lib/index.js", "../node_modules/web-namespaces/index.js", "../node_modules/hast-util-from-parse5/lib/index.js", "../src/markdown/markdownToReact.ts", "../node_modules/parse5/dist/common/unicode.js", "../node_modules/parse5/dist/common/error-codes.js", "../node_modules/parse5/dist/tokenizer/preprocessor.js", "../node_modules/parse5/dist/common/token.js", "../node_modules/entities/src/generated/decode-data-html.ts", "../node_modules/entities/src/decode-codepoint.ts", "../node_modules/entities/src/decode.ts", "../node_modules/parse5/dist/common/html.js", "../node_modules/parse5/dist/tokenizer/index.js", "../node_modules/parse5/dist/parser/open-element-stack.js", "../node_modules/parse5/dist/parser/formatting-element-list.js", "../node_modules/parse5/dist/tree-adapters/default.js", "../node_modules/parse5/dist/common/doctype.js", "../node_modules/parse5/dist/common/foreign-content.js", "../node_modules/parse5/dist/parser/index.js", "../node_modules/entities/src/escape.ts", "../node_modules/parse5/dist/serializer/index.js", "../node_modules/parse5/dist/index.js", "../node_modules/vfile/lib/minpath.browser.js", "../node_modules/vfile/lib/minproc.browser.js", "../node_modules/vfile/lib/minurl.shared.js", "../node_modules/vfile/lib/minurl.browser.js", "../node_modules/vfile/lib/index.js", "../node_modules/unist-util-is/lib/index.js", "../node_modules/unist-util-visit-parents/lib/index.js", "../node_modules/unist-util-visit/lib/index.js", "../src/markdown/urlSanitize.ts", "../src/markdown/plugins/suggestionHelpers.ts", "../src/markdown/streamingDot.ts", "../src/markdown/plugins/rehypeSuggestionCards.ts", "../src/markdown/plugins/markTrailingAsides.ts", "../src/markdown/plugins/rewriteAsideTemplate.ts", "../src/markdown/hideTrailingPartialTag.ts", "../node_modules/bail/index.js", "../node_modules/unified/lib/index.js", "../node_modules/is-plain-obj/index.js", "../node_modules/trough/lib/index.js", "../node_modules/unified/lib/callable-instance.js", "../node_modules/mdast-util-to-string/lib/index.js", "../node_modules/decode-named-character-reference/index.dom.js", "../node_modules/micromark-util-chunked/index.js", "../node_modules/micromark-util-combine-extensions/index.js", "../node_modules/micromark-util-decode-numeric-character-reference/index.js", "../node_modules/micromark-util-normalize-identifier/index.js", "../node_modules/micromark-util-character/index.js", "../node_modules/micromark-util-sanitize-uri/index.js", "../node_modules/micromark-factory-space/index.js", "../node_modules/micromark/lib/initialize/content.js", "../node_modules/micromark/lib/initialize/document.js", "../node_modules/micromark-util-classify-character/index.js", "../node_modules/micromark-util-resolve-all/index.js", "../node_modules/micromark-core-commonmark/lib/attention.js", "../node_modules/micromark-core-commonmark/lib/autolink.js", "../node_modules/micromark-core-commonmark/lib/blank-line.js", "../node_modules/micromark-core-commonmark/lib/block-quote.js", "../node_modules/micromark-core-commonmark/lib/character-escape.js", "../node_modules/micromark-core-commonmark/lib/character-reference.js", "../node_modules/micromark-core-commonmark/lib/code-fenced.js", "../node_modules/micromark-core-commonmark/lib/code-indented.js", "../node_modules/micromark-core-commonmark/lib/code-text.js", "../node_modules/micromark-util-subtokenize/lib/splice-buffer.js", "../node_modules/micromark-util-subtokenize/index.js", "../node_modules/micromark-core-commonmark/lib/content.js", "../node_modules/micromark-factory-destination/index.js", "../node_modules/micromark-factory-label/index.js", "../node_modules/micromark-factory-title/index.js", "../node_modules/micromark-factory-whitespace/index.js", "../node_modules/micromark-core-commonmark/lib/definition.js", "../node_modules/micromark-core-commonmark/lib/hard-break-escape.js", "../node_modules/micromark-core-commonmark/lib/heading-atx.js", "../node_modules/micromark-util-html-tag-name/index.js", "../node_modules/micromark-core-commonmark/lib/html-flow.js", "../node_modules/micromark-core-commonmark/lib/html-text.js", "../node_modules/micromark-core-commonmark/lib/label-end.js", "../node_modules/micromark-core-commonmark/lib/label-start-image.js", "../node_modules/micromark-core-commonmark/lib/label-start-link.js", "../node_modules/micromark-core-commonmark/lib/line-ending.js", "../node_modules/micromark-core-commonmark/lib/thematic-break.js", "../node_modules/micromark-core-commonmark/lib/list.js", "../node_modules/micromark-core-commonmark/lib/setext-underline.js", "../node_modules/micromark/lib/initialize/flow.js", "../node_modules/micromark/lib/initialize/text.js", "../node_modules/micromark/lib/constructs.js", "../node_modules/micromark/lib/create-tokenizer.js", "../node_modules/micromark/lib/parse.js", "../node_modules/micromark/lib/postprocess.js", "../node_modules/micromark/lib/preprocess.js", "../node_modules/micromark-util-decode-string/index.js", "../node_modules/mdast-util-from-markdown/lib/index.js", "../node_modules/remark-parse/lib/index.js", "../node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp/index.js", "../node_modules/mdast-util-find-and-replace/lib/index.js", "../node_modules/mdast-util-gfm-autolink-literal/lib/index.js", "../node_modules/mdast-util-gfm-footnote/lib/index.js", "../node_modules/mdast-util-gfm-strikethrough/lib/index.js", "../node_modules/markdown-table/index.js", "../node_modules/mdast-util-to-markdown/lib/handle/blockquote.js", "../node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js", "../node_modules/mdast-util-to-markdown/lib/handle/break.js", "../node_modules/longest-streak/index.js", "../node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js", "../node_modules/mdast-util-to-markdown/lib/util/check-fence.js", "../node_modules/mdast-util-to-markdown/lib/handle/code.js", "../node_modules/mdast-util-to-markdown/lib/util/check-quote.js", "../node_modules/mdast-util-to-markdown/lib/handle/definition.js", "../node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js", "../node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js", "../node_modules/mdast-util-to-markdown/lib/util/encode-info.js", "../node_modules/mdast-util-to-markdown/lib/handle/emphasis.js", "../node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js", "../node_modules/mdast-util-to-markdown/lib/handle/heading.js", "../node_modules/mdast-util-to-markdown/lib/handle/html.js", "../node_modules/mdast-util-to-markdown/lib/handle/image.js", "../node_modules/mdast-util-to-markdown/lib/handle/image-reference.js", "../node_modules/mdast-util-to-markdown/lib/handle/inline-code.js", "../node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js", "../node_modules/mdast-util-to-markdown/lib/handle/link.js", "../node_modules/mdast-util-to-markdown/lib/handle/link-reference.js", "../node_modules/mdast-util-to-markdown/lib/util/check-bullet.js", "../node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js", "../node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js", "../node_modules/mdast-util-to-markdown/lib/util/check-rule.js", "../node_modules/mdast-util-to-markdown/lib/handle/list.js", "../node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js", "../node_modules/mdast-util-to-markdown/lib/handle/list-item.js", "../node_modules/mdast-util-to-markdown/lib/handle/paragraph.js", "../node_modules/mdast-util-phrasing/lib/index.js", "../node_modules/mdast-util-to-markdown/lib/handle/root.js", "../node_modules/mdast-util-to-markdown/lib/util/check-strong.js", "../node_modules/mdast-util-to-markdown/lib/handle/strong.js", "../node_modules/mdast-util-to-markdown/lib/handle/text.js", "../node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js", "../node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js", "../node_modules/mdast-util-to-markdown/lib/handle/index.js", "../node_modules/mdast-util-gfm-table/lib/index.js", "../node_modules/mdast-util-gfm-task-list-item/lib/index.js", "../node_modules/mdast-util-gfm/lib/index.js", "../node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js", "../node_modules/micromark-extension-gfm-footnote/lib/syntax.js", "../node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js", "../node_modules/micromark-extension-gfm-table/lib/edit-map.js", "../node_modules/micromark-extension-gfm-table/lib/infer.js", "../node_modules/micromark-extension-gfm-table/lib/syntax.js", "../node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js", "../node_modules/micromark-extension-gfm/index.js", "../node_modules/remark-gfm/lib/index.js", "../node_modules/mdast-util-to-hast/lib/handlers/blockquote.js", "../node_modules/mdast-util-to-hast/lib/handlers/break.js", "../node_modules/mdast-util-to-hast/lib/handlers/code.js", "../node_modules/mdast-util-to-hast/lib/handlers/delete.js", "../node_modules/mdast-util-to-hast/lib/handlers/emphasis.js", "../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js", "../node_modules/mdast-util-to-hast/lib/handlers/heading.js", "../node_modules/mdast-util-to-hast/lib/handlers/html.js", "../node_modules/mdast-util-to-hast/lib/revert.js", "../node_modules/mdast-util-to-hast/lib/handlers/image-reference.js", "../node_modules/mdast-util-to-hast/lib/handlers/image.js", "../node_modules/mdast-util-to-hast/lib/handlers/inline-code.js", "../node_modules/mdast-util-to-hast/lib/handlers/link-reference.js", "../node_modules/mdast-util-to-hast/lib/handlers/link.js", "../node_modules/mdast-util-to-hast/lib/handlers/list-item.js", "../node_modules/mdast-util-to-hast/lib/handlers/list.js", "../node_modules/mdast-util-to-hast/lib/handlers/paragraph.js", "../node_modules/mdast-util-to-hast/lib/handlers/root.js", "../node_modules/mdast-util-to-hast/lib/handlers/strong.js", "../node_modules/mdast-util-to-hast/lib/handlers/table.js", "../node_modules/mdast-util-to-hast/lib/handlers/table-row.js", "../node_modules/mdast-util-to-hast/lib/handlers/table-cell.js", "../node_modules/trim-lines/index.js", "../node_modules/mdast-util-to-hast/lib/handlers/text.js", "../node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js", "../node_modules/mdast-util-to-hast/lib/handlers/index.js", "../node_modules/@ungap/structured-clone/esm/deserialize.js", "../node_modules/@ungap/structured-clone/esm/serialize.js", "../node_modules/@ungap/structured-clone/esm/index.js", "../node_modules/mdast-util-to-hast/lib/footer.js", "../node_modules/mdast-util-to-hast/lib/state.js", "../node_modules/mdast-util-to-hast/lib/index.js", "../node_modules/remark-rehype/lib/index.js", "../node_modules/hast-util-to-parse5/lib/index.js", "../node_modules/hast-util-raw/lib/index.js", "../node_modules/rehype-raw/lib/index.js", "../node_modules/hast-util-sanitize/lib/schema.js", "../node_modules/hast-util-sanitize/lib/index.js", "../node_modules/rehype-sanitize/lib/index.js", "../node_modules/unist-util-find-after/lib/index.js", "../node_modules/hast-util-is-element/lib/index.js", "../node_modules/hast-util-to-text/lib/index.js", "../node_modules/highlight.js/es/languages/arduino.js", "../node_modules/highlight.js/es/languages/bash.js", "../node_modules/highlight.js/es/languages/c.js", "../node_modules/highlight.js/es/languages/cpp.js", "../node_modules/highlight.js/es/languages/csharp.js", "../node_modules/highlight.js/es/languages/css.js", "../node_modules/highlight.js/es/languages/diff.js", "../node_modules/highlight.js/es/languages/go.js", "../node_modules/highlight.js/es/languages/graphql.js", "../node_modules/highlight.js/es/languages/ini.js", "../node_modules/highlight.js/es/languages/java.js", "../node_modules/highlight.js/es/languages/javascript.js", "../node_modules/highlight.js/es/languages/json.js", "../node_modules/highlight.js/es/languages/kotlin.js", "../node_modules/highlight.js/es/languages/less.js", "../node_modules/highlight.js/es/languages/lua.js", "../node_modules/highlight.js/es/languages/makefile.js", "../node_modules/highlight.js/es/languages/markdown.js", "../node_modules/highlight.js/es/languages/objectivec.js", "../node_modules/highlight.js/es/languages/perl.js", "../node_modules/highlight.js/es/languages/php.js", "../node_modules/highlight.js/es/languages/php-template.js", "../node_modules/highlight.js/es/languages/plaintext.js", "../node_modules/highlight.js/es/languages/python.js", "../node_modules/highlight.js/es/languages/python-repl.js", "../node_modules/highlight.js/es/languages/r.js", "../node_modules/highlight.js/es/languages/ruby.js", "../node_modules/highlight.js/es/languages/rust.js", "../node_modules/highlight.js/es/languages/scss.js", "../node_modules/highlight.js/es/languages/shell.js", "../node_modules/highlight.js/es/languages/sql.js", "../node_modules/highlight.js/es/languages/swift.js", "../node_modules/highlight.js/es/languages/typescript.js", "../node_modules/highlight.js/es/languages/vbnet.js", "../node_modules/highlight.js/es/languages/wasm.js", "../node_modules/highlight.js/es/languages/xml.js", "../node_modules/highlight.js/es/languages/yaml.js", "../node_modules/lowlight/lib/common.js", "../node_modules/highlight.js/es/core.js", "../node_modules/lowlight/lib/index.js", "../node_modules/rehype-highlight/lib/index.js", "../src/markdown/plugins/rehypeAccessibleSuggestions.ts", "../src/markdown/plugins/remarkEscapeHtml.ts", "../src/markdown/plugins/rehypeExternalLinks.ts", "../src/markdown/plugins/rehypeUncontrolledInputs.ts", "../src/markdown/plugins/rehypeUnwrapBlockCEs.ts", "../src/markdown/plugins/rehypeGroupWebActivity.ts", "../src/markdown/plugins/rehypeGroupAsides.ts", "../src/markdown/plugins/rehypeGroundedAsides.ts", "../src/markdown/plugins/rehypeAttachCitedSources.ts", "../src/markdown/plugins/rehypeLazyContinuation.ts", "../src/markdown/plugins/normalizeAsideMarkdown.ts", "../src/markdown/processors.ts", "../src/markdown/components/CopyableCodeBlock.tsx", "../src/markdown/components/BootstrapTable.tsx", "../src/chat/RawHTML.tsx", "../src/chat/ThinkingDisplay.tsx", "../src/chat/ToolRequest.tsx", "../src/chat/ToolCard.tsx", "../src/utils/icons.ts", "../src/chat/useFullscreen.tsx", "../src/markdown/markdownCodeBlock.ts", "../src/chat/ToolRequestBridge.tsx", "../src/chat/ToolResult.tsx", "../src/chat/ToolResultBridge.tsx", "../src/chat/Aside.tsx", "../src/chat/AsideGroup.tsx", "../node_modules/@floating-ui/react/dist/floating-ui.react.mjs", "../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs", "../node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs", "../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs", "../node_modules/tabbable/src/index.js", "../node_modules/@floating-ui/core/dist/floating-ui.core.mjs", "../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs", "../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs", "../src/chat/citationCollector.tsx", "../src/chat/domain.ts", "../src/chat/citations.ts", "../src/chat/portalTheme.ts", "../src/chat/useDismissiblePopover.ts", "../src/chat/WebActivity.tsx", "../src/chat/ChevronIcon.tsx", "../src/chat/chatTagToComponentMap.ts", "../src/chat/useFadingText.ts", "../src/chat/usePrefersReducedMotion.ts", "../src/chat/ToolGroup.tsx", "../src/chat/tool-presentation.ts", "../src/chat/CommandChip.tsx", "../src/chat/attachment-types.json", "../src/chat/attachments.ts", "../src/chat/TextAttachmentPreview.tsx", "../src/chat/AttachmentLightbox.tsx", "../src/chat/TiptapInput.tsx", "../node_modules/@tiptap/react/src/Context.tsx", "../node_modules/@tiptap/react/src/EditorContent.tsx", "../node_modules/@tiptap/react/src/useEditor.ts", "../node_modules/@tiptap/react/src/useEditorState.ts", "../node_modules/@tiptap/react/src/useReactNodeView.ts", "../node_modules/@tiptap/react/src/NodeViewContent.tsx", "../node_modules/@tiptap/react/src/NodeViewWrapper.tsx", "../node_modules/@tiptap/react/src/ReactMarkViewRenderer.tsx", "../node_modules/@tiptap/react/src/ReactRenderer.tsx", "../node_modules/@tiptap/react/src/ReactNodeViewRenderer.tsx", "../node_modules/@tiptap/react/src/Tiptap.tsx", "../node_modules/@tiptap/react/src/index.ts", "../node_modules/orderedmap/dist/index.js", "../node_modules/prosemirror-model/dist/index.js", "../node_modules/prosemirror-transform/dist/index.js", "../node_modules/prosemirror-state/dist/index.js", "../node_modules/prosemirror-commands/dist/index.js", "../node_modules/prosemirror-schema-list/dist/index.js", "../node_modules/prosemirror-view/dist/index.js", "../node_modules/w3c-keyname/index.js", "../node_modules/prosemirror-keymap/dist/index.js", "../node_modules/@tiptap/core/src/helpers/createChainableState.ts", "../node_modules/@tiptap/core/src/CommandManager.ts", "../node_modules/@tiptap/core/src/commands/index.ts", "../node_modules/@tiptap/core/src/commands/blur.ts", "../node_modules/@tiptap/core/src/commands/clearContent.ts", "../node_modules/@tiptap/core/src/commands/clearNodes.ts", "../node_modules/@tiptap/core/src/commands/command.ts", "../node_modules/@tiptap/core/src/commands/createParagraphNear.ts", "../node_modules/@tiptap/core/src/commands/cut.ts", "../node_modules/@tiptap/core/src/commands/deleteCurrentNode.ts", "../node_modules/@tiptap/core/src/helpers/getNodeType.ts", "../node_modules/@tiptap/core/src/commands/deleteNode.ts", "../node_modules/@tiptap/core/src/commands/deleteRange.ts", "../node_modules/@tiptap/core/src/commands/deleteSelection.ts", "../node_modules/@tiptap/core/src/commands/enter.ts", "../node_modules/@tiptap/core/src/commands/exitCode.ts", "../node_modules/@tiptap/core/src/commands/extendMarkRange.ts", "../node_modules/@tiptap/core/src/utilities/isRegExp.ts", "../node_modules/@tiptap/core/src/utilities/objectIncludes.ts", "../node_modules/@tiptap/core/src/helpers/getMarkRange.ts", "../node_modules/@tiptap/core/src/helpers/getMarkType.ts", "../node_modules/@tiptap/core/src/commands/first.ts", "../node_modules/@tiptap/core/src/helpers/isTextSelection.ts", "../node_modules/@tiptap/core/src/helpers/resolveFocusPosition.ts", "../node_modules/@tiptap/core/src/utilities/minMax.ts", "../node_modules/@tiptap/core/src/utilities/isAndroid.ts", "../node_modules/@tiptap/core/src/utilities/isiOS.ts", "../node_modules/@tiptap/core/src/utilities/isSafari.ts", "../node_modules/@tiptap/core/src/commands/focus.ts", "../node_modules/@tiptap/core/src/commands/forEach.ts", "../node_modules/@tiptap/core/src/commands/insertContent.ts", "../node_modules/@tiptap/core/src/commands/insertContentAt.ts", "../node_modules/@tiptap/core/src/helpers/createNodeFromContent.ts", "../node_modules/@tiptap/core/src/utilities/elementFromString.ts", "../node_modules/@tiptap/core/src/helpers/selectionToInsertionEnd.ts", "../node_modules/@tiptap/core/src/commands/join.ts", "../node_modules/@tiptap/core/src/commands/joinItemBackward.ts", "../node_modules/@tiptap/core/src/commands/joinItemForward.ts", "../node_modules/@tiptap/core/src/commands/joinTextblockBackward.ts", "../node_modules/@tiptap/core/src/commands/joinTextblockForward.ts", "../node_modules/@tiptap/core/src/utilities/isMacOS.ts", "../node_modules/@tiptap/core/src/commands/keyboardShortcut.ts", "../node_modules/@tiptap/core/src/commands/lift.ts", "../node_modules/@tiptap/core/src/helpers/isNodeActive.ts", "../node_modules/@tiptap/core/src/commands/liftEmptyBlock.ts", "../node_modules/@tiptap/core/src/commands/liftListItem.ts", "../node_modules/@tiptap/core/src/commands/newlineInCode.ts", "../node_modules/@tiptap/core/src/helpers/getSchemaTypeNameByName.ts", "../node_modules/@tiptap/core/src/utilities/deleteProps.ts", "../node_modules/@tiptap/core/src/commands/resetAttributes.ts", "../node_modules/@tiptap/core/src/commands/scrollIntoView.ts", "../node_modules/@tiptap/core/src/commands/selectAll.ts", "../node_modules/@tiptap/core/src/commands/selectNodeBackward.ts", "../node_modules/@tiptap/core/src/commands/selectNodeForward.ts", "../node_modules/@tiptap/core/src/commands/selectParentNode.ts", "../node_modules/@tiptap/core/src/commands/selectTextblockEnd.ts", "../node_modules/@tiptap/core/src/commands/selectTextblockStart.ts", "../node_modules/@tiptap/core/src/helpers/createDocument.ts", "../node_modules/@tiptap/core/src/commands/setContent.ts", "../node_modules/@tiptap/core/src/helpers/getMarkAttributes.ts", "../node_modules/@tiptap/core/src/helpers/combineTransactionSteps.ts", "../node_modules/@tiptap/core/src/helpers/defaultBlockAt.ts", "../node_modules/@tiptap/core/src/helpers/findChildren.ts", "../node_modules/@tiptap/core/src/helpers/findChildrenInRange.ts", "../node_modules/@tiptap/core/src/helpers/findParentNodeClosestToPos.ts", "../node_modules/@tiptap/core/src/helpers/findParentNode.ts", "../node_modules/@tiptap/core/src/helpers/getExtensionField.ts", "../node_modules/@tiptap/core/src/helpers/flattenExtensions.ts", "../node_modules/@tiptap/core/src/helpers/generateHTML.ts", "../node_modules/@tiptap/core/src/helpers/getHTMLFromFragment.ts", "../node_modules/@tiptap/core/src/helpers/getSchemaByResolvedExtensions.ts", "../node_modules/@tiptap/core/src/utilities/isFunction.ts", "../node_modules/@tiptap/core/src/utilities/callOrReturn.ts", "../node_modules/@tiptap/core/src/utilities/isEmptyObject.ts", "../node_modules/@tiptap/core/src/helpers/splitExtensions.ts", "../node_modules/@tiptap/core/src/helpers/getAttributesFromExtensions.ts", "../node_modules/@tiptap/core/src/utilities/mergeAttributes.ts", "../node_modules/@tiptap/core/src/helpers/getRenderedAttributes.ts", "../node_modules/@tiptap/core/src/utilities/fromString.ts", "../node_modules/@tiptap/core/src/helpers/injectExtensionAttributesToParseRule.ts", "../node_modules/@tiptap/core/src/utilities/findDuplicates.ts", "../node_modules/@tiptap/core/src/helpers/sortExtensions.ts", "../node_modules/@tiptap/core/src/helpers/resolveExtensions.ts", "../node_modules/@tiptap/core/src/helpers/getSchema.ts", "../node_modules/@tiptap/core/src/helpers/generateJSON.ts", "../node_modules/@tiptap/core/src/helpers/generateText.ts", "../node_modules/@tiptap/core/src/helpers/getTextBetween.ts", "../node_modules/@tiptap/core/src/helpers/getText.ts", "../node_modules/@tiptap/core/src/helpers/getTextSerializersFromSchema.ts", "../node_modules/@tiptap/core/src/helpers/getNodeAttributes.ts", "../node_modules/@tiptap/core/src/helpers/getAttributes.ts", "../node_modules/@tiptap/core/src/utilities/removeDuplicates.ts", "../node_modules/@tiptap/core/src/helpers/getChangedRanges.ts", "../node_modules/@tiptap/core/src/helpers/getDebugJSON.ts", "../node_modules/@tiptap/core/src/helpers/getMarksBetween.ts", "../node_modules/@tiptap/core/src/helpers/getNodeAtPosition.ts", "../node_modules/@tiptap/core/src/helpers/getSchemaTypeByName.ts", "../node_modules/@tiptap/core/src/helpers/getSplittedAttributes.ts", "../node_modules/@tiptap/core/src/helpers/getTextContentFromNodes.ts", "../node_modules/@tiptap/core/src/helpers/isMarkActive.ts", "../node_modules/@tiptap/core/src/helpers/isActive.ts", "../node_modules/@tiptap/core/src/helpers/isAtEndOfNode.ts", "../node_modules/@tiptap/core/src/helpers/isAtStartOfNode.ts", "../node_modules/@tiptap/core/src/helpers/isExtensionRulesEnabled.ts", "../node_modules/@tiptap/core/src/helpers/isList.ts", "../node_modules/@tiptap/core/src/helpers/isNodeEmpty.ts", "../node_modules/@tiptap/core/src/helpers/isNodeSelection.ts", "../node_modules/@tiptap/core/src/helpers/isNodeViewSelected.ts", "../node_modules/@tiptap/core/src/helpers/MappablePosition.ts", "../node_modules/@tiptap/core/src/helpers/posToDOMRect.ts", "../node_modules/@tiptap/core/src/helpers/rewriteUnknownContent.ts", "../node_modules/@tiptap/core/src/commands/setMark.ts", "../node_modules/@tiptap/core/src/commands/setMeta.ts", "../node_modules/@tiptap/core/src/commands/setNode.ts", "../node_modules/@tiptap/core/src/commands/setNodeSelection.ts", "../node_modules/@tiptap/core/src/commands/setTextDirection.ts", "../node_modules/@tiptap/core/src/commands/setTextSelection.ts", "../node_modules/@tiptap/core/src/commands/sinkListItem.ts", "../node_modules/@tiptap/core/src/commands/splitBlock.ts", "../node_modules/@tiptap/core/src/commands/splitListItem.ts", "../node_modules/@tiptap/core/src/commands/toggleList.ts", "../node_modules/@tiptap/core/src/commands/toggleMark.ts", "../node_modules/@tiptap/core/src/commands/toggleNode.ts", "../node_modules/@tiptap/core/src/commands/toggleWrap.ts", "../node_modules/@tiptap/core/src/commands/undoInputRule.ts", "../node_modules/@tiptap/core/src/commands/unsetAllMarks.ts", "../node_modules/@tiptap/core/src/commands/unsetMark.ts", "../node_modules/@tiptap/core/src/commands/unsetTextDirection.ts", "../node_modules/@tiptap/core/src/commands/updateAttributes.ts", "../node_modules/@tiptap/core/src/commands/wrapIn.ts", "../node_modules/@tiptap/core/src/commands/wrapInList.ts", "../node_modules/@tiptap/core/src/Editor.ts", "../node_modules/@tiptap/core/src/EventEmitter.ts", "../node_modules/@tiptap/core/src/ExtensionManager.ts", "../node_modules/@tiptap/core/src/InputRule.ts", "../node_modules/@tiptap/core/src/utilities/isPlainObject.ts", "../node_modules/@tiptap/core/src/utilities/mergeDeep.ts", "../node_modules/@tiptap/core/src/Extendable.ts", "../node_modules/@tiptap/core/src/Mark.ts", "../node_modules/@tiptap/core/src/PasteRule.ts", "../node_modules/@tiptap/core/src/utilities/isNumber.ts", "../node_modules/@tiptap/core/src/extensions/index.ts", "../node_modules/@tiptap/core/src/extensions/clipboardTextSerializer.ts", "../node_modules/@tiptap/core/src/Extension.ts", "../node_modules/@tiptap/core/src/extensions/commands.ts", "../node_modules/@tiptap/core/src/extensions/delete.ts", "../node_modules/@tiptap/core/src/extensions/drop.ts", "../node_modules/@tiptap/core/src/extensions/editable.ts", "../node_modules/@tiptap/core/src/extensions/focusEvents.ts", "../node_modules/@tiptap/core/src/extensions/keymap.ts", "../node_modules/@tiptap/core/src/extensions/paste.ts", "../node_modules/@tiptap/core/src/extensions/tabindex.ts", "../node_modules/@tiptap/core/src/extensions/textDirection.ts", "../node_modules/@tiptap/core/src/NodePos.ts", "../node_modules/@tiptap/core/src/style.ts", "../node_modules/@tiptap/core/src/utilities/createStyleTag.ts", "../node_modules/@tiptap/core/src/inputRules/markInputRule.ts", "../node_modules/@tiptap/core/src/inputRules/nodeInputRule.ts", "../node_modules/@tiptap/core/src/inputRules/textblockTypeInputRule.ts", "../node_modules/@tiptap/core/src/inputRules/textInputRule.ts", "../node_modules/@tiptap/core/src/inputRules/wrappingInputRule.ts", "../node_modules/@tiptap/core/src/jsx-runtime.ts", "../node_modules/@tiptap/core/src/lib/ResizableNodeView.ts", "../node_modules/@tiptap/core/src/utilities/attrsEqual.ts", "../node_modules/@tiptap/core/src/utilities/canInsertNode.ts", "../node_modules/@tiptap/core/src/utilities/escapeForRegEx.ts", "../node_modules/@tiptap/core/src/utilities/getStyleProperty.ts", "../node_modules/@tiptap/core/src/utilities/htmlEntities.ts", "../node_modules/@tiptap/core/src/utilities/isFirefox.ts", "../node_modules/@tiptap/core/src/utilities/isString.ts", "../node_modules/@tiptap/core/src/utilities/markdown/index.ts", "../node_modules/@tiptap/core/src/utilities/markdown/attributeUtils.ts", "../node_modules/@tiptap/core/src/utilities/markdown/createAtomBlockMarkdownSpec.ts", "../node_modules/@tiptap/core/src/utilities/markdown/createBlockMarkdownSpec.ts", "../node_modules/@tiptap/core/src/utilities/markdown/createInlineMarkdownSpec.ts", "../node_modules/@tiptap/core/src/utilities/markdown/parseIndentedBlocks.ts", "../node_modules/@tiptap/core/src/utilities/markdown/renderNestedMarkdownContent.ts", "../node_modules/@tiptap/core/src/utilities/marksEqual.ts", "../node_modules/@tiptap/core/src/MarkView.ts", "../node_modules/@tiptap/core/src/Node.ts", "../node_modules/@tiptap/core/src/NodeView.ts", "../node_modules/@tiptap/core/src/pasteRules/markPasteRule.ts", "../node_modules/@tiptap/core/src/pasteRules/nodePasteRule.ts", "../node_modules/@tiptap/core/src/pasteRules/textPasteRule.ts", "../node_modules/@tiptap/core/src/Tracker.ts", "../node_modules/src/utils.ts", "../node_modules/src/equals.ts", "../node_modules/src/comparator.ts", "../node_modules/src/index.ts", "../node_modules/@tiptap/extension-document/src/document.ts", "../node_modules/@tiptap/extension-document/src/index.ts", "../node_modules/@tiptap/extension-text/src/text.ts", "../node_modules/@tiptap/extension-text/src/index.ts", "../node_modules/@tiptap/extension-hard-break/src/hard-break.ts", "../node_modules/@tiptap/extension-hard-break/src/index.ts", "../node_modules/rope-sequence/dist/index.js", "../node_modules/prosemirror-history/dist/index.js", "../node_modules/@tiptap/extensions/src/undo-redo/undo-redo.ts", "../node_modules/@tiptap/suggestion/src/suggestion.ts", "../node_modules/@tiptap/suggestion/src/findSuggestionMatch.ts", "../node_modules/@tiptap/suggestion/src/index.ts", "../src/chat/tiptap/commandMention.ts", "../src/chat/tiptap/suggestionRender.tsx", "../src/chat/SlashCommandPalette.tsx", "../src/chat/useInputHistory.ts", "../src/chat/useAttachmentStaging.ts", "../src/chat/AttachmentTray.tsx", "../src/chat/SourcesSummary.tsx", "../src/chat/MessageErrorBoundary.tsx", "../src/chat/ChatGreeting.tsx", "../src/chat/ChatInput.tsx", "../src/chat/ScrollToBottomButton.tsx", "../src/chat/ExternalLinkDialog.tsx", "../src/chat/RawDOM.tsx", "../src/chat/ChatHistoryDrawer.tsx", "../src/chat/useFillPaddingTransfer.ts", "../src/chat/useOverlapNudge.ts", "../src/transport/types.ts", "../src/transport/shiny-transport.ts", "../src/markdown-stream/markdown-stream-entry.ts", "../src/markdown-stream/MarkdownStream.tsx", "../src/markdown/useAutoScroll.ts"], - "sourcesContent": ["/**\n * @license React\n * scheduler.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nfunction push(heap, node) {\n var index = heap.length;\n heap.push(node);\n a: for (; 0 < index; ) {\n var parentIndex = (index - 1) >>> 1,\n parent = heap[parentIndex];\n if (0 < compare(parent, node))\n (heap[parentIndex] = node), (heap[index] = parent), (index = parentIndex);\n else break a;\n }\n}\nfunction peek(heap) {\n return 0 === heap.length ? null : heap[0];\n}\nfunction pop(heap) {\n if (0 === heap.length) return null;\n var first = heap[0],\n last = heap.pop();\n if (last !== first) {\n heap[0] = last;\n a: for (\n var index = 0, length = heap.length, halfLength = length >>> 1;\n index < halfLength;\n\n ) {\n var leftIndex = 2 * (index + 1) - 1,\n left = heap[leftIndex],\n rightIndex = leftIndex + 1,\n right = heap[rightIndex];\n if (0 > compare(left, last))\n rightIndex < length && 0 > compare(right, left)\n ? ((heap[index] = right),\n (heap[rightIndex] = last),\n (index = rightIndex))\n : ((heap[index] = left),\n (heap[leftIndex] = last),\n (index = leftIndex));\n else if (rightIndex < length && 0 > compare(right, last))\n (heap[index] = right), (heap[rightIndex] = last), (index = rightIndex);\n else break a;\n }\n }\n return first;\n}\nfunction compare(a, b) {\n var diff = a.sortIndex - b.sortIndex;\n return 0 !== diff ? diff : a.id - b.id;\n}\nexports.unstable_now = void 0;\nif (\"object\" === typeof performance && \"function\" === typeof performance.now) {\n var localPerformance = performance;\n exports.unstable_now = function () {\n return localPerformance.now();\n };\n} else {\n var localDate = Date,\n initialTime = localDate.now();\n exports.unstable_now = function () {\n return localDate.now() - initialTime;\n };\n}\nvar taskQueue = [],\n timerQueue = [],\n taskIdCounter = 1,\n currentTask = null,\n currentPriorityLevel = 3,\n isPerformingWork = !1,\n isHostCallbackScheduled = !1,\n isHostTimeoutScheduled = !1,\n needsPaint = !1,\n localSetTimeout = \"function\" === typeof setTimeout ? setTimeout : null,\n localClearTimeout = \"function\" === typeof clearTimeout ? clearTimeout : null,\n localSetImmediate = \"undefined\" !== typeof setImmediate ? setImmediate : null;\nfunction advanceTimers(currentTime) {\n for (var timer = peek(timerQueue); null !== timer; ) {\n if (null === timer.callback) pop(timerQueue);\n else if (timer.startTime <= currentTime)\n pop(timerQueue),\n (timer.sortIndex = timer.expirationTime),\n push(taskQueue, timer);\n else break;\n timer = peek(timerQueue);\n }\n}\nfunction handleTimeout(currentTime) {\n isHostTimeoutScheduled = !1;\n advanceTimers(currentTime);\n if (!isHostCallbackScheduled)\n if (null !== peek(taskQueue))\n (isHostCallbackScheduled = !0),\n isMessageLoopRunning ||\n ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline());\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);\n }\n}\nvar isMessageLoopRunning = !1,\n taskTimeoutID = -1,\n frameInterval = 5,\n startTime = -1;\nfunction shouldYieldToHost() {\n return needsPaint\n ? !0\n : exports.unstable_now() - startTime < frameInterval\n ? !1\n : !0;\n}\nfunction performWorkUntilDeadline() {\n needsPaint = !1;\n if (isMessageLoopRunning) {\n var currentTime = exports.unstable_now();\n startTime = currentTime;\n var hasMoreWork = !0;\n try {\n a: {\n isHostCallbackScheduled = !1;\n isHostTimeoutScheduled &&\n ((isHostTimeoutScheduled = !1),\n localClearTimeout(taskTimeoutID),\n (taskTimeoutID = -1));\n isPerformingWork = !0;\n var previousPriorityLevel = currentPriorityLevel;\n try {\n b: {\n advanceTimers(currentTime);\n for (\n currentTask = peek(taskQueue);\n null !== currentTask &&\n !(\n currentTask.expirationTime > currentTime && shouldYieldToHost()\n );\n\n ) {\n var callback = currentTask.callback;\n if (\"function\" === typeof callback) {\n currentTask.callback = null;\n currentPriorityLevel = currentTask.priorityLevel;\n var continuationCallback = callback(\n currentTask.expirationTime <= currentTime\n );\n currentTime = exports.unstable_now();\n if (\"function\" === typeof continuationCallback) {\n currentTask.callback = continuationCallback;\n advanceTimers(currentTime);\n hasMoreWork = !0;\n break b;\n }\n currentTask === peek(taskQueue) && pop(taskQueue);\n advanceTimers(currentTime);\n } else pop(taskQueue);\n currentTask = peek(taskQueue);\n }\n if (null !== currentTask) hasMoreWork = !0;\n else {\n var firstTimer = peek(timerQueue);\n null !== firstTimer &&\n requestHostTimeout(\n handleTimeout,\n firstTimer.startTime - currentTime\n );\n hasMoreWork = !1;\n }\n }\n break a;\n } finally {\n (currentTask = null),\n (currentPriorityLevel = previousPriorityLevel),\n (isPerformingWork = !1);\n }\n hasMoreWork = void 0;\n }\n } finally {\n hasMoreWork\n ? schedulePerformWorkUntilDeadline()\n : (isMessageLoopRunning = !1);\n }\n }\n}\nvar schedulePerformWorkUntilDeadline;\nif (\"function\" === typeof localSetImmediate)\n schedulePerformWorkUntilDeadline = function () {\n localSetImmediate(performWorkUntilDeadline);\n };\nelse if (\"undefined\" !== typeof MessageChannel) {\n var channel = new MessageChannel(),\n port = channel.port2;\n channel.port1.onmessage = performWorkUntilDeadline;\n schedulePerformWorkUntilDeadline = function () {\n port.postMessage(null);\n };\n} else\n schedulePerformWorkUntilDeadline = function () {\n localSetTimeout(performWorkUntilDeadline, 0);\n };\nfunction requestHostTimeout(callback, ms) {\n taskTimeoutID = localSetTimeout(function () {\n callback(exports.unstable_now());\n }, ms);\n}\nexports.unstable_IdlePriority = 5;\nexports.unstable_ImmediatePriority = 1;\nexports.unstable_LowPriority = 4;\nexports.unstable_NormalPriority = 3;\nexports.unstable_Profiling = null;\nexports.unstable_UserBlockingPriority = 2;\nexports.unstable_cancelCallback = function (task) {\n task.callback = null;\n};\nexports.unstable_forceFrameRate = function (fps) {\n 0 > fps || 125 < fps\n ? console.error(\n \"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"\n )\n : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5);\n};\nexports.unstable_getCurrentPriorityLevel = function () {\n return currentPriorityLevel;\n};\nexports.unstable_next = function (eventHandler) {\n switch (currentPriorityLevel) {\n case 1:\n case 2:\n case 3:\n var priorityLevel = 3;\n break;\n default:\n priorityLevel = currentPriorityLevel;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n};\nexports.unstable_requestPaint = function () {\n needsPaint = !0;\n};\nexports.unstable_runWithPriority = function (priorityLevel, eventHandler) {\n switch (priorityLevel) {\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n break;\n default:\n priorityLevel = 3;\n }\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = priorityLevel;\n try {\n return eventHandler();\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n};\nexports.unstable_scheduleCallback = function (\n priorityLevel,\n callback,\n options\n) {\n var currentTime = exports.unstable_now();\n \"object\" === typeof options && null !== options\n ? ((options = options.delay),\n (options =\n \"number\" === typeof options && 0 < options\n ? currentTime + options\n : currentTime))\n : (options = currentTime);\n switch (priorityLevel) {\n case 1:\n var timeout = -1;\n break;\n case 2:\n timeout = 250;\n break;\n case 5:\n timeout = 1073741823;\n break;\n case 4:\n timeout = 1e4;\n break;\n default:\n timeout = 5e3;\n }\n timeout = options + timeout;\n priorityLevel = {\n id: taskIdCounter++,\n callback: callback,\n priorityLevel: priorityLevel,\n startTime: options,\n expirationTime: timeout,\n sortIndex: -1\n };\n options > currentTime\n ? ((priorityLevel.sortIndex = options),\n push(timerQueue, priorityLevel),\n null === peek(taskQueue) &&\n priorityLevel === peek(timerQueue) &&\n (isHostTimeoutScheduled\n ? (localClearTimeout(taskTimeoutID), (taskTimeoutID = -1))\n : (isHostTimeoutScheduled = !0),\n requestHostTimeout(handleTimeout, options - currentTime)))\n : ((priorityLevel.sortIndex = timeout),\n push(taskQueue, priorityLevel),\n isHostCallbackScheduled ||\n isPerformingWork ||\n ((isHostCallbackScheduled = !0),\n isMessageLoopRunning ||\n ((isMessageLoopRunning = !0), schedulePerformWorkUntilDeadline())));\n return priorityLevel;\n};\nexports.unstable_shouldYield = shouldYieldToHost;\nexports.unstable_wrapCallback = function (callback) {\n var parentPriorityLevel = currentPriorityLevel;\n return function () {\n var previousPriorityLevel = currentPriorityLevel;\n currentPriorityLevel = parentPriorityLevel;\n try {\n return callback.apply(this, arguments);\n } finally {\n currentPriorityLevel = previousPriorityLevel;\n }\n };\n};\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n", "/**\n * @license React\n * react.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar ReactNoopUpdateQueue = {\n isMounted: function () {\n return !1;\n },\n enqueueForceUpdate: function () {},\n enqueueReplaceState: function () {},\n enqueueSetState: function () {}\n },\n assign = Object.assign,\n emptyObject = {};\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nComponent.prototype.isReactComponent = {};\nComponent.prototype.setState = function (partialState, callback) {\n if (\n \"object\" !== typeof partialState &&\n \"function\" !== typeof partialState &&\n null != partialState\n )\n throw Error(\n \"takes an object of state variables to update or a function which returns an object of state variables.\"\n );\n this.updater.enqueueSetState(this, partialState, callback, \"setState\");\n};\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, \"forceUpdate\");\n};\nfunction ComponentDummy() {}\nComponentDummy.prototype = Component.prototype;\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\nvar pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());\npureComponentPrototype.constructor = PureComponent;\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = !0;\nvar isArrayImpl = Array.isArray;\nfunction noop() {}\nvar ReactSharedInternals = { H: null, A: null, T: null, S: null },\n hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction ReactElement(type, key, props) {\n var refProp = props.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== refProp ? refProp : null,\n props: props\n };\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n return ReactElement(oldElement.type, newKey, oldElement.props);\n}\nfunction isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n}\nfunction escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n}\nvar userProvidedKeyEscapeRegex = /\\/+/g;\nfunction getElementKey(element, index) {\n return \"object\" === typeof element && null !== element && null != element.key\n ? escape(\"\" + element.key)\n : index.toString(36);\n}\nfunction resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop, noop)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n}\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback)\n return (\n (callback = callback(children)),\n (invokeCallback =\n \"\" === nameSoFar ? \".\" + getElementKey(children, 0) : nameSoFar),\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != invokeCallback &&\n (escapedPrefix =\n invokeCallback.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (callback = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (children && children.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n invokeCallback\n )),\n array.push(callback)),\n 1\n );\n invokeCallback = 0;\n var nextNamePrefix = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = nextNamePrefix + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n children = i.call(children), i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = nextNamePrefix + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n \"Objects are not valid as a React child (found: \" +\n (\"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array) +\n \"). If you meant to render a collection of children, use an array instead.\"\n );\n }\n return invokeCallback;\n}\nfunction mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\nfunction lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ctor = payload._result;\n ctor = ctor();\n ctor.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 1), (payload._result = moduleObject);\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status)\n (payload._status = 2), (payload._result = error);\n }\n );\n -1 === payload._status && ((payload._status = 0), (payload._result = ctor));\n }\n if (1 === payload._status) return payload._result.default;\n throw payload._result;\n}\nvar reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n },\n Children = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children))\n throw Error(\n \"React.Children.only expected to receive a single React element child.\"\n );\n return children;\n }\n };\nexports.Activity = REACT_ACTIVITY_TYPE;\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\nexports.__COMPILER_RUNTIME = {\n __proto__: null,\n c: function (size) {\n return ReactSharedInternals.H.useMemoCache(size);\n }\n};\nexports.cache = function (fn) {\n return function () {\n return fn.apply(null, arguments);\n };\n};\nexports.cacheSignal = function () {\n return null;\n};\nexports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(\n \"The argument must be a React element, but you passed \" + element + \".\"\n );\n var props = assign({}, element.props),\n key = element.key;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n for (var childArray = Array(propName), i = 0; i < propName; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n return ReactElement(element.type, key, props);\n};\nexports.createContext = function (defaultValue) {\n defaultValue = {\n $$typeof: REACT_CONTEXT_TYPE,\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n _threadCount: 0,\n Provider: null,\n Consumer: null\n };\n defaultValue.Provider = defaultValue;\n defaultValue.Consumer = {\n $$typeof: REACT_CONSUMER_TYPE,\n _context: defaultValue\n };\n return defaultValue;\n};\nexports.createElement = function (type, config, children) {\n var propName,\n props = {},\n key = null;\n if (null != config)\n for (propName in (void 0 !== config.key && (key = \"\" + config.key), config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (props[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) props.children = children;\n else if (1 < childrenLength) {\n for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)\n childArray[i] = arguments[i + 2];\n props.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === props[propName] &&\n (props[propName] = childrenLength[propName]);\n return ReactElement(type, key, props);\n};\nexports.createRef = function () {\n return { current: null };\n};\nexports.forwardRef = function (render) {\n return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };\n};\nexports.isValidElement = isValidElement;\nexports.lazy = function (ctor) {\n return {\n $$typeof: REACT_LAZY_TYPE,\n _payload: { _status: -1, _result: ctor },\n _init: lazyInitializer\n };\n};\nexports.memo = function (type, compare) {\n return {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n};\nexports.startTransition = function (scope) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = scope(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n returnValue.then(noop, reportGlobalError);\n } catch (error) {\n reportGlobalError(error);\n } finally {\n null !== prevTransition &&\n null !== currentTransition.types &&\n (prevTransition.types = currentTransition.types),\n (ReactSharedInternals.T = prevTransition);\n }\n};\nexports.unstable_useCacheRefresh = function () {\n return ReactSharedInternals.H.useCacheRefresh();\n};\nexports.use = function (usable) {\n return ReactSharedInternals.H.use(usable);\n};\nexports.useActionState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useActionState(action, initialState, permalink);\n};\nexports.useCallback = function (callback, deps) {\n return ReactSharedInternals.H.useCallback(callback, deps);\n};\nexports.useContext = function (Context) {\n return ReactSharedInternals.H.useContext(Context);\n};\nexports.useDebugValue = function () {};\nexports.useDeferredValue = function (value, initialValue) {\n return ReactSharedInternals.H.useDeferredValue(value, initialValue);\n};\nexports.useEffect = function (create, deps) {\n return ReactSharedInternals.H.useEffect(create, deps);\n};\nexports.useEffectEvent = function (callback) {\n return ReactSharedInternals.H.useEffectEvent(callback);\n};\nexports.useId = function () {\n return ReactSharedInternals.H.useId();\n};\nexports.useImperativeHandle = function (ref, create, deps) {\n return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);\n};\nexports.useInsertionEffect = function (create, deps) {\n return ReactSharedInternals.H.useInsertionEffect(create, deps);\n};\nexports.useLayoutEffect = function (create, deps) {\n return ReactSharedInternals.H.useLayoutEffect(create, deps);\n};\nexports.useMemo = function (create, deps) {\n return ReactSharedInternals.H.useMemo(create, deps);\n};\nexports.useOptimistic = function (passthrough, reducer) {\n return ReactSharedInternals.H.useOptimistic(passthrough, reducer);\n};\nexports.useReducer = function (reducer, initialArg, init) {\n return ReactSharedInternals.H.useReducer(reducer, initialArg, init);\n};\nexports.useRef = function (initialValue) {\n return ReactSharedInternals.H.useRef(initialValue);\n};\nexports.useState = function (initialState) {\n return ReactSharedInternals.H.useState(initialState);\n};\nexports.useSyncExternalStore = function (\n subscribe,\n getSnapshot,\n getServerSnapshot\n) {\n return ReactSharedInternals.H.useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot\n );\n};\nexports.useTransition = function () {\n return ReactSharedInternals.H.useTransition();\n};\nexports.version = \"19.2.4\";\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n", "/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(formatProdErrorMessage(522));\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\");\nfunction createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key: null == key ? null : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(formatProdErrorMessage(299));\n return createPortal$1(children, container, null, key);\n};\nexports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f();\n }\n};\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0\n });\n } else Internals.d.m(href);\n};\nexports.requestFormReset = function (form) {\n Internals.d.r(form);\n};\nexports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n};\nexports.useFormState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useFormState(action, initialState, permalink);\n};\nexports.useFormStatus = function () {\n return ReactSharedInternals.H.useHostTransitionStatus();\n};\nexports.version = \"19.2.4\";\n", "'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n", "/**\n * @license React\n * react-dom-client.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n\"use strict\";\nvar Scheduler = require(\"scheduler\"),\n React = require(\"react\"),\n ReactDOM = require(\"react-dom\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction isValidContainer(node) {\n return !(\n !node ||\n (1 !== node.nodeType && 9 !== node.nodeType && 11 !== node.nodeType)\n );\n}\nfunction getNearestMountedFiber(fiber) {\n var node = fiber,\n nearestMounted = fiber;\n if (fiber.alternate) for (; node.return; ) node = node.return;\n else {\n fiber = node;\n do\n (node = fiber),\n 0 !== (node.flags & 4098) && (nearestMounted = node.return),\n (fiber = node.return);\n while (fiber);\n }\n return 3 === node.tag ? nearestMounted : null;\n}\nfunction getSuspenseInstanceFromFiber(fiber) {\n if (13 === fiber.tag) {\n var suspenseState = fiber.memoizedState;\n null === suspenseState &&\n ((fiber = fiber.alternate),\n null !== fiber && (suspenseState = fiber.memoizedState));\n if (null !== suspenseState) return suspenseState.dehydrated;\n }\n return null;\n}\nfunction getActivityInstanceFromFiber(fiber) {\n if (31 === fiber.tag) {\n var activityState = fiber.memoizedState;\n null === activityState &&\n ((fiber = fiber.alternate),\n null !== fiber && (activityState = fiber.memoizedState));\n if (null !== activityState) return activityState.dehydrated;\n }\n return null;\n}\nfunction assertIsMounted(fiber) {\n if (getNearestMountedFiber(fiber) !== fiber)\n throw Error(formatProdErrorMessage(188));\n}\nfunction findCurrentFiberUsingSlowPath(fiber) {\n var alternate = fiber.alternate;\n if (!alternate) {\n alternate = getNearestMountedFiber(fiber);\n if (null === alternate) throw Error(formatProdErrorMessage(188));\n return alternate !== fiber ? null : fiber;\n }\n for (var a = fiber, b = alternate; ; ) {\n var parentA = a.return;\n if (null === parentA) break;\n var parentB = parentA.alternate;\n if (null === parentB) {\n b = parentA.return;\n if (null !== b) {\n a = b;\n continue;\n }\n break;\n }\n if (parentA.child === parentB.child) {\n for (parentB = parentA.child; parentB; ) {\n if (parentB === a) return assertIsMounted(parentA), fiber;\n if (parentB === b) return assertIsMounted(parentA), alternate;\n parentB = parentB.sibling;\n }\n throw Error(formatProdErrorMessage(188));\n }\n if (a.return !== b.return) (a = parentA), (b = parentB);\n else {\n for (var didFindChild = !1, child$0 = parentA.child; child$0; ) {\n if (child$0 === a) {\n didFindChild = !0;\n a = parentA;\n b = parentB;\n break;\n }\n if (child$0 === b) {\n didFindChild = !0;\n b = parentA;\n a = parentB;\n break;\n }\n child$0 = child$0.sibling;\n }\n if (!didFindChild) {\n for (child$0 = parentB.child; child$0; ) {\n if (child$0 === a) {\n didFindChild = !0;\n a = parentB;\n b = parentA;\n break;\n }\n if (child$0 === b) {\n didFindChild = !0;\n b = parentB;\n a = parentA;\n break;\n }\n child$0 = child$0.sibling;\n }\n if (!didFindChild) throw Error(formatProdErrorMessage(189));\n }\n }\n if (a.alternate !== b) throw Error(formatProdErrorMessage(190));\n }\n if (3 !== a.tag) throw Error(formatProdErrorMessage(188));\n return a.stateNode.current === a ? fiber : alternate;\n}\nfunction findCurrentHostFiberImpl(node) {\n var tag = node.tag;\n if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node;\n for (node = node.child; null !== node; ) {\n tag = findCurrentHostFiberImpl(node);\n if (null !== tag) return tag;\n node = node.sibling;\n }\n return null;\n}\nvar assign = Object.assign,\n REACT_LEGACY_ELEMENT_TYPE = Symbol.for(\"react.element\"),\n REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nSymbol.for(\"react.scope\");\nvar REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\");\nSymbol.for(\"react.legacy_hidden\");\nSymbol.for(\"react.tracing_marker\");\nvar REACT_MEMO_CACHE_SENTINEL = Symbol.for(\"react.memo_cache_sentinel\");\nSymbol.for(\"react.view_transition\");\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nfunction getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable) return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n}\nvar REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\");\nfunction getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (type.$$typeof) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n}\nvar isArrayImpl = Array.isArray,\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n ReactDOMSharedInternals =\n ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,\n sharedNotPendingObject = {\n pending: !1,\n data: null,\n method: null,\n action: null\n },\n valueStack = [],\n index = -1;\nfunction createCursor(defaultValue) {\n return { current: defaultValue };\n}\nfunction pop(cursor) {\n 0 > index ||\n ((cursor.current = valueStack[index]), (valueStack[index] = null), index--);\n}\nfunction push(cursor, value) {\n index++;\n valueStack[index] = cursor.current;\n cursor.current = value;\n}\nvar contextStackCursor = createCursor(null),\n contextFiberStackCursor = createCursor(null),\n rootInstanceStackCursor = createCursor(null),\n hostTransitionProviderCursor = createCursor(null);\nfunction pushHostContainer(fiber, nextRootInstance) {\n push(rootInstanceStackCursor, nextRootInstance);\n push(contextFiberStackCursor, fiber);\n push(contextStackCursor, null);\n switch (nextRootInstance.nodeType) {\n case 9:\n case 11:\n fiber = (fiber = nextRootInstance.documentElement)\n ? (fiber = fiber.namespaceURI)\n ? getOwnHostContext(fiber)\n : 0\n : 0;\n break;\n default:\n if (\n ((fiber = nextRootInstance.tagName),\n (nextRootInstance = nextRootInstance.namespaceURI))\n )\n (nextRootInstance = getOwnHostContext(nextRootInstance)),\n (fiber = getChildHostContextProd(nextRootInstance, fiber));\n else\n switch (fiber) {\n case \"svg\":\n fiber = 1;\n break;\n case \"math\":\n fiber = 2;\n break;\n default:\n fiber = 0;\n }\n }\n pop(contextStackCursor);\n push(contextStackCursor, fiber);\n}\nfunction popHostContainer() {\n pop(contextStackCursor);\n pop(contextFiberStackCursor);\n pop(rootInstanceStackCursor);\n}\nfunction pushHostContext(fiber) {\n null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber);\n var context = contextStackCursor.current;\n var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type);\n context !== JSCompiler_inline_result &&\n (push(contextFiberStackCursor, fiber),\n push(contextStackCursor, JSCompiler_inline_result));\n}\nfunction popHostContext(fiber) {\n contextFiberStackCursor.current === fiber &&\n (pop(contextStackCursor), pop(contextFiberStackCursor));\n hostTransitionProviderCursor.current === fiber &&\n (pop(hostTransitionProviderCursor),\n (HostTransitionContext._currentValue = sharedNotPendingObject));\n}\nvar prefix, suffix;\nfunction describeBuiltInComponentFrame(name) {\n if (void 0 === prefix)\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = (match && match[1]) || \"\";\n suffix =\n -1 < x.stack.indexOf(\"\\n at\")\n ? \" ()\"\n : -1 < x.stack.indexOf(\"@\")\n ? \"@unknown:0:0\"\n : \"\";\n }\n return \"\\n\" + prefix + name + suffix;\n}\nvar reentry = !1;\nfunction describeNativeComponentFrame(fn, construct) {\n if (!fn || reentry) return \"\";\n reentry = !0;\n var previousPrepareStackTrace = Error.prepareStackTrace;\n Error.prepareStackTrace = void 0;\n try {\n var RunInRootFrame = {\n DetermineComponentFrameRoot: function () {\n try {\n if (construct) {\n var Fake = function () {\n throw Error();\n };\n Object.defineProperty(Fake.prototype, \"props\", {\n set: function () {\n throw Error();\n }\n });\n if (\"object\" === typeof Reflect && Reflect.construct) {\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n var control = x;\n }\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x$1) {\n control = x$1;\n }\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x$2) {\n control = x$2;\n }\n (Fake = fn()) &&\n \"function\" === typeof Fake.catch &&\n Fake.catch(function () {});\n }\n } catch (sample) {\n if (sample && control && \"string\" === typeof sample.stack)\n return [sample.stack, control.stack];\n }\n return [null, null];\n }\n };\n RunInRootFrame.DetermineComponentFrameRoot.displayName =\n \"DetermineComponentFrameRoot\";\n var namePropDescriptor = Object.getOwnPropertyDescriptor(\n RunInRootFrame.DetermineComponentFrameRoot,\n \"name\"\n );\n namePropDescriptor &&\n namePropDescriptor.configurable &&\n Object.defineProperty(\n RunInRootFrame.DetermineComponentFrameRoot,\n \"name\",\n { value: \"DetermineComponentFrameRoot\" }\n );\n var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),\n sampleStack = _RunInRootFrame$Deter[0],\n controlStack = _RunInRootFrame$Deter[1];\n if (sampleStack && controlStack) {\n var sampleLines = sampleStack.split(\"\\n\"),\n controlLines = controlStack.split(\"\\n\");\n for (\n namePropDescriptor = RunInRootFrame = 0;\n RunInRootFrame < sampleLines.length &&\n !sampleLines[RunInRootFrame].includes(\"DetermineComponentFrameRoot\");\n\n )\n RunInRootFrame++;\n for (\n ;\n namePropDescriptor < controlLines.length &&\n !controlLines[namePropDescriptor].includes(\n \"DetermineComponentFrameRoot\"\n );\n\n )\n namePropDescriptor++;\n if (\n RunInRootFrame === sampleLines.length ||\n namePropDescriptor === controlLines.length\n )\n for (\n RunInRootFrame = sampleLines.length - 1,\n namePropDescriptor = controlLines.length - 1;\n 1 <= RunInRootFrame &&\n 0 <= namePropDescriptor &&\n sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor];\n\n )\n namePropDescriptor--;\n for (\n ;\n 1 <= RunInRootFrame && 0 <= namePropDescriptor;\n RunInRootFrame--, namePropDescriptor--\n )\n if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {\n if (1 !== RunInRootFrame || 1 !== namePropDescriptor) {\n do\n if (\n (RunInRootFrame--,\n namePropDescriptor--,\n 0 > namePropDescriptor ||\n sampleLines[RunInRootFrame] !==\n controlLines[namePropDescriptor])\n ) {\n var frame =\n \"\\n\" +\n sampleLines[RunInRootFrame].replace(\" at new \", \" at \");\n fn.displayName &&\n frame.includes(\"\") &&\n (frame = frame.replace(\"\", fn.displayName));\n return frame;\n }\n while (1 <= RunInRootFrame && 0 <= namePropDescriptor);\n }\n break;\n }\n }\n } finally {\n (reentry = !1), (Error.prepareStackTrace = previousPrepareStackTrace);\n }\n return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : \"\")\n ? describeBuiltInComponentFrame(previousPrepareStackTrace)\n : \"\";\n}\nfunction describeFiber(fiber, childFiber) {\n switch (fiber.tag) {\n case 26:\n case 27:\n case 5:\n return describeBuiltInComponentFrame(fiber.type);\n case 16:\n return describeBuiltInComponentFrame(\"Lazy\");\n case 13:\n return fiber.child !== childFiber && null !== childFiber\n ? describeBuiltInComponentFrame(\"Suspense Fallback\")\n : describeBuiltInComponentFrame(\"Suspense\");\n case 19:\n return describeBuiltInComponentFrame(\"SuspenseList\");\n case 0:\n case 15:\n return describeNativeComponentFrame(fiber.type, !1);\n case 11:\n return describeNativeComponentFrame(fiber.type.render, !1);\n case 1:\n return describeNativeComponentFrame(fiber.type, !0);\n case 31:\n return describeBuiltInComponentFrame(\"Activity\");\n default:\n return \"\";\n }\n}\nfunction getStackByFiberInDevAndProd(workInProgress) {\n try {\n var info = \"\",\n previous = null;\n do\n (info += describeFiber(workInProgress, previous)),\n (previous = workInProgress),\n (workInProgress = workInProgress.return);\n while (workInProgress);\n return info;\n } catch (x) {\n return \"\\nError generating stack: \" + x.message + \"\\n\" + x.stack;\n }\n}\nvar hasOwnProperty = Object.prototype.hasOwnProperty,\n scheduleCallback$3 = Scheduler.unstable_scheduleCallback,\n cancelCallback$1 = Scheduler.unstable_cancelCallback,\n shouldYield = Scheduler.unstable_shouldYield,\n requestPaint = Scheduler.unstable_requestPaint,\n now = Scheduler.unstable_now,\n getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel,\n ImmediatePriority = Scheduler.unstable_ImmediatePriority,\n UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,\n NormalPriority$1 = Scheduler.unstable_NormalPriority,\n LowPriority = Scheduler.unstable_LowPriority,\n IdlePriority = Scheduler.unstable_IdlePriority,\n log$1 = Scheduler.log,\n unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue,\n rendererID = null,\n injectedHook = null;\nfunction setIsStrictModeForDevtools(newIsStrictMode) {\n \"function\" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode);\n if (injectedHook && \"function\" === typeof injectedHook.setStrictMode)\n try {\n injectedHook.setStrictMode(rendererID, newIsStrictMode);\n } catch (err) {}\n}\nvar clz32 = Math.clz32 ? Math.clz32 : clz32Fallback,\n log = Math.log,\n LN2 = Math.LN2;\nfunction clz32Fallback(x) {\n x >>>= 0;\n return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0;\n}\nvar nextTransitionUpdateLane = 256,\n nextTransitionDeferredLane = 262144,\n nextRetryLane = 4194304;\nfunction getHighestPriorityLanes(lanes) {\n var pendingSyncLanes = lanes & 42;\n if (0 !== pendingSyncLanes) return pendingSyncLanes;\n switch (lanes & -lanes) {\n case 1:\n return 1;\n case 2:\n return 2;\n case 4:\n return 4;\n case 8:\n return 8;\n case 16:\n return 16;\n case 32:\n return 32;\n case 64:\n return 64;\n case 128:\n return 128;\n case 256:\n case 512:\n case 1024:\n case 2048:\n case 4096:\n case 8192:\n case 16384:\n case 32768:\n case 65536:\n case 131072:\n return lanes & 261888;\n case 262144:\n case 524288:\n case 1048576:\n case 2097152:\n return lanes & 3932160;\n case 4194304:\n case 8388608:\n case 16777216:\n case 33554432:\n return lanes & 62914560;\n case 67108864:\n return 67108864;\n case 134217728:\n return 134217728;\n case 268435456:\n return 268435456;\n case 536870912:\n return 536870912;\n case 1073741824:\n return 0;\n default:\n return lanes;\n }\n}\nfunction getNextLanes(root, wipLanes, rootHasPendingCommit) {\n var pendingLanes = root.pendingLanes;\n if (0 === pendingLanes) return 0;\n var nextLanes = 0,\n suspendedLanes = root.suspendedLanes,\n pingedLanes = root.pingedLanes;\n root = root.warmLanes;\n var nonIdlePendingLanes = pendingLanes & 134217727;\n 0 !== nonIdlePendingLanes\n ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes),\n 0 !== pendingLanes\n ? (nextLanes = getHighestPriorityLanes(pendingLanes))\n : ((pingedLanes &= nonIdlePendingLanes),\n 0 !== pingedLanes\n ? (nextLanes = getHighestPriorityLanes(pingedLanes))\n : rootHasPendingCommit ||\n ((rootHasPendingCommit = nonIdlePendingLanes & ~root),\n 0 !== rootHasPendingCommit &&\n (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))))\n : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes),\n 0 !== nonIdlePendingLanes\n ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes))\n : 0 !== pingedLanes\n ? (nextLanes = getHighestPriorityLanes(pingedLanes))\n : rootHasPendingCommit ||\n ((rootHasPendingCommit = pendingLanes & ~root),\n 0 !== rootHasPendingCommit &&\n (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))));\n return 0 === nextLanes\n ? 0\n : 0 !== wipLanes &&\n wipLanes !== nextLanes &&\n 0 === (wipLanes & suspendedLanes) &&\n ((suspendedLanes = nextLanes & -nextLanes),\n (rootHasPendingCommit = wipLanes & -wipLanes),\n suspendedLanes >= rootHasPendingCommit ||\n (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048)))\n ? wipLanes\n : nextLanes;\n}\nfunction checkIfRootIsPrerendering(root, renderLanes) {\n return (\n 0 ===\n (root.pendingLanes &\n ~(root.suspendedLanes & ~root.pingedLanes) &\n renderLanes)\n );\n}\nfunction computeExpirationTime(lane, currentTime) {\n switch (lane) {\n case 1:\n case 2:\n case 4:\n case 8:\n case 64:\n return currentTime + 250;\n case 16:\n case 32:\n case 128:\n case 256:\n case 512:\n case 1024:\n case 2048:\n case 4096:\n case 8192:\n case 16384:\n case 32768:\n case 65536:\n case 131072:\n case 262144:\n case 524288:\n case 1048576:\n case 2097152:\n return currentTime + 5e3;\n case 4194304:\n case 8388608:\n case 16777216:\n case 33554432:\n return -1;\n case 67108864:\n case 134217728:\n case 268435456:\n case 536870912:\n case 1073741824:\n return -1;\n default:\n return -1;\n }\n}\nfunction claimNextRetryLane() {\n var lane = nextRetryLane;\n nextRetryLane <<= 1;\n 0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304);\n return lane;\n}\nfunction createLaneMap(initial) {\n for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial);\n return laneMap;\n}\nfunction markRootUpdated$1(root, updateLane) {\n root.pendingLanes |= updateLane;\n 268435456 !== updateLane &&\n ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0));\n}\nfunction markRootFinished(\n root,\n finishedLanes,\n remainingLanes,\n spawnedLane,\n updatedLanes,\n suspendedRetryLanes\n) {\n var previouslyPendingLanes = root.pendingLanes;\n root.pendingLanes = remainingLanes;\n root.suspendedLanes = 0;\n root.pingedLanes = 0;\n root.warmLanes = 0;\n root.expiredLanes &= remainingLanes;\n root.entangledLanes &= remainingLanes;\n root.errorRecoveryDisabledLanes &= remainingLanes;\n root.shellSuspendCounter = 0;\n var entanglements = root.entanglements,\n expirationTimes = root.expirationTimes,\n hiddenUpdates = root.hiddenUpdates;\n for (\n remainingLanes = previouslyPendingLanes & ~remainingLanes;\n 0 < remainingLanes;\n\n ) {\n var index$7 = 31 - clz32(remainingLanes),\n lane = 1 << index$7;\n entanglements[index$7] = 0;\n expirationTimes[index$7] = -1;\n var hiddenUpdatesForLane = hiddenUpdates[index$7];\n if (null !== hiddenUpdatesForLane)\n for (\n hiddenUpdates[index$7] = null, index$7 = 0;\n index$7 < hiddenUpdatesForLane.length;\n index$7++\n ) {\n var update = hiddenUpdatesForLane[index$7];\n null !== update && (update.lane &= -536870913);\n }\n remainingLanes &= ~lane;\n }\n 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0);\n 0 !== suspendedRetryLanes &&\n 0 === updatedLanes &&\n 0 !== root.tag &&\n (root.suspendedLanes |=\n suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));\n}\nfunction markSpawnedDeferredLane(root, spawnedLane, entangledLanes) {\n root.pendingLanes |= spawnedLane;\n root.suspendedLanes &= ~spawnedLane;\n var spawnedLaneIndex = 31 - clz32(spawnedLane);\n root.entangledLanes |= spawnedLane;\n root.entanglements[spawnedLaneIndex] =\n root.entanglements[spawnedLaneIndex] |\n 1073741824 |\n (entangledLanes & 261930);\n}\nfunction markRootEntangled(root, entangledLanes) {\n var rootEntangledLanes = (root.entangledLanes |= entangledLanes);\n for (root = root.entanglements; rootEntangledLanes; ) {\n var index$8 = 31 - clz32(rootEntangledLanes),\n lane = 1 << index$8;\n (lane & entangledLanes) | (root[index$8] & entangledLanes) &&\n (root[index$8] |= entangledLanes);\n rootEntangledLanes &= ~lane;\n }\n}\nfunction getBumpedLaneForHydration(root, renderLanes) {\n var renderLane = renderLanes & -renderLanes;\n renderLane =\n 0 !== (renderLane & 42) ? 1 : getBumpedLaneForHydrationByLane(renderLane);\n return 0 !== (renderLane & (root.suspendedLanes | renderLanes))\n ? 0\n : renderLane;\n}\nfunction getBumpedLaneForHydrationByLane(lane) {\n switch (lane) {\n case 2:\n lane = 1;\n break;\n case 8:\n lane = 4;\n break;\n case 32:\n lane = 16;\n break;\n case 256:\n case 512:\n case 1024:\n case 2048:\n case 4096:\n case 8192:\n case 16384:\n case 32768:\n case 65536:\n case 131072:\n case 262144:\n case 524288:\n case 1048576:\n case 2097152:\n case 4194304:\n case 8388608:\n case 16777216:\n case 33554432:\n lane = 128;\n break;\n case 268435456:\n lane = 134217728;\n break;\n default:\n lane = 0;\n }\n return lane;\n}\nfunction lanesToEventPriority(lanes) {\n lanes &= -lanes;\n return 2 < lanes\n ? 8 < lanes\n ? 0 !== (lanes & 134217727)\n ? 32\n : 268435456\n : 8\n : 2;\n}\nfunction resolveUpdatePriority() {\n var updatePriority = ReactDOMSharedInternals.p;\n if (0 !== updatePriority) return updatePriority;\n updatePriority = window.event;\n return void 0 === updatePriority ? 32 : getEventPriority(updatePriority.type);\n}\nfunction runWithPriority(priority, fn) {\n var previousPriority = ReactDOMSharedInternals.p;\n try {\n return (ReactDOMSharedInternals.p = priority), fn();\n } finally {\n ReactDOMSharedInternals.p = previousPriority;\n }\n}\nvar randomKey = Math.random().toString(36).slice(2),\n internalInstanceKey = \"__reactFiber$\" + randomKey,\n internalPropsKey = \"__reactProps$\" + randomKey,\n internalContainerInstanceKey = \"__reactContainer$\" + randomKey,\n internalEventHandlersKey = \"__reactEvents$\" + randomKey,\n internalEventHandlerListenersKey = \"__reactListeners$\" + randomKey,\n internalEventHandlesSetKey = \"__reactHandles$\" + randomKey,\n internalRootNodeResourcesKey = \"__reactResources$\" + randomKey,\n internalHoistableMarker = \"__reactMarker$\" + randomKey;\nfunction detachDeletedInstance(node) {\n delete node[internalInstanceKey];\n delete node[internalPropsKey];\n delete node[internalEventHandlersKey];\n delete node[internalEventHandlerListenersKey];\n delete node[internalEventHandlesSetKey];\n}\nfunction getClosestInstanceFromNode(targetNode) {\n var targetInst = targetNode[internalInstanceKey];\n if (targetInst) return targetInst;\n for (var parentNode = targetNode.parentNode; parentNode; ) {\n if (\n (targetInst =\n parentNode[internalContainerInstanceKey] ||\n parentNode[internalInstanceKey])\n ) {\n parentNode = targetInst.alternate;\n if (\n null !== targetInst.child ||\n (null !== parentNode && null !== parentNode.child)\n )\n for (\n targetNode = getParentHydrationBoundary(targetNode);\n null !== targetNode;\n\n ) {\n if ((parentNode = targetNode[internalInstanceKey])) return parentNode;\n targetNode = getParentHydrationBoundary(targetNode);\n }\n return targetInst;\n }\n targetNode = parentNode;\n parentNode = targetNode.parentNode;\n }\n return null;\n}\nfunction getInstanceFromNode(node) {\n if (\n (node = node[internalInstanceKey] || node[internalContainerInstanceKey])\n ) {\n var tag = node.tag;\n if (\n 5 === tag ||\n 6 === tag ||\n 13 === tag ||\n 31 === tag ||\n 26 === tag ||\n 27 === tag ||\n 3 === tag\n )\n return node;\n }\n return null;\n}\nfunction getNodeFromInstance(inst) {\n var tag = inst.tag;\n if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return inst.stateNode;\n throw Error(formatProdErrorMessage(33));\n}\nfunction getResourcesFromRoot(root) {\n var resources = root[internalRootNodeResourcesKey];\n resources ||\n (resources = root[internalRootNodeResourcesKey] =\n { hoistableStyles: new Map(), hoistableScripts: new Map() });\n return resources;\n}\nfunction markNodeAsHoistable(node) {\n node[internalHoistableMarker] = !0;\n}\nvar allNativeEvents = new Set(),\n registrationNameDependencies = {};\nfunction registerTwoPhaseEvent(registrationName, dependencies) {\n registerDirectEvent(registrationName, dependencies);\n registerDirectEvent(registrationName + \"Capture\", dependencies);\n}\nfunction registerDirectEvent(registrationName, dependencies) {\n registrationNameDependencies[registrationName] = dependencies;\n for (\n registrationName = 0;\n registrationName < dependencies.length;\n registrationName++\n )\n allNativeEvents.add(dependencies[registrationName]);\n}\nvar VALID_ATTRIBUTE_NAME_REGEX = RegExp(\n \"^[:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD][:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]*$\"\n ),\n illegalAttributeNameCache = {},\n validatedAttributeNameCache = {};\nfunction isAttributeNameSafe(attributeName) {\n if (hasOwnProperty.call(validatedAttributeNameCache, attributeName))\n return !0;\n if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return !1;\n if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))\n return (validatedAttributeNameCache[attributeName] = !0);\n illegalAttributeNameCache[attributeName] = !0;\n return !1;\n}\nfunction setValueForAttribute(node, name, value) {\n if (isAttributeNameSafe(name))\n if (null === value) node.removeAttribute(name);\n else {\n switch (typeof value) {\n case \"undefined\":\n case \"function\":\n case \"symbol\":\n node.removeAttribute(name);\n return;\n case \"boolean\":\n var prefix$10 = name.toLowerCase().slice(0, 5);\n if (\"data-\" !== prefix$10 && \"aria-\" !== prefix$10) {\n node.removeAttribute(name);\n return;\n }\n }\n node.setAttribute(name, \"\" + value);\n }\n}\nfunction setValueForKnownAttribute(node, name, value) {\n if (null === value) node.removeAttribute(name);\n else {\n switch (typeof value) {\n case \"undefined\":\n case \"function\":\n case \"symbol\":\n case \"boolean\":\n node.removeAttribute(name);\n return;\n }\n node.setAttribute(name, \"\" + value);\n }\n}\nfunction setValueForNamespacedAttribute(node, namespace, name, value) {\n if (null === value) node.removeAttribute(name);\n else {\n switch (typeof value) {\n case \"undefined\":\n case \"function\":\n case \"symbol\":\n case \"boolean\":\n node.removeAttribute(name);\n return;\n }\n node.setAttributeNS(namespace, name, \"\" + value);\n }\n}\nfunction getToStringValue(value) {\n switch (typeof value) {\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n case \"undefined\":\n return value;\n case \"object\":\n return value;\n default:\n return \"\";\n }\n}\nfunction isCheckable(elem) {\n var type = elem.type;\n return (\n (elem = elem.nodeName) &&\n \"input\" === elem.toLowerCase() &&\n (\"checkbox\" === type || \"radio\" === type)\n );\n}\nfunction trackValueOnNode(node, valueField, currentValue) {\n var descriptor = Object.getOwnPropertyDescriptor(\n node.constructor.prototype,\n valueField\n );\n if (\n !node.hasOwnProperty(valueField) &&\n \"undefined\" !== typeof descriptor &&\n \"function\" === typeof descriptor.get &&\n \"function\" === typeof descriptor.set\n ) {\n var get = descriptor.get,\n set = descriptor.set;\n Object.defineProperty(node, valueField, {\n configurable: !0,\n get: function () {\n return get.call(this);\n },\n set: function (value) {\n currentValue = \"\" + value;\n set.call(this, value);\n }\n });\n Object.defineProperty(node, valueField, {\n enumerable: descriptor.enumerable\n });\n return {\n getValue: function () {\n return currentValue;\n },\n setValue: function (value) {\n currentValue = \"\" + value;\n },\n stopTracking: function () {\n node._valueTracker = null;\n delete node[valueField];\n }\n };\n }\n}\nfunction track(node) {\n if (!node._valueTracker) {\n var valueField = isCheckable(node) ? \"checked\" : \"value\";\n node._valueTracker = trackValueOnNode(\n node,\n valueField,\n \"\" + node[valueField]\n );\n }\n}\nfunction updateValueIfChanged(node) {\n if (!node) return !1;\n var tracker = node._valueTracker;\n if (!tracker) return !0;\n var lastValue = tracker.getValue();\n var value = \"\";\n node &&\n (value = isCheckable(node)\n ? node.checked\n ? \"true\"\n : \"false\"\n : node.value);\n node = value;\n return node !== lastValue ? (tracker.setValue(node), !0) : !1;\n}\nfunction getActiveElement(doc) {\n doc = doc || (\"undefined\" !== typeof document ? document : void 0);\n if (\"undefined\" === typeof doc) return null;\n try {\n return doc.activeElement || doc.body;\n } catch (e) {\n return doc.body;\n }\n}\nvar escapeSelectorAttributeValueInsideDoubleQuotesRegex = /[\\n\"\\\\]/g;\nfunction escapeSelectorAttributeValueInsideDoubleQuotes(value) {\n return value.replace(\n escapeSelectorAttributeValueInsideDoubleQuotesRegex,\n function (ch) {\n return \"\\\\\" + ch.charCodeAt(0).toString(16) + \" \";\n }\n );\n}\nfunction updateInput(\n element,\n value,\n defaultValue,\n lastDefaultValue,\n checked,\n defaultChecked,\n type,\n name\n) {\n element.name = \"\";\n null != type &&\n \"function\" !== typeof type &&\n \"symbol\" !== typeof type &&\n \"boolean\" !== typeof type\n ? (element.type = type)\n : element.removeAttribute(\"type\");\n if (null != value)\n if (\"number\" === type) {\n if ((0 === value && \"\" === element.value) || element.value != value)\n element.value = \"\" + getToStringValue(value);\n } else\n element.value !== \"\" + getToStringValue(value) &&\n (element.value = \"\" + getToStringValue(value));\n else\n (\"submit\" !== type && \"reset\" !== type) || element.removeAttribute(\"value\");\n null != value\n ? setDefaultValue(element, type, getToStringValue(value))\n : null != defaultValue\n ? setDefaultValue(element, type, getToStringValue(defaultValue))\n : null != lastDefaultValue && element.removeAttribute(\"value\");\n null == checked &&\n null != defaultChecked &&\n (element.defaultChecked = !!defaultChecked);\n null != checked &&\n (element.checked =\n checked && \"function\" !== typeof checked && \"symbol\" !== typeof checked);\n null != name &&\n \"function\" !== typeof name &&\n \"symbol\" !== typeof name &&\n \"boolean\" !== typeof name\n ? (element.name = \"\" + getToStringValue(name))\n : element.removeAttribute(\"name\");\n}\nfunction initInput(\n element,\n value,\n defaultValue,\n checked,\n defaultChecked,\n type,\n name,\n isHydrating\n) {\n null != type &&\n \"function\" !== typeof type &&\n \"symbol\" !== typeof type &&\n \"boolean\" !== typeof type &&\n (element.type = type);\n if (null != value || null != defaultValue) {\n if (\n !(\n (\"submit\" !== type && \"reset\" !== type) ||\n (void 0 !== value && null !== value)\n )\n ) {\n track(element);\n return;\n }\n defaultValue =\n null != defaultValue ? \"\" + getToStringValue(defaultValue) : \"\";\n value = null != value ? \"\" + getToStringValue(value) : defaultValue;\n isHydrating || value === element.value || (element.value = value);\n element.defaultValue = value;\n }\n checked = null != checked ? checked : defaultChecked;\n checked =\n \"function\" !== typeof checked && \"symbol\" !== typeof checked && !!checked;\n element.checked = isHydrating ? element.checked : !!checked;\n element.defaultChecked = !!checked;\n null != name &&\n \"function\" !== typeof name &&\n \"symbol\" !== typeof name &&\n \"boolean\" !== typeof name &&\n (element.name = name);\n track(element);\n}\nfunction setDefaultValue(node, type, value) {\n (\"number\" === type && getActiveElement(node.ownerDocument) === node) ||\n node.defaultValue === \"\" + value ||\n (node.defaultValue = \"\" + value);\n}\nfunction updateOptions(node, multiple, propValue, setDefaultSelected) {\n node = node.options;\n if (multiple) {\n multiple = {};\n for (var i = 0; i < propValue.length; i++)\n multiple[\"$\" + propValue[i]] = !0;\n for (propValue = 0; propValue < node.length; propValue++)\n (i = multiple.hasOwnProperty(\"$\" + node[propValue].value)),\n node[propValue].selected !== i && (node[propValue].selected = i),\n i && setDefaultSelected && (node[propValue].defaultSelected = !0);\n } else {\n propValue = \"\" + getToStringValue(propValue);\n multiple = null;\n for (i = 0; i < node.length; i++) {\n if (node[i].value === propValue) {\n node[i].selected = !0;\n setDefaultSelected && (node[i].defaultSelected = !0);\n return;\n }\n null !== multiple || node[i].disabled || (multiple = node[i]);\n }\n null !== multiple && (multiple.selected = !0);\n }\n}\nfunction updateTextarea(element, value, defaultValue) {\n if (\n null != value &&\n ((value = \"\" + getToStringValue(value)),\n value !== element.value && (element.value = value),\n null == defaultValue)\n ) {\n element.defaultValue !== value && (element.defaultValue = value);\n return;\n }\n element.defaultValue =\n null != defaultValue ? \"\" + getToStringValue(defaultValue) : \"\";\n}\nfunction initTextarea(element, value, defaultValue, children) {\n if (null == value) {\n if (null != children) {\n if (null != defaultValue) throw Error(formatProdErrorMessage(92));\n if (isArrayImpl(children)) {\n if (1 < children.length) throw Error(formatProdErrorMessage(93));\n children = children[0];\n }\n defaultValue = children;\n }\n null == defaultValue && (defaultValue = \"\");\n value = defaultValue;\n }\n defaultValue = getToStringValue(value);\n element.defaultValue = defaultValue;\n children = element.textContent;\n children === defaultValue &&\n \"\" !== children &&\n null !== children &&\n (element.value = children);\n track(element);\n}\nfunction setTextContent(node, text) {\n if (text) {\n var firstChild = node.firstChild;\n if (\n firstChild &&\n firstChild === node.lastChild &&\n 3 === firstChild.nodeType\n ) {\n firstChild.nodeValue = text;\n return;\n }\n }\n node.textContent = text;\n}\nvar unitlessNumbers = new Set(\n \"animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp\".split(\n \" \"\n )\n);\nfunction setValueForStyle(style, styleName, value) {\n var isCustomProperty = 0 === styleName.indexOf(\"--\");\n null == value || \"boolean\" === typeof value || \"\" === value\n ? isCustomProperty\n ? style.setProperty(styleName, \"\")\n : \"float\" === styleName\n ? (style.cssFloat = \"\")\n : (style[styleName] = \"\")\n : isCustomProperty\n ? style.setProperty(styleName, value)\n : \"number\" !== typeof value ||\n 0 === value ||\n unitlessNumbers.has(styleName)\n ? \"float\" === styleName\n ? (style.cssFloat = value)\n : (style[styleName] = (\"\" + value).trim())\n : (style[styleName] = value + \"px\");\n}\nfunction setValueForStyles(node, styles, prevStyles) {\n if (null != styles && \"object\" !== typeof styles)\n throw Error(formatProdErrorMessage(62));\n node = node.style;\n if (null != prevStyles) {\n for (var styleName in prevStyles)\n !prevStyles.hasOwnProperty(styleName) ||\n (null != styles && styles.hasOwnProperty(styleName)) ||\n (0 === styleName.indexOf(\"--\")\n ? node.setProperty(styleName, \"\")\n : \"float\" === styleName\n ? (node.cssFloat = \"\")\n : (node[styleName] = \"\"));\n for (var styleName$16 in styles)\n (styleName = styles[styleName$16]),\n styles.hasOwnProperty(styleName$16) &&\n prevStyles[styleName$16] !== styleName &&\n setValueForStyle(node, styleName$16, styleName);\n } else\n for (var styleName$17 in styles)\n styles.hasOwnProperty(styleName$17) &&\n setValueForStyle(node, styleName$17, styles[styleName$17]);\n}\nfunction isCustomElement(tagName) {\n if (-1 === tagName.indexOf(\"-\")) return !1;\n switch (tagName) {\n case \"annotation-xml\":\n case \"color-profile\":\n case \"font-face\":\n case \"font-face-src\":\n case \"font-face-uri\":\n case \"font-face-format\":\n case \"font-face-name\":\n case \"missing-glyph\":\n return !1;\n default:\n return !0;\n }\n}\nvar aliases = new Map([\n [\"acceptCharset\", \"accept-charset\"],\n [\"htmlFor\", \"for\"],\n [\"httpEquiv\", \"http-equiv\"],\n [\"crossOrigin\", \"crossorigin\"],\n [\"accentHeight\", \"accent-height\"],\n [\"alignmentBaseline\", \"alignment-baseline\"],\n [\"arabicForm\", \"arabic-form\"],\n [\"baselineShift\", \"baseline-shift\"],\n [\"capHeight\", \"cap-height\"],\n [\"clipPath\", \"clip-path\"],\n [\"clipRule\", \"clip-rule\"],\n [\"colorInterpolation\", \"color-interpolation\"],\n [\"colorInterpolationFilters\", \"color-interpolation-filters\"],\n [\"colorProfile\", \"color-profile\"],\n [\"colorRendering\", \"color-rendering\"],\n [\"dominantBaseline\", \"dominant-baseline\"],\n [\"enableBackground\", \"enable-background\"],\n [\"fillOpacity\", \"fill-opacity\"],\n [\"fillRule\", \"fill-rule\"],\n [\"floodColor\", \"flood-color\"],\n [\"floodOpacity\", \"flood-opacity\"],\n [\"fontFamily\", \"font-family\"],\n [\"fontSize\", \"font-size\"],\n [\"fontSizeAdjust\", \"font-size-adjust\"],\n [\"fontStretch\", \"font-stretch\"],\n [\"fontStyle\", \"font-style\"],\n [\"fontVariant\", \"font-variant\"],\n [\"fontWeight\", \"font-weight\"],\n [\"glyphName\", \"glyph-name\"],\n [\"glyphOrientationHorizontal\", \"glyph-orientation-horizontal\"],\n [\"glyphOrientationVertical\", \"glyph-orientation-vertical\"],\n [\"horizAdvX\", \"horiz-adv-x\"],\n [\"horizOriginX\", \"horiz-origin-x\"],\n [\"imageRendering\", \"image-rendering\"],\n [\"letterSpacing\", \"letter-spacing\"],\n [\"lightingColor\", \"lighting-color\"],\n [\"markerEnd\", \"marker-end\"],\n [\"markerMid\", \"marker-mid\"],\n [\"markerStart\", \"marker-start\"],\n [\"overlinePosition\", \"overline-position\"],\n [\"overlineThickness\", \"overline-thickness\"],\n [\"paintOrder\", \"paint-order\"],\n [\"panose-1\", \"panose-1\"],\n [\"pointerEvents\", \"pointer-events\"],\n [\"renderingIntent\", \"rendering-intent\"],\n [\"shapeRendering\", \"shape-rendering\"],\n [\"stopColor\", \"stop-color\"],\n [\"stopOpacity\", \"stop-opacity\"],\n [\"strikethroughPosition\", \"strikethrough-position\"],\n [\"strikethroughThickness\", \"strikethrough-thickness\"],\n [\"strokeDasharray\", \"stroke-dasharray\"],\n [\"strokeDashoffset\", \"stroke-dashoffset\"],\n [\"strokeLinecap\", \"stroke-linecap\"],\n [\"strokeLinejoin\", \"stroke-linejoin\"],\n [\"strokeMiterlimit\", \"stroke-miterlimit\"],\n [\"strokeOpacity\", \"stroke-opacity\"],\n [\"strokeWidth\", \"stroke-width\"],\n [\"textAnchor\", \"text-anchor\"],\n [\"textDecoration\", \"text-decoration\"],\n [\"textRendering\", \"text-rendering\"],\n [\"transformOrigin\", \"transform-origin\"],\n [\"underlinePosition\", \"underline-position\"],\n [\"underlineThickness\", \"underline-thickness\"],\n [\"unicodeBidi\", \"unicode-bidi\"],\n [\"unicodeRange\", \"unicode-range\"],\n [\"unitsPerEm\", \"units-per-em\"],\n [\"vAlphabetic\", \"v-alphabetic\"],\n [\"vHanging\", \"v-hanging\"],\n [\"vIdeographic\", \"v-ideographic\"],\n [\"vMathematical\", \"v-mathematical\"],\n [\"vectorEffect\", \"vector-effect\"],\n [\"vertAdvY\", \"vert-adv-y\"],\n [\"vertOriginX\", \"vert-origin-x\"],\n [\"vertOriginY\", \"vert-origin-y\"],\n [\"wordSpacing\", \"word-spacing\"],\n [\"writingMode\", \"writing-mode\"],\n [\"xmlnsXlink\", \"xmlns:xlink\"],\n [\"xHeight\", \"x-height\"]\n ]),\n isJavaScriptProtocol =\n /^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*:/i;\nfunction sanitizeURL(url) {\n return isJavaScriptProtocol.test(\"\" + url)\n ? \"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')\"\n : url;\n}\nfunction noop$1() {}\nvar currentReplayingEvent = null;\nfunction getEventTarget(nativeEvent) {\n nativeEvent = nativeEvent.target || nativeEvent.srcElement || window;\n nativeEvent.correspondingUseElement &&\n (nativeEvent = nativeEvent.correspondingUseElement);\n return 3 === nativeEvent.nodeType ? nativeEvent.parentNode : nativeEvent;\n}\nvar restoreTarget = null,\n restoreQueue = null;\nfunction restoreStateOfTarget(target) {\n var internalInstance = getInstanceFromNode(target);\n if (internalInstance && (target = internalInstance.stateNode)) {\n var props = target[internalPropsKey] || null;\n a: switch (((target = internalInstance.stateNode), internalInstance.type)) {\n case \"input\":\n updateInput(\n target,\n props.value,\n props.defaultValue,\n props.defaultValue,\n props.checked,\n props.defaultChecked,\n props.type,\n props.name\n );\n internalInstance = props.name;\n if (\"radio\" === props.type && null != internalInstance) {\n for (props = target; props.parentNode; ) props = props.parentNode;\n props = props.querySelectorAll(\n 'input[name=\"' +\n escapeSelectorAttributeValueInsideDoubleQuotes(\n \"\" + internalInstance\n ) +\n '\"][type=\"radio\"]'\n );\n for (\n internalInstance = 0;\n internalInstance < props.length;\n internalInstance++\n ) {\n var otherNode = props[internalInstance];\n if (otherNode !== target && otherNode.form === target.form) {\n var otherProps = otherNode[internalPropsKey] || null;\n if (!otherProps) throw Error(formatProdErrorMessage(90));\n updateInput(\n otherNode,\n otherProps.value,\n otherProps.defaultValue,\n otherProps.defaultValue,\n otherProps.checked,\n otherProps.defaultChecked,\n otherProps.type,\n otherProps.name\n );\n }\n }\n for (\n internalInstance = 0;\n internalInstance < props.length;\n internalInstance++\n )\n (otherNode = props[internalInstance]),\n otherNode.form === target.form && updateValueIfChanged(otherNode);\n }\n break a;\n case \"textarea\":\n updateTextarea(target, props.value, props.defaultValue);\n break a;\n case \"select\":\n (internalInstance = props.value),\n null != internalInstance &&\n updateOptions(target, !!props.multiple, internalInstance, !1);\n }\n }\n}\nvar isInsideEventHandler = !1;\nfunction batchedUpdates$1(fn, a, b) {\n if (isInsideEventHandler) return fn(a, b);\n isInsideEventHandler = !0;\n try {\n var JSCompiler_inline_result = fn(a);\n return JSCompiler_inline_result;\n } finally {\n if (\n ((isInsideEventHandler = !1),\n null !== restoreTarget || null !== restoreQueue)\n )\n if (\n (flushSyncWork$1(),\n restoreTarget &&\n ((a = restoreTarget),\n (fn = restoreQueue),\n (restoreQueue = restoreTarget = null),\n restoreStateOfTarget(a),\n fn))\n )\n for (a = 0; a < fn.length; a++) restoreStateOfTarget(fn[a]);\n }\n}\nfunction getListener(inst, registrationName) {\n var stateNode = inst.stateNode;\n if (null === stateNode) return null;\n var props = stateNode[internalPropsKey] || null;\n if (null === props) return null;\n stateNode = props[registrationName];\n a: switch (registrationName) {\n case \"onClick\":\n case \"onClickCapture\":\n case \"onDoubleClick\":\n case \"onDoubleClickCapture\":\n case \"onMouseDown\":\n case \"onMouseDownCapture\":\n case \"onMouseMove\":\n case \"onMouseMoveCapture\":\n case \"onMouseUp\":\n case \"onMouseUpCapture\":\n case \"onMouseEnter\":\n (props = !props.disabled) ||\n ((inst = inst.type),\n (props = !(\n \"button\" === inst ||\n \"input\" === inst ||\n \"select\" === inst ||\n \"textarea\" === inst\n )));\n inst = !props;\n break a;\n default:\n inst = !1;\n }\n if (inst) return null;\n if (stateNode && \"function\" !== typeof stateNode)\n throw Error(\n formatProdErrorMessage(231, registrationName, typeof stateNode)\n );\n return stateNode;\n}\nvar canUseDOM = !(\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ),\n passiveBrowserEventsSupported = !1;\nif (canUseDOM)\n try {\n var options = {};\n Object.defineProperty(options, \"passive\", {\n get: function () {\n passiveBrowserEventsSupported = !0;\n }\n });\n window.addEventListener(\"test\", options, options);\n window.removeEventListener(\"test\", options, options);\n } catch (e) {\n passiveBrowserEventsSupported = !1;\n }\nvar root = null,\n startText = null,\n fallbackText = null;\nfunction getData() {\n if (fallbackText) return fallbackText;\n var start,\n startValue = startText,\n startLength = startValue.length,\n end,\n endValue = \"value\" in root ? root.value : root.textContent,\n endLength = endValue.length;\n for (\n start = 0;\n start < startLength && startValue[start] === endValue[start];\n start++\n );\n var minEnd = startLength - start;\n for (\n end = 1;\n end <= minEnd &&\n startValue[startLength - end] === endValue[endLength - end];\n end++\n );\n return (fallbackText = endValue.slice(start, 1 < end ? 1 - end : void 0));\n}\nfunction getEventCharCode(nativeEvent) {\n var keyCode = nativeEvent.keyCode;\n \"charCode\" in nativeEvent\n ? ((nativeEvent = nativeEvent.charCode),\n 0 === nativeEvent && 13 === keyCode && (nativeEvent = 13))\n : (nativeEvent = keyCode);\n 10 === nativeEvent && (nativeEvent = 13);\n return 32 <= nativeEvent || 13 === nativeEvent ? nativeEvent : 0;\n}\nfunction functionThatReturnsTrue() {\n return !0;\n}\nfunction functionThatReturnsFalse() {\n return !1;\n}\nfunction createSyntheticEvent(Interface) {\n function SyntheticBaseEvent(\n reactName,\n reactEventType,\n targetInst,\n nativeEvent,\n nativeEventTarget\n ) {\n this._reactName = reactName;\n this._targetInst = targetInst;\n this.type = reactEventType;\n this.nativeEvent = nativeEvent;\n this.target = nativeEventTarget;\n this.currentTarget = null;\n for (var propName in Interface)\n Interface.hasOwnProperty(propName) &&\n ((reactName = Interface[propName]),\n (this[propName] = reactName\n ? reactName(nativeEvent)\n : nativeEvent[propName]));\n this.isDefaultPrevented = (\n null != nativeEvent.defaultPrevented\n ? nativeEvent.defaultPrevented\n : !1 === nativeEvent.returnValue\n )\n ? functionThatReturnsTrue\n : functionThatReturnsFalse;\n this.isPropagationStopped = functionThatReturnsFalse;\n return this;\n }\n assign(SyntheticBaseEvent.prototype, {\n preventDefault: function () {\n this.defaultPrevented = !0;\n var event = this.nativeEvent;\n event &&\n (event.preventDefault\n ? event.preventDefault()\n : \"unknown\" !== typeof event.returnValue && (event.returnValue = !1),\n (this.isDefaultPrevented = functionThatReturnsTrue));\n },\n stopPropagation: function () {\n var event = this.nativeEvent;\n event &&\n (event.stopPropagation\n ? event.stopPropagation()\n : \"unknown\" !== typeof event.cancelBubble &&\n (event.cancelBubble = !0),\n (this.isPropagationStopped = functionThatReturnsTrue));\n },\n persist: function () {},\n isPersistent: functionThatReturnsTrue\n });\n return SyntheticBaseEvent;\n}\nvar EventInterface = {\n eventPhase: 0,\n bubbles: 0,\n cancelable: 0,\n timeStamp: function (event) {\n return event.timeStamp || Date.now();\n },\n defaultPrevented: 0,\n isTrusted: 0\n },\n SyntheticEvent = createSyntheticEvent(EventInterface),\n UIEventInterface = assign({}, EventInterface, { view: 0, detail: 0 }),\n SyntheticUIEvent = createSyntheticEvent(UIEventInterface),\n lastMovementX,\n lastMovementY,\n lastMouseEvent,\n MouseEventInterface = assign({}, UIEventInterface, {\n screenX: 0,\n screenY: 0,\n clientX: 0,\n clientY: 0,\n pageX: 0,\n pageY: 0,\n ctrlKey: 0,\n shiftKey: 0,\n altKey: 0,\n metaKey: 0,\n getModifierState: getEventModifierState,\n button: 0,\n buttons: 0,\n relatedTarget: function (event) {\n return void 0 === event.relatedTarget\n ? event.fromElement === event.srcElement\n ? event.toElement\n : event.fromElement\n : event.relatedTarget;\n },\n movementX: function (event) {\n if (\"movementX\" in event) return event.movementX;\n event !== lastMouseEvent &&\n (lastMouseEvent && \"mousemove\" === event.type\n ? ((lastMovementX = event.screenX - lastMouseEvent.screenX),\n (lastMovementY = event.screenY - lastMouseEvent.screenY))\n : (lastMovementY = lastMovementX = 0),\n (lastMouseEvent = event));\n return lastMovementX;\n },\n movementY: function (event) {\n return \"movementY\" in event ? event.movementY : lastMovementY;\n }\n }),\n SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface),\n DragEventInterface = assign({}, MouseEventInterface, { dataTransfer: 0 }),\n SyntheticDragEvent = createSyntheticEvent(DragEventInterface),\n FocusEventInterface = assign({}, UIEventInterface, { relatedTarget: 0 }),\n SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface),\n AnimationEventInterface = assign({}, EventInterface, {\n animationName: 0,\n elapsedTime: 0,\n pseudoElement: 0\n }),\n SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface),\n ClipboardEventInterface = assign({}, EventInterface, {\n clipboardData: function (event) {\n return \"clipboardData\" in event\n ? event.clipboardData\n : window.clipboardData;\n }\n }),\n SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface),\n CompositionEventInterface = assign({}, EventInterface, { data: 0 }),\n SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface),\n normalizeKey = {\n Esc: \"Escape\",\n Spacebar: \" \",\n Left: \"ArrowLeft\",\n Up: \"ArrowUp\",\n Right: \"ArrowRight\",\n Down: \"ArrowDown\",\n Del: \"Delete\",\n Win: \"OS\",\n Menu: \"ContextMenu\",\n Apps: \"ContextMenu\",\n Scroll: \"ScrollLock\",\n MozPrintableKey: \"Unidentified\"\n },\n translateToKey = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 12: \"Clear\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 19: \"Pause\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 45: \"Insert\",\n 46: \"Delete\",\n 112: \"F1\",\n 113: \"F2\",\n 114: \"F3\",\n 115: \"F4\",\n 116: \"F5\",\n 117: \"F6\",\n 118: \"F7\",\n 119: \"F8\",\n 120: \"F9\",\n 121: \"F10\",\n 122: \"F11\",\n 123: \"F12\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 224: \"Meta\"\n },\n modifierKeyToProp = {\n Alt: \"altKey\",\n Control: \"ctrlKey\",\n Meta: \"metaKey\",\n Shift: \"shiftKey\"\n };\nfunction modifierStateGetter(keyArg) {\n var nativeEvent = this.nativeEvent;\n return nativeEvent.getModifierState\n ? nativeEvent.getModifierState(keyArg)\n : (keyArg = modifierKeyToProp[keyArg])\n ? !!nativeEvent[keyArg]\n : !1;\n}\nfunction getEventModifierState() {\n return modifierStateGetter;\n}\nvar KeyboardEventInterface = assign({}, UIEventInterface, {\n key: function (nativeEvent) {\n if (nativeEvent.key) {\n var key = normalizeKey[nativeEvent.key] || nativeEvent.key;\n if (\"Unidentified\" !== key) return key;\n }\n return \"keypress\" === nativeEvent.type\n ? ((nativeEvent = getEventCharCode(nativeEvent)),\n 13 === nativeEvent ? \"Enter\" : String.fromCharCode(nativeEvent))\n : \"keydown\" === nativeEvent.type || \"keyup\" === nativeEvent.type\n ? translateToKey[nativeEvent.keyCode] || \"Unidentified\"\n : \"\";\n },\n code: 0,\n location: 0,\n ctrlKey: 0,\n shiftKey: 0,\n altKey: 0,\n metaKey: 0,\n repeat: 0,\n locale: 0,\n getModifierState: getEventModifierState,\n charCode: function (event) {\n return \"keypress\" === event.type ? getEventCharCode(event) : 0;\n },\n keyCode: function (event) {\n return \"keydown\" === event.type || \"keyup\" === event.type\n ? event.keyCode\n : 0;\n },\n which: function (event) {\n return \"keypress\" === event.type\n ? getEventCharCode(event)\n : \"keydown\" === event.type || \"keyup\" === event.type\n ? event.keyCode\n : 0;\n }\n }),\n SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface),\n PointerEventInterface = assign({}, MouseEventInterface, {\n pointerId: 0,\n width: 0,\n height: 0,\n pressure: 0,\n tangentialPressure: 0,\n tiltX: 0,\n tiltY: 0,\n twist: 0,\n pointerType: 0,\n isPrimary: 0\n }),\n SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface),\n TouchEventInterface = assign({}, UIEventInterface, {\n touches: 0,\n targetTouches: 0,\n changedTouches: 0,\n altKey: 0,\n metaKey: 0,\n ctrlKey: 0,\n shiftKey: 0,\n getModifierState: getEventModifierState\n }),\n SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface),\n TransitionEventInterface = assign({}, EventInterface, {\n propertyName: 0,\n elapsedTime: 0,\n pseudoElement: 0\n }),\n SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface),\n WheelEventInterface = assign({}, MouseEventInterface, {\n deltaX: function (event) {\n return \"deltaX\" in event\n ? event.deltaX\n : \"wheelDeltaX\" in event\n ? -event.wheelDeltaX\n : 0;\n },\n deltaY: function (event) {\n return \"deltaY\" in event\n ? event.deltaY\n : \"wheelDeltaY\" in event\n ? -event.wheelDeltaY\n : \"wheelDelta\" in event\n ? -event.wheelDelta\n : 0;\n },\n deltaZ: 0,\n deltaMode: 0\n }),\n SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface),\n ToggleEventInterface = assign({}, EventInterface, {\n newState: 0,\n oldState: 0\n }),\n SyntheticToggleEvent = createSyntheticEvent(ToggleEventInterface),\n END_KEYCODES = [9, 13, 27, 32],\n canUseCompositionEvent = canUseDOM && \"CompositionEvent\" in window,\n documentMode = null;\ncanUseDOM &&\n \"documentMode\" in document &&\n (documentMode = document.documentMode);\nvar canUseTextInputEvent = canUseDOM && \"TextEvent\" in window && !documentMode,\n useFallbackCompositionData =\n canUseDOM &&\n (!canUseCompositionEvent ||\n (documentMode && 8 < documentMode && 11 >= documentMode)),\n SPACEBAR_CHAR = String.fromCharCode(32),\n hasSpaceKeypress = !1;\nfunction isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case \"keyup\":\n return -1 !== END_KEYCODES.indexOf(nativeEvent.keyCode);\n case \"keydown\":\n return 229 !== nativeEvent.keyCode;\n case \"keypress\":\n case \"mousedown\":\n case \"focusout\":\n return !0;\n default:\n return !1;\n }\n}\nfunction getDataFromCustomEvent(nativeEvent) {\n nativeEvent = nativeEvent.detail;\n return \"object\" === typeof nativeEvent && \"data\" in nativeEvent\n ? nativeEvent.data\n : null;\n}\nvar isComposing = !1;\nfunction getNativeBeforeInputChars(domEventName, nativeEvent) {\n switch (domEventName) {\n case \"compositionend\":\n return getDataFromCustomEvent(nativeEvent);\n case \"keypress\":\n if (32 !== nativeEvent.which) return null;\n hasSpaceKeypress = !0;\n return SPACEBAR_CHAR;\n case \"textInput\":\n return (\n (domEventName = nativeEvent.data),\n domEventName === SPACEBAR_CHAR && hasSpaceKeypress ? null : domEventName\n );\n default:\n return null;\n }\n}\nfunction getFallbackBeforeInputChars(domEventName, nativeEvent) {\n if (isComposing)\n return \"compositionend\" === domEventName ||\n (!canUseCompositionEvent &&\n isFallbackCompositionEnd(domEventName, nativeEvent))\n ? ((domEventName = getData()),\n (fallbackText = startText = root = null),\n (isComposing = !1),\n domEventName)\n : null;\n switch (domEventName) {\n case \"paste\":\n return null;\n case \"keypress\":\n if (\n !(nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) ||\n (nativeEvent.ctrlKey && nativeEvent.altKey)\n ) {\n if (nativeEvent.char && 1 < nativeEvent.char.length)\n return nativeEvent.char;\n if (nativeEvent.which) return String.fromCharCode(nativeEvent.which);\n }\n return null;\n case \"compositionend\":\n return useFallbackCompositionData && \"ko\" !== nativeEvent.locale\n ? null\n : nativeEvent.data;\n default:\n return null;\n }\n}\nvar supportedInputTypes = {\n color: !0,\n date: !0,\n datetime: !0,\n \"datetime-local\": !0,\n email: !0,\n month: !0,\n number: !0,\n password: !0,\n range: !0,\n search: !0,\n tel: !0,\n text: !0,\n time: !0,\n url: !0,\n week: !0\n};\nfunction isTextInputElement(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n return \"input\" === nodeName\n ? !!supportedInputTypes[elem.type]\n : \"textarea\" === nodeName\n ? !0\n : !1;\n}\nfunction createAndAccumulateChangeEvent(\n dispatchQueue,\n inst,\n nativeEvent,\n target\n) {\n restoreTarget\n ? restoreQueue\n ? restoreQueue.push(target)\n : (restoreQueue = [target])\n : (restoreTarget = target);\n inst = accumulateTwoPhaseListeners(inst, \"onChange\");\n 0 < inst.length &&\n ((nativeEvent = new SyntheticEvent(\n \"onChange\",\n \"change\",\n null,\n nativeEvent,\n target\n )),\n dispatchQueue.push({ event: nativeEvent, listeners: inst }));\n}\nvar activeElement$1 = null,\n activeElementInst$1 = null;\nfunction runEventInBatch(dispatchQueue) {\n processDispatchQueue(dispatchQueue, 0);\n}\nfunction getInstIfValueChanged(targetInst) {\n var targetNode = getNodeFromInstance(targetInst);\n if (updateValueIfChanged(targetNode)) return targetInst;\n}\nfunction getTargetInstForChangeEvent(domEventName, targetInst) {\n if (\"change\" === domEventName) return targetInst;\n}\nvar isInputEventSupported = !1;\nif (canUseDOM) {\n var JSCompiler_inline_result$jscomp$286;\n if (canUseDOM) {\n var isSupported$jscomp$inline_427 = \"oninput\" in document;\n if (!isSupported$jscomp$inline_427) {\n var element$jscomp$inline_428 = document.createElement(\"div\");\n element$jscomp$inline_428.setAttribute(\"oninput\", \"return;\");\n isSupported$jscomp$inline_427 =\n \"function\" === typeof element$jscomp$inline_428.oninput;\n }\n JSCompiler_inline_result$jscomp$286 = isSupported$jscomp$inline_427;\n } else JSCompiler_inline_result$jscomp$286 = !1;\n isInputEventSupported =\n JSCompiler_inline_result$jscomp$286 &&\n (!document.documentMode || 9 < document.documentMode);\n}\nfunction stopWatchingForValueChange() {\n activeElement$1 &&\n (activeElement$1.detachEvent(\"onpropertychange\", handlePropertyChange),\n (activeElementInst$1 = activeElement$1 = null));\n}\nfunction handlePropertyChange(nativeEvent) {\n if (\n \"value\" === nativeEvent.propertyName &&\n getInstIfValueChanged(activeElementInst$1)\n ) {\n var dispatchQueue = [];\n createAndAccumulateChangeEvent(\n dispatchQueue,\n activeElementInst$1,\n nativeEvent,\n getEventTarget(nativeEvent)\n );\n batchedUpdates$1(runEventInBatch, dispatchQueue);\n }\n}\nfunction handleEventsForInputEventPolyfill(domEventName, target, targetInst) {\n \"focusin\" === domEventName\n ? (stopWatchingForValueChange(),\n (activeElement$1 = target),\n (activeElementInst$1 = targetInst),\n activeElement$1.attachEvent(\"onpropertychange\", handlePropertyChange))\n : \"focusout\" === domEventName && stopWatchingForValueChange();\n}\nfunction getTargetInstForInputEventPolyfill(domEventName) {\n if (\n \"selectionchange\" === domEventName ||\n \"keyup\" === domEventName ||\n \"keydown\" === domEventName\n )\n return getInstIfValueChanged(activeElementInst$1);\n}\nfunction getTargetInstForClickEvent(domEventName, targetInst) {\n if (\"click\" === domEventName) return getInstIfValueChanged(targetInst);\n}\nfunction getTargetInstForInputOrChangeEvent(domEventName, targetInst) {\n if (\"input\" === domEventName || \"change\" === domEventName)\n return getInstIfValueChanged(targetInst);\n}\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is;\nfunction shallowEqual(objA, objB) {\n if (objectIs(objA, objB)) return !0;\n if (\n \"object\" !== typeof objA ||\n null === objA ||\n \"object\" !== typeof objB ||\n null === objB\n )\n return !1;\n var keysA = Object.keys(objA),\n keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return !1;\n for (keysB = 0; keysB < keysA.length; keysB++) {\n var currentKey = keysA[keysB];\n if (\n !hasOwnProperty.call(objB, currentKey) ||\n !objectIs(objA[currentKey], objB[currentKey])\n )\n return !1;\n }\n return !0;\n}\nfunction getLeafNode(node) {\n for (; node && node.firstChild; ) node = node.firstChild;\n return node;\n}\nfunction getNodeForCharacterOffset(root, offset) {\n var node = getLeafNode(root);\n root = 0;\n for (var nodeEnd; node; ) {\n if (3 === node.nodeType) {\n nodeEnd = root + node.textContent.length;\n if (root <= offset && nodeEnd >= offset)\n return { node: node, offset: offset - root };\n root = nodeEnd;\n }\n a: {\n for (; node; ) {\n if (node.nextSibling) {\n node = node.nextSibling;\n break a;\n }\n node = node.parentNode;\n }\n node = void 0;\n }\n node = getLeafNode(node);\n }\n}\nfunction containsNode(outerNode, innerNode) {\n return outerNode && innerNode\n ? outerNode === innerNode\n ? !0\n : outerNode && 3 === outerNode.nodeType\n ? !1\n : innerNode && 3 === innerNode.nodeType\n ? containsNode(outerNode, innerNode.parentNode)\n : \"contains\" in outerNode\n ? outerNode.contains(innerNode)\n : outerNode.compareDocumentPosition\n ? !!(outerNode.compareDocumentPosition(innerNode) & 16)\n : !1\n : !1;\n}\nfunction getActiveElementDeep(containerInfo) {\n containerInfo =\n null != containerInfo &&\n null != containerInfo.ownerDocument &&\n null != containerInfo.ownerDocument.defaultView\n ? containerInfo.ownerDocument.defaultView\n : window;\n for (\n var element = getActiveElement(containerInfo.document);\n element instanceof containerInfo.HTMLIFrameElement;\n\n ) {\n try {\n var JSCompiler_inline_result =\n \"string\" === typeof element.contentWindow.location.href;\n } catch (err) {\n JSCompiler_inline_result = !1;\n }\n if (JSCompiler_inline_result) containerInfo = element.contentWindow;\n else break;\n element = getActiveElement(containerInfo.document);\n }\n return element;\n}\nfunction hasSelectionCapabilities(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n return (\n nodeName &&\n ((\"input\" === nodeName &&\n (\"text\" === elem.type ||\n \"search\" === elem.type ||\n \"tel\" === elem.type ||\n \"url\" === elem.type ||\n \"password\" === elem.type)) ||\n \"textarea\" === nodeName ||\n \"true\" === elem.contentEditable)\n );\n}\nvar skipSelectionChangeEvent =\n canUseDOM && \"documentMode\" in document && 11 >= document.documentMode,\n activeElement = null,\n activeElementInst = null,\n lastSelection = null,\n mouseDown = !1;\nfunction constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {\n var doc =\n nativeEventTarget.window === nativeEventTarget\n ? nativeEventTarget.document\n : 9 === nativeEventTarget.nodeType\n ? nativeEventTarget\n : nativeEventTarget.ownerDocument;\n mouseDown ||\n null == activeElement ||\n activeElement !== getActiveElement(doc) ||\n ((doc = activeElement),\n \"selectionStart\" in doc && hasSelectionCapabilities(doc)\n ? (doc = { start: doc.selectionStart, end: doc.selectionEnd })\n : ((doc = (\n (doc.ownerDocument && doc.ownerDocument.defaultView) ||\n window\n ).getSelection()),\n (doc = {\n anchorNode: doc.anchorNode,\n anchorOffset: doc.anchorOffset,\n focusNode: doc.focusNode,\n focusOffset: doc.focusOffset\n })),\n (lastSelection && shallowEqual(lastSelection, doc)) ||\n ((lastSelection = doc),\n (doc = accumulateTwoPhaseListeners(activeElementInst, \"onSelect\")),\n 0 < doc.length &&\n ((nativeEvent = new SyntheticEvent(\n \"onSelect\",\n \"select\",\n null,\n nativeEvent,\n nativeEventTarget\n )),\n dispatchQueue.push({ event: nativeEvent, listeners: doc }),\n (nativeEvent.target = activeElement))));\n}\nfunction makePrefixMap(styleProp, eventName) {\n var prefixes = {};\n prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n prefixes[\"Webkit\" + styleProp] = \"webkit\" + eventName;\n prefixes[\"Moz\" + styleProp] = \"moz\" + eventName;\n return prefixes;\n}\nvar vendorPrefixes = {\n animationend: makePrefixMap(\"Animation\", \"AnimationEnd\"),\n animationiteration: makePrefixMap(\"Animation\", \"AnimationIteration\"),\n animationstart: makePrefixMap(\"Animation\", \"AnimationStart\"),\n transitionrun: makePrefixMap(\"Transition\", \"TransitionRun\"),\n transitionstart: makePrefixMap(\"Transition\", \"TransitionStart\"),\n transitioncancel: makePrefixMap(\"Transition\", \"TransitionCancel\"),\n transitionend: makePrefixMap(\"Transition\", \"TransitionEnd\")\n },\n prefixedEventNames = {},\n style = {};\ncanUseDOM &&\n ((style = document.createElement(\"div\").style),\n \"AnimationEvent\" in window ||\n (delete vendorPrefixes.animationend.animation,\n delete vendorPrefixes.animationiteration.animation,\n delete vendorPrefixes.animationstart.animation),\n \"TransitionEvent\" in window ||\n delete vendorPrefixes.transitionend.transition);\nfunction getVendorPrefixedEventName(eventName) {\n if (prefixedEventNames[eventName]) return prefixedEventNames[eventName];\n if (!vendorPrefixes[eventName]) return eventName;\n var prefixMap = vendorPrefixes[eventName],\n styleProp;\n for (styleProp in prefixMap)\n if (prefixMap.hasOwnProperty(styleProp) && styleProp in style)\n return (prefixedEventNames[eventName] = prefixMap[styleProp]);\n return eventName;\n}\nvar ANIMATION_END = getVendorPrefixedEventName(\"animationend\"),\n ANIMATION_ITERATION = getVendorPrefixedEventName(\"animationiteration\"),\n ANIMATION_START = getVendorPrefixedEventName(\"animationstart\"),\n TRANSITION_RUN = getVendorPrefixedEventName(\"transitionrun\"),\n TRANSITION_START = getVendorPrefixedEventName(\"transitionstart\"),\n TRANSITION_CANCEL = getVendorPrefixedEventName(\"transitioncancel\"),\n TRANSITION_END = getVendorPrefixedEventName(\"transitionend\"),\n topLevelEventsToReactNames = new Map(),\n simpleEventPluginEvents =\n \"abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel\".split(\n \" \"\n );\nsimpleEventPluginEvents.push(\"scrollEnd\");\nfunction registerSimpleEvent(domEventName, reactName) {\n topLevelEventsToReactNames.set(domEventName, reactName);\n registerTwoPhaseEvent(reactName, [domEventName]);\n}\nvar reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n },\n concurrentQueues = [],\n concurrentQueuesIndex = 0,\n concurrentlyUpdatedLanes = 0;\nfunction finishQueueingConcurrentUpdates() {\n for (\n var endIndex = concurrentQueuesIndex,\n i = (concurrentlyUpdatedLanes = concurrentQueuesIndex = 0);\n i < endIndex;\n\n ) {\n var fiber = concurrentQueues[i];\n concurrentQueues[i++] = null;\n var queue = concurrentQueues[i];\n concurrentQueues[i++] = null;\n var update = concurrentQueues[i];\n concurrentQueues[i++] = null;\n var lane = concurrentQueues[i];\n concurrentQueues[i++] = null;\n if (null !== queue && null !== update) {\n var pending = queue.pending;\n null === pending\n ? (update.next = update)\n : ((update.next = pending.next), (pending.next = update));\n queue.pending = update;\n }\n 0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane);\n }\n}\nfunction enqueueUpdate$1(fiber, queue, update, lane) {\n concurrentQueues[concurrentQueuesIndex++] = fiber;\n concurrentQueues[concurrentQueuesIndex++] = queue;\n concurrentQueues[concurrentQueuesIndex++] = update;\n concurrentQueues[concurrentQueuesIndex++] = lane;\n concurrentlyUpdatedLanes |= lane;\n fiber.lanes |= lane;\n fiber = fiber.alternate;\n null !== fiber && (fiber.lanes |= lane);\n}\nfunction enqueueConcurrentHookUpdate(fiber, queue, update, lane) {\n enqueueUpdate$1(fiber, queue, update, lane);\n return getRootForUpdatedFiber(fiber);\n}\nfunction enqueueConcurrentRenderForLane(fiber, lane) {\n enqueueUpdate$1(fiber, null, null, lane);\n return getRootForUpdatedFiber(fiber);\n}\nfunction markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) {\n sourceFiber.lanes |= lane;\n var alternate = sourceFiber.alternate;\n null !== alternate && (alternate.lanes |= lane);\n for (var isHidden = !1, parent = sourceFiber.return; null !== parent; )\n (parent.childLanes |= lane),\n (alternate = parent.alternate),\n null !== alternate && (alternate.childLanes |= lane),\n 22 === parent.tag &&\n ((sourceFiber = parent.stateNode),\n null === sourceFiber || sourceFiber._visibility & 1 || (isHidden = !0)),\n (sourceFiber = parent),\n (parent = parent.return);\n return 3 === sourceFiber.tag\n ? ((parent = sourceFiber.stateNode),\n isHidden &&\n null !== update &&\n ((isHidden = 31 - clz32(lane)),\n (sourceFiber = parent.hiddenUpdates),\n (alternate = sourceFiber[isHidden]),\n null === alternate\n ? (sourceFiber[isHidden] = [update])\n : alternate.push(update),\n (update.lane = lane | 536870912)),\n parent)\n : null;\n}\nfunction getRootForUpdatedFiber(sourceFiber) {\n if (50 < nestedUpdateCount)\n throw (\n ((nestedUpdateCount = 0),\n (rootWithNestedUpdates = null),\n Error(formatProdErrorMessage(185)))\n );\n for (var parent = sourceFiber.return; null !== parent; )\n (sourceFiber = parent), (parent = sourceFiber.return);\n return 3 === sourceFiber.tag ? sourceFiber.stateNode : null;\n}\nvar emptyContextObject = {};\nfunction FiberNode(tag, pendingProps, key, mode) {\n this.tag = tag;\n this.key = key;\n this.sibling =\n this.child =\n this.return =\n this.stateNode =\n this.type =\n this.elementType =\n null;\n this.index = 0;\n this.refCleanup = this.ref = null;\n this.pendingProps = pendingProps;\n this.dependencies =\n this.memoizedState =\n this.updateQueue =\n this.memoizedProps =\n null;\n this.mode = mode;\n this.subtreeFlags = this.flags = 0;\n this.deletions = null;\n this.childLanes = this.lanes = 0;\n this.alternate = null;\n}\nfunction createFiberImplClass(tag, pendingProps, key, mode) {\n return new FiberNode(tag, pendingProps, key, mode);\n}\nfunction shouldConstruct(Component) {\n Component = Component.prototype;\n return !(!Component || !Component.isReactComponent);\n}\nfunction createWorkInProgress(current, pendingProps) {\n var workInProgress = current.alternate;\n null === workInProgress\n ? ((workInProgress = createFiberImplClass(\n current.tag,\n pendingProps,\n current.key,\n current.mode\n )),\n (workInProgress.elementType = current.elementType),\n (workInProgress.type = current.type),\n (workInProgress.stateNode = current.stateNode),\n (workInProgress.alternate = current),\n (current.alternate = workInProgress))\n : ((workInProgress.pendingProps = pendingProps),\n (workInProgress.type = current.type),\n (workInProgress.flags = 0),\n (workInProgress.subtreeFlags = 0),\n (workInProgress.deletions = null));\n workInProgress.flags = current.flags & 65011712;\n workInProgress.childLanes = current.childLanes;\n workInProgress.lanes = current.lanes;\n workInProgress.child = current.child;\n workInProgress.memoizedProps = current.memoizedProps;\n workInProgress.memoizedState = current.memoizedState;\n workInProgress.updateQueue = current.updateQueue;\n pendingProps = current.dependencies;\n workInProgress.dependencies =\n null === pendingProps\n ? null\n : { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext };\n workInProgress.sibling = current.sibling;\n workInProgress.index = current.index;\n workInProgress.ref = current.ref;\n workInProgress.refCleanup = current.refCleanup;\n return workInProgress;\n}\nfunction resetWorkInProgress(workInProgress, renderLanes) {\n workInProgress.flags &= 65011714;\n var current = workInProgress.alternate;\n null === current\n ? ((workInProgress.childLanes = 0),\n (workInProgress.lanes = renderLanes),\n (workInProgress.child = null),\n (workInProgress.subtreeFlags = 0),\n (workInProgress.memoizedProps = null),\n (workInProgress.memoizedState = null),\n (workInProgress.updateQueue = null),\n (workInProgress.dependencies = null),\n (workInProgress.stateNode = null))\n : ((workInProgress.childLanes = current.childLanes),\n (workInProgress.lanes = current.lanes),\n (workInProgress.child = current.child),\n (workInProgress.subtreeFlags = 0),\n (workInProgress.deletions = null),\n (workInProgress.memoizedProps = current.memoizedProps),\n (workInProgress.memoizedState = current.memoizedState),\n (workInProgress.updateQueue = current.updateQueue),\n (workInProgress.type = current.type),\n (renderLanes = current.dependencies),\n (workInProgress.dependencies =\n null === renderLanes\n ? null\n : {\n lanes: renderLanes.lanes,\n firstContext: renderLanes.firstContext\n }));\n return workInProgress;\n}\nfunction createFiberFromTypeAndProps(\n type,\n key,\n pendingProps,\n owner,\n mode,\n lanes\n) {\n var fiberTag = 0;\n owner = type;\n if (\"function\" === typeof type) shouldConstruct(type) && (fiberTag = 1);\n else if (\"string\" === typeof type)\n fiberTag = isHostHoistableType(\n type,\n pendingProps,\n contextStackCursor.current\n )\n ? 26\n : \"html\" === type || \"head\" === type || \"body\" === type\n ? 27\n : 5;\n else\n a: switch (type) {\n case REACT_ACTIVITY_TYPE:\n return (\n (type = createFiberImplClass(31, pendingProps, key, mode)),\n (type.elementType = REACT_ACTIVITY_TYPE),\n (type.lanes = lanes),\n type\n );\n case REACT_FRAGMENT_TYPE:\n return createFiberFromFragment(pendingProps.children, mode, lanes, key);\n case REACT_STRICT_MODE_TYPE:\n fiberTag = 8;\n mode |= 24;\n break;\n case REACT_PROFILER_TYPE:\n return (\n (type = createFiberImplClass(12, pendingProps, key, mode | 2)),\n (type.elementType = REACT_PROFILER_TYPE),\n (type.lanes = lanes),\n type\n );\n case REACT_SUSPENSE_TYPE:\n return (\n (type = createFiberImplClass(13, pendingProps, key, mode)),\n (type.elementType = REACT_SUSPENSE_TYPE),\n (type.lanes = lanes),\n type\n );\n case REACT_SUSPENSE_LIST_TYPE:\n return (\n (type = createFiberImplClass(19, pendingProps, key, mode)),\n (type.elementType = REACT_SUSPENSE_LIST_TYPE),\n (type.lanes = lanes),\n type\n );\n default:\n if (\"object\" === typeof type && null !== type)\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n fiberTag = 10;\n break a;\n case REACT_CONSUMER_TYPE:\n fiberTag = 9;\n break a;\n case REACT_FORWARD_REF_TYPE:\n fiberTag = 11;\n break a;\n case REACT_MEMO_TYPE:\n fiberTag = 14;\n break a;\n case REACT_LAZY_TYPE:\n fiberTag = 16;\n owner = null;\n break a;\n }\n fiberTag = 29;\n pendingProps = Error(\n formatProdErrorMessage(130, null === type ? \"null\" : typeof type, \"\")\n );\n owner = null;\n }\n key = createFiberImplClass(fiberTag, pendingProps, key, mode);\n key.elementType = type;\n key.type = owner;\n key.lanes = lanes;\n return key;\n}\nfunction createFiberFromFragment(elements, mode, lanes, key) {\n elements = createFiberImplClass(7, elements, key, mode);\n elements.lanes = lanes;\n return elements;\n}\nfunction createFiberFromText(content, mode, lanes) {\n content = createFiberImplClass(6, content, null, mode);\n content.lanes = lanes;\n return content;\n}\nfunction createFiberFromDehydratedFragment(dehydratedNode) {\n var fiber = createFiberImplClass(18, null, null, 0);\n fiber.stateNode = dehydratedNode;\n return fiber;\n}\nfunction createFiberFromPortal(portal, mode, lanes) {\n mode = createFiberImplClass(\n 4,\n null !== portal.children ? portal.children : [],\n portal.key,\n mode\n );\n mode.lanes = lanes;\n mode.stateNode = {\n containerInfo: portal.containerInfo,\n pendingChildren: null,\n implementation: portal.implementation\n };\n return mode;\n}\nvar CapturedStacks = new WeakMap();\nfunction createCapturedValueAtFiber(value, source) {\n if (\"object\" === typeof value && null !== value) {\n var existing = CapturedStacks.get(value);\n if (void 0 !== existing) return existing;\n source = {\n value: value,\n source: source,\n stack: getStackByFiberInDevAndProd(source)\n };\n CapturedStacks.set(value, source);\n return source;\n }\n return {\n value: value,\n source: source,\n stack: getStackByFiberInDevAndProd(source)\n };\n}\nvar forkStack = [],\n forkStackIndex = 0,\n treeForkProvider = null,\n treeForkCount = 0,\n idStack = [],\n idStackIndex = 0,\n treeContextProvider = null,\n treeContextId = 1,\n treeContextOverflow = \"\";\nfunction pushTreeFork(workInProgress, totalChildren) {\n forkStack[forkStackIndex++] = treeForkCount;\n forkStack[forkStackIndex++] = treeForkProvider;\n treeForkProvider = workInProgress;\n treeForkCount = totalChildren;\n}\nfunction pushTreeId(workInProgress, totalChildren, index) {\n idStack[idStackIndex++] = treeContextId;\n idStack[idStackIndex++] = treeContextOverflow;\n idStack[idStackIndex++] = treeContextProvider;\n treeContextProvider = workInProgress;\n var baseIdWithLeadingBit = treeContextId;\n workInProgress = treeContextOverflow;\n var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;\n baseIdWithLeadingBit &= ~(1 << baseLength);\n index += 1;\n var length = 32 - clz32(totalChildren) + baseLength;\n if (30 < length) {\n var numberOfOverflowBits = baseLength - (baseLength % 5);\n length = (\n baseIdWithLeadingBit &\n ((1 << numberOfOverflowBits) - 1)\n ).toString(32);\n baseIdWithLeadingBit >>= numberOfOverflowBits;\n baseLength -= numberOfOverflowBits;\n treeContextId =\n (1 << (32 - clz32(totalChildren) + baseLength)) |\n (index << baseLength) |\n baseIdWithLeadingBit;\n treeContextOverflow = length + workInProgress;\n } else\n (treeContextId =\n (1 << length) | (index << baseLength) | baseIdWithLeadingBit),\n (treeContextOverflow = workInProgress);\n}\nfunction pushMaterializedTreeId(workInProgress) {\n null !== workInProgress.return &&\n (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0));\n}\nfunction popTreeContext(workInProgress) {\n for (; workInProgress === treeForkProvider; )\n (treeForkProvider = forkStack[--forkStackIndex]),\n (forkStack[forkStackIndex] = null),\n (treeForkCount = forkStack[--forkStackIndex]),\n (forkStack[forkStackIndex] = null);\n for (; workInProgress === treeContextProvider; )\n (treeContextProvider = idStack[--idStackIndex]),\n (idStack[idStackIndex] = null),\n (treeContextOverflow = idStack[--idStackIndex]),\n (idStack[idStackIndex] = null),\n (treeContextId = idStack[--idStackIndex]),\n (idStack[idStackIndex] = null);\n}\nfunction restoreSuspendedTreeContext(workInProgress, suspendedContext) {\n idStack[idStackIndex++] = treeContextId;\n idStack[idStackIndex++] = treeContextOverflow;\n idStack[idStackIndex++] = treeContextProvider;\n treeContextId = suspendedContext.id;\n treeContextOverflow = suspendedContext.overflow;\n treeContextProvider = workInProgress;\n}\nvar hydrationParentFiber = null,\n nextHydratableInstance = null,\n isHydrating = !1,\n hydrationErrors = null,\n rootOrSingletonContext = !1,\n HydrationMismatchException = Error(formatProdErrorMessage(519));\nfunction throwOnHydrationMismatch(fiber) {\n var error = Error(\n formatProdErrorMessage(\n 418,\n 1 < arguments.length && void 0 !== arguments[1] && arguments[1]\n ? \"text\"\n : \"HTML\",\n \"\"\n )\n );\n queueHydrationError(createCapturedValueAtFiber(error, fiber));\n throw HydrationMismatchException;\n}\nfunction prepareToHydrateHostInstance(fiber) {\n var instance = fiber.stateNode,\n type = fiber.type,\n props = fiber.memoizedProps;\n instance[internalInstanceKey] = fiber;\n instance[internalPropsKey] = props;\n switch (type) {\n case \"dialog\":\n listenToNonDelegatedEvent(\"cancel\", instance);\n listenToNonDelegatedEvent(\"close\", instance);\n break;\n case \"iframe\":\n case \"object\":\n case \"embed\":\n listenToNonDelegatedEvent(\"load\", instance);\n break;\n case \"video\":\n case \"audio\":\n for (type = 0; type < mediaEventTypes.length; type++)\n listenToNonDelegatedEvent(mediaEventTypes[type], instance);\n break;\n case \"source\":\n listenToNonDelegatedEvent(\"error\", instance);\n break;\n case \"img\":\n case \"image\":\n case \"link\":\n listenToNonDelegatedEvent(\"error\", instance);\n listenToNonDelegatedEvent(\"load\", instance);\n break;\n case \"details\":\n listenToNonDelegatedEvent(\"toggle\", instance);\n break;\n case \"input\":\n listenToNonDelegatedEvent(\"invalid\", instance);\n initInput(\n instance,\n props.value,\n props.defaultValue,\n props.checked,\n props.defaultChecked,\n props.type,\n props.name,\n !0\n );\n break;\n case \"select\":\n listenToNonDelegatedEvent(\"invalid\", instance);\n break;\n case \"textarea\":\n listenToNonDelegatedEvent(\"invalid\", instance),\n initTextarea(instance, props.value, props.defaultValue, props.children);\n }\n type = props.children;\n (\"string\" !== typeof type &&\n \"number\" !== typeof type &&\n \"bigint\" !== typeof type) ||\n instance.textContent === \"\" + type ||\n !0 === props.suppressHydrationWarning ||\n checkForUnmatchedText(instance.textContent, type)\n ? (null != props.popover &&\n (listenToNonDelegatedEvent(\"beforetoggle\", instance),\n listenToNonDelegatedEvent(\"toggle\", instance)),\n null != props.onScroll && listenToNonDelegatedEvent(\"scroll\", instance),\n null != props.onScrollEnd &&\n listenToNonDelegatedEvent(\"scrollend\", instance),\n null != props.onClick && (instance.onclick = noop$1),\n (instance = !0))\n : (instance = !1);\n instance || throwOnHydrationMismatch(fiber, !0);\n}\nfunction popToNextHostParent(fiber) {\n for (hydrationParentFiber = fiber.return; hydrationParentFiber; )\n switch (hydrationParentFiber.tag) {\n case 5:\n case 31:\n case 13:\n rootOrSingletonContext = !1;\n return;\n case 27:\n case 3:\n rootOrSingletonContext = !0;\n return;\n default:\n hydrationParentFiber = hydrationParentFiber.return;\n }\n}\nfunction popHydrationState(fiber) {\n if (fiber !== hydrationParentFiber) return !1;\n if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1;\n var tag = fiber.tag,\n JSCompiler_temp;\n if ((JSCompiler_temp = 3 !== tag && 27 !== tag)) {\n if ((JSCompiler_temp = 5 === tag))\n (JSCompiler_temp = fiber.type),\n (JSCompiler_temp =\n !(\"form\" !== JSCompiler_temp && \"button\" !== JSCompiler_temp) ||\n shouldSetTextContent(fiber.type, fiber.memoizedProps));\n JSCompiler_temp = !JSCompiler_temp;\n }\n JSCompiler_temp && nextHydratableInstance && throwOnHydrationMismatch(fiber);\n popToNextHostParent(fiber);\n if (13 === tag) {\n fiber = fiber.memoizedState;\n fiber = null !== fiber ? fiber.dehydrated : null;\n if (!fiber) throw Error(formatProdErrorMessage(317));\n nextHydratableInstance =\n getNextHydratableInstanceAfterHydrationBoundary(fiber);\n } else if (31 === tag) {\n fiber = fiber.memoizedState;\n fiber = null !== fiber ? fiber.dehydrated : null;\n if (!fiber) throw Error(formatProdErrorMessage(317));\n nextHydratableInstance =\n getNextHydratableInstanceAfterHydrationBoundary(fiber);\n } else\n 27 === tag\n ? ((tag = nextHydratableInstance),\n isSingletonScope(fiber.type)\n ? ((fiber = previousHydratableOnEnteringScopedSingleton),\n (previousHydratableOnEnteringScopedSingleton = null),\n (nextHydratableInstance = fiber))\n : (nextHydratableInstance = tag))\n : (nextHydratableInstance = hydrationParentFiber\n ? getNextHydratable(fiber.stateNode.nextSibling)\n : null);\n return !0;\n}\nfunction resetHydrationState() {\n nextHydratableInstance = hydrationParentFiber = null;\n isHydrating = !1;\n}\nfunction upgradeHydrationErrorsToRecoverable() {\n var queuedErrors = hydrationErrors;\n null !== queuedErrors &&\n (null === workInProgressRootRecoverableErrors\n ? (workInProgressRootRecoverableErrors = queuedErrors)\n : workInProgressRootRecoverableErrors.push.apply(\n workInProgressRootRecoverableErrors,\n queuedErrors\n ),\n (hydrationErrors = null));\n return queuedErrors;\n}\nfunction queueHydrationError(error) {\n null === hydrationErrors\n ? (hydrationErrors = [error])\n : hydrationErrors.push(error);\n}\nvar valueCursor = createCursor(null),\n currentlyRenderingFiber$1 = null,\n lastContextDependency = null;\nfunction pushProvider(providerFiber, context, nextValue) {\n push(valueCursor, context._currentValue);\n context._currentValue = nextValue;\n}\nfunction popProvider(context) {\n context._currentValue = valueCursor.current;\n pop(valueCursor);\n}\nfunction scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) {\n for (; null !== parent; ) {\n var alternate = parent.alternate;\n (parent.childLanes & renderLanes) !== renderLanes\n ? ((parent.childLanes |= renderLanes),\n null !== alternate && (alternate.childLanes |= renderLanes))\n : null !== alternate &&\n (alternate.childLanes & renderLanes) !== renderLanes &&\n (alternate.childLanes |= renderLanes);\n if (parent === propagationRoot) break;\n parent = parent.return;\n }\n}\nfunction propagateContextChanges(\n workInProgress,\n contexts,\n renderLanes,\n forcePropagateEntireTree\n) {\n var fiber = workInProgress.child;\n null !== fiber && (fiber.return = workInProgress);\n for (; null !== fiber; ) {\n var list = fiber.dependencies;\n if (null !== list) {\n var nextFiber = fiber.child;\n list = list.firstContext;\n a: for (; null !== list; ) {\n var dependency = list;\n list = fiber;\n for (var i = 0; i < contexts.length; i++)\n if (dependency.context === contexts[i]) {\n list.lanes |= renderLanes;\n dependency = list.alternate;\n null !== dependency && (dependency.lanes |= renderLanes);\n scheduleContextWorkOnParentPath(\n list.return,\n renderLanes,\n workInProgress\n );\n forcePropagateEntireTree || (nextFiber = null);\n break a;\n }\n list = dependency.next;\n }\n } else if (18 === fiber.tag) {\n nextFiber = fiber.return;\n if (null === nextFiber) throw Error(formatProdErrorMessage(341));\n nextFiber.lanes |= renderLanes;\n list = nextFiber.alternate;\n null !== list && (list.lanes |= renderLanes);\n scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress);\n nextFiber = null;\n } else nextFiber = fiber.child;\n if (null !== nextFiber) nextFiber.return = fiber;\n else\n for (nextFiber = fiber; null !== nextFiber; ) {\n if (nextFiber === workInProgress) {\n nextFiber = null;\n break;\n }\n fiber = nextFiber.sibling;\n if (null !== fiber) {\n fiber.return = nextFiber.return;\n nextFiber = fiber;\n break;\n }\n nextFiber = nextFiber.return;\n }\n fiber = nextFiber;\n }\n}\nfunction propagateParentContextChanges(\n current,\n workInProgress,\n renderLanes,\n forcePropagateEntireTree\n) {\n current = null;\n for (\n var parent = workInProgress, isInsidePropagationBailout = !1;\n null !== parent;\n\n ) {\n if (!isInsidePropagationBailout)\n if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0;\n else if (0 !== (parent.flags & 262144)) break;\n if (10 === parent.tag) {\n var currentParent = parent.alternate;\n if (null === currentParent) throw Error(formatProdErrorMessage(387));\n currentParent = currentParent.memoizedProps;\n if (null !== currentParent) {\n var context = parent.type;\n objectIs(parent.pendingProps.value, currentParent.value) ||\n (null !== current ? current.push(context) : (current = [context]));\n }\n } else if (parent === hostTransitionProviderCursor.current) {\n currentParent = parent.alternate;\n if (null === currentParent) throw Error(formatProdErrorMessage(387));\n currentParent.memoizedState.memoizedState !==\n parent.memoizedState.memoizedState &&\n (null !== current\n ? current.push(HostTransitionContext)\n : (current = [HostTransitionContext]));\n }\n parent = parent.return;\n }\n null !== current &&\n propagateContextChanges(\n workInProgress,\n current,\n renderLanes,\n forcePropagateEntireTree\n );\n workInProgress.flags |= 262144;\n}\nfunction checkIfContextChanged(currentDependencies) {\n for (\n currentDependencies = currentDependencies.firstContext;\n null !== currentDependencies;\n\n ) {\n if (\n !objectIs(\n currentDependencies.context._currentValue,\n currentDependencies.memoizedValue\n )\n )\n return !0;\n currentDependencies = currentDependencies.next;\n }\n return !1;\n}\nfunction prepareToReadContext(workInProgress) {\n currentlyRenderingFiber$1 = workInProgress;\n lastContextDependency = null;\n workInProgress = workInProgress.dependencies;\n null !== workInProgress && (workInProgress.firstContext = null);\n}\nfunction readContext(context) {\n return readContextForConsumer(currentlyRenderingFiber$1, context);\n}\nfunction readContextDuringReconciliation(consumer, context) {\n null === currentlyRenderingFiber$1 && prepareToReadContext(consumer);\n return readContextForConsumer(consumer, context);\n}\nfunction readContextForConsumer(consumer, context) {\n var value = context._currentValue;\n context = { context: context, memoizedValue: value, next: null };\n if (null === lastContextDependency) {\n if (null === consumer) throw Error(formatProdErrorMessage(308));\n lastContextDependency = context;\n consumer.dependencies = { lanes: 0, firstContext: context };\n consumer.flags |= 524288;\n } else lastContextDependency = lastContextDependency.next = context;\n return value;\n}\nvar AbortControllerLocal =\n \"undefined\" !== typeof AbortController\n ? AbortController\n : function () {\n var listeners = [],\n signal = (this.signal = {\n aborted: !1,\n addEventListener: function (type, listener) {\n listeners.push(listener);\n }\n });\n this.abort = function () {\n signal.aborted = !0;\n listeners.forEach(function (listener) {\n return listener();\n });\n };\n },\n scheduleCallback$2 = Scheduler.unstable_scheduleCallback,\n NormalPriority = Scheduler.unstable_NormalPriority,\n CacheContext = {\n $$typeof: REACT_CONTEXT_TYPE,\n Consumer: null,\n Provider: null,\n _currentValue: null,\n _currentValue2: null,\n _threadCount: 0\n };\nfunction createCache() {\n return {\n controller: new AbortControllerLocal(),\n data: new Map(),\n refCount: 0\n };\n}\nfunction releaseCache(cache) {\n cache.refCount--;\n 0 === cache.refCount &&\n scheduleCallback$2(NormalPriority, function () {\n cache.controller.abort();\n });\n}\nvar currentEntangledListeners = null,\n currentEntangledPendingCount = 0,\n currentEntangledLane = 0,\n currentEntangledActionThenable = null;\nfunction entangleAsyncAction(transition, thenable) {\n if (null === currentEntangledListeners) {\n var entangledListeners = (currentEntangledListeners = []);\n currentEntangledPendingCount = 0;\n currentEntangledLane = requestTransitionLane();\n currentEntangledActionThenable = {\n status: \"pending\",\n value: void 0,\n then: function (resolve) {\n entangledListeners.push(resolve);\n }\n };\n }\n currentEntangledPendingCount++;\n thenable.then(pingEngtangledActionScope, pingEngtangledActionScope);\n return thenable;\n}\nfunction pingEngtangledActionScope() {\n if (\n 0 === --currentEntangledPendingCount &&\n null !== currentEntangledListeners\n ) {\n null !== currentEntangledActionThenable &&\n (currentEntangledActionThenable.status = \"fulfilled\");\n var listeners = currentEntangledListeners;\n currentEntangledListeners = null;\n currentEntangledLane = 0;\n currentEntangledActionThenable = null;\n for (var i = 0; i < listeners.length; i++) (0, listeners[i])();\n }\n}\nfunction chainThenableValue(thenable, result) {\n var listeners = [],\n thenableWithOverride = {\n status: \"pending\",\n value: null,\n reason: null,\n then: function (resolve) {\n listeners.push(resolve);\n }\n };\n thenable.then(\n function () {\n thenableWithOverride.status = \"fulfilled\";\n thenableWithOverride.value = result;\n for (var i = 0; i < listeners.length; i++) (0, listeners[i])(result);\n },\n function (error) {\n thenableWithOverride.status = \"rejected\";\n thenableWithOverride.reason = error;\n for (error = 0; error < listeners.length; error++)\n (0, listeners[error])(void 0);\n }\n );\n return thenableWithOverride;\n}\nvar prevOnStartTransitionFinish = ReactSharedInternals.S;\nReactSharedInternals.S = function (transition, returnValue) {\n globalMostRecentTransitionTime = now();\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n entangleAsyncAction(transition, returnValue);\n null !== prevOnStartTransitionFinish &&\n prevOnStartTransitionFinish(transition, returnValue);\n};\nvar resumedCache = createCursor(null);\nfunction peekCacheFromPool() {\n var cacheResumedFromPreviousRender = resumedCache.current;\n return null !== cacheResumedFromPreviousRender\n ? cacheResumedFromPreviousRender\n : workInProgressRoot.pooledCache;\n}\nfunction pushTransition(offscreenWorkInProgress, prevCachePool) {\n null === prevCachePool\n ? push(resumedCache, resumedCache.current)\n : push(resumedCache, prevCachePool.pool);\n}\nfunction getSuspendedCache() {\n var cacheFromPool = peekCacheFromPool();\n return null === cacheFromPool\n ? null\n : { parent: CacheContext._currentValue, pool: cacheFromPool };\n}\nvar SuspenseException = Error(formatProdErrorMessage(460)),\n SuspenseyCommitException = Error(formatProdErrorMessage(474)),\n SuspenseActionException = Error(formatProdErrorMessage(542)),\n noopSuspenseyCommitThenable = { then: function () {} };\nfunction isThenableResolved(thenable) {\n thenable = thenable.status;\n return \"fulfilled\" === thenable || \"rejected\" === thenable;\n}\nfunction trackUsedThenable(thenableState, thenable, index) {\n index = thenableState[index];\n void 0 === index\n ? thenableState.push(thenable)\n : index !== thenable && (thenable.then(noop$1, noop$1), (thenable = index));\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw (\n ((thenableState = thenable.reason),\n checkIfUseWrappedInAsyncCatch(thenableState),\n thenableState)\n );\n default:\n if (\"string\" === typeof thenable.status) thenable.then(noop$1, noop$1);\n else {\n thenableState = workInProgressRoot;\n if (null !== thenableState && 100 < thenableState.shellSuspendCounter)\n throw Error(formatProdErrorMessage(482));\n thenableState = thenable;\n thenableState.status = \"pending\";\n thenableState.then(\n function (fulfilledValue) {\n if (\"pending\" === thenable.status) {\n var fulfilledThenable = thenable;\n fulfilledThenable.status = \"fulfilled\";\n fulfilledThenable.value = fulfilledValue;\n }\n },\n function (error) {\n if (\"pending\" === thenable.status) {\n var rejectedThenable = thenable;\n rejectedThenable.status = \"rejected\";\n rejectedThenable.reason = error;\n }\n }\n );\n }\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw (\n ((thenableState = thenable.reason),\n checkIfUseWrappedInAsyncCatch(thenableState),\n thenableState)\n );\n }\n suspendedThenable = thenable;\n throw SuspenseException;\n }\n}\nfunction resolveLazy(lazyType) {\n try {\n var init = lazyType._init;\n return init(lazyType._payload);\n } catch (x) {\n if (null !== x && \"object\" === typeof x && \"function\" === typeof x.then)\n throw ((suspendedThenable = x), SuspenseException);\n throw x;\n }\n}\nvar suspendedThenable = null;\nfunction getSuspendedThenable() {\n if (null === suspendedThenable) throw Error(formatProdErrorMessage(459));\n var thenable = suspendedThenable;\n suspendedThenable = null;\n return thenable;\n}\nfunction checkIfUseWrappedInAsyncCatch(rejectedReason) {\n if (\n rejectedReason === SuspenseException ||\n rejectedReason === SuspenseActionException\n )\n throw Error(formatProdErrorMessage(483));\n}\nvar thenableState$1 = null,\n thenableIndexCounter$1 = 0;\nfunction unwrapThenable(thenable) {\n var index = thenableIndexCounter$1;\n thenableIndexCounter$1 += 1;\n null === thenableState$1 && (thenableState$1 = []);\n return trackUsedThenable(thenableState$1, thenable, index);\n}\nfunction coerceRef(workInProgress, element) {\n element = element.props.ref;\n workInProgress.ref = void 0 !== element ? element : null;\n}\nfunction throwOnInvalidObjectTypeImpl(returnFiber, newChild) {\n if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)\n throw Error(formatProdErrorMessage(525));\n returnFiber = Object.prototype.toString.call(newChild);\n throw Error(\n formatProdErrorMessage(\n 31,\n \"[object Object]\" === returnFiber\n ? \"object with keys {\" + Object.keys(newChild).join(\", \") + \"}\"\n : returnFiber\n )\n );\n}\nfunction createChildReconciler(shouldTrackSideEffects) {\n function deleteChild(returnFiber, childToDelete) {\n if (shouldTrackSideEffects) {\n var deletions = returnFiber.deletions;\n null === deletions\n ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16))\n : deletions.push(childToDelete);\n }\n }\n function deleteRemainingChildren(returnFiber, currentFirstChild) {\n if (!shouldTrackSideEffects) return null;\n for (; null !== currentFirstChild; )\n deleteChild(returnFiber, currentFirstChild),\n (currentFirstChild = currentFirstChild.sibling);\n return null;\n }\n function mapRemainingChildren(currentFirstChild) {\n for (var existingChildren = new Map(); null !== currentFirstChild; )\n null !== currentFirstChild.key\n ? existingChildren.set(currentFirstChild.key, currentFirstChild)\n : existingChildren.set(currentFirstChild.index, currentFirstChild),\n (currentFirstChild = currentFirstChild.sibling);\n return existingChildren;\n }\n function useFiber(fiber, pendingProps) {\n fiber = createWorkInProgress(fiber, pendingProps);\n fiber.index = 0;\n fiber.sibling = null;\n return fiber;\n }\n function placeChild(newFiber, lastPlacedIndex, newIndex) {\n newFiber.index = newIndex;\n if (!shouldTrackSideEffects)\n return (newFiber.flags |= 1048576), lastPlacedIndex;\n newIndex = newFiber.alternate;\n if (null !== newIndex)\n return (\n (newIndex = newIndex.index),\n newIndex < lastPlacedIndex\n ? ((newFiber.flags |= 67108866), lastPlacedIndex)\n : newIndex\n );\n newFiber.flags |= 67108866;\n return lastPlacedIndex;\n }\n function placeSingleChild(newFiber) {\n shouldTrackSideEffects &&\n null === newFiber.alternate &&\n (newFiber.flags |= 67108866);\n return newFiber;\n }\n function updateTextNode(returnFiber, current, textContent, lanes) {\n if (null === current || 6 !== current.tag)\n return (\n (current = createFiberFromText(textContent, returnFiber.mode, lanes)),\n (current.return = returnFiber),\n current\n );\n current = useFiber(current, textContent);\n current.return = returnFiber;\n return current;\n }\n function updateElement(returnFiber, current, element, lanes) {\n var elementType = element.type;\n if (elementType === REACT_FRAGMENT_TYPE)\n return updateFragment(\n returnFiber,\n current,\n element.props.children,\n lanes,\n element.key\n );\n if (\n null !== current &&\n (current.elementType === elementType ||\n (\"object\" === typeof elementType &&\n null !== elementType &&\n elementType.$$typeof === REACT_LAZY_TYPE &&\n resolveLazy(elementType) === current.type))\n )\n return (\n (current = useFiber(current, element.props)),\n coerceRef(current, element),\n (current.return = returnFiber),\n current\n );\n current = createFiberFromTypeAndProps(\n element.type,\n element.key,\n element.props,\n null,\n returnFiber.mode,\n lanes\n );\n coerceRef(current, element);\n current.return = returnFiber;\n return current;\n }\n function updatePortal(returnFiber, current, portal, lanes) {\n if (\n null === current ||\n 4 !== current.tag ||\n current.stateNode.containerInfo !== portal.containerInfo ||\n current.stateNode.implementation !== portal.implementation\n )\n return (\n (current = createFiberFromPortal(portal, returnFiber.mode, lanes)),\n (current.return = returnFiber),\n current\n );\n current = useFiber(current, portal.children || []);\n current.return = returnFiber;\n return current;\n }\n function updateFragment(returnFiber, current, fragment, lanes, key) {\n if (null === current || 7 !== current.tag)\n return (\n (current = createFiberFromFragment(\n fragment,\n returnFiber.mode,\n lanes,\n key\n )),\n (current.return = returnFiber),\n current\n );\n current = useFiber(current, fragment);\n current.return = returnFiber;\n return current;\n }\n function createChild(returnFiber, newChild, lanes) {\n if (\n (\"string\" === typeof newChild && \"\" !== newChild) ||\n \"number\" === typeof newChild ||\n \"bigint\" === typeof newChild\n )\n return (\n (newChild = createFiberFromText(\n \"\" + newChild,\n returnFiber.mode,\n lanes\n )),\n (newChild.return = returnFiber),\n newChild\n );\n if (\"object\" === typeof newChild && null !== newChild) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return (\n (lanes = createFiberFromTypeAndProps(\n newChild.type,\n newChild.key,\n newChild.props,\n null,\n returnFiber.mode,\n lanes\n )),\n coerceRef(lanes, newChild),\n (lanes.return = returnFiber),\n lanes\n );\n case REACT_PORTAL_TYPE:\n return (\n (newChild = createFiberFromPortal(\n newChild,\n returnFiber.mode,\n lanes\n )),\n (newChild.return = returnFiber),\n newChild\n );\n case REACT_LAZY_TYPE:\n return (\n (newChild = resolveLazy(newChild)),\n createChild(returnFiber, newChild, lanes)\n );\n }\n if (isArrayImpl(newChild) || getIteratorFn(newChild))\n return (\n (newChild = createFiberFromFragment(\n newChild,\n returnFiber.mode,\n lanes,\n null\n )),\n (newChild.return = returnFiber),\n newChild\n );\n if (\"function\" === typeof newChild.then)\n return createChild(returnFiber, unwrapThenable(newChild), lanes);\n if (newChild.$$typeof === REACT_CONTEXT_TYPE)\n return createChild(\n returnFiber,\n readContextDuringReconciliation(returnFiber, newChild),\n lanes\n );\n throwOnInvalidObjectTypeImpl(returnFiber, newChild);\n }\n return null;\n }\n function updateSlot(returnFiber, oldFiber, newChild, lanes) {\n var key = null !== oldFiber ? oldFiber.key : null;\n if (\n (\"string\" === typeof newChild && \"\" !== newChild) ||\n \"number\" === typeof newChild ||\n \"bigint\" === typeof newChild\n )\n return null !== key\n ? null\n : updateTextNode(returnFiber, oldFiber, \"\" + newChild, lanes);\n if (\"object\" === typeof newChild && null !== newChild) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return newChild.key === key\n ? updateElement(returnFiber, oldFiber, newChild, lanes)\n : null;\n case REACT_PORTAL_TYPE:\n return newChild.key === key\n ? updatePortal(returnFiber, oldFiber, newChild, lanes)\n : null;\n case REACT_LAZY_TYPE:\n return (\n (newChild = resolveLazy(newChild)),\n updateSlot(returnFiber, oldFiber, newChild, lanes)\n );\n }\n if (isArrayImpl(newChild) || getIteratorFn(newChild))\n return null !== key\n ? null\n : updateFragment(returnFiber, oldFiber, newChild, lanes, null);\n if (\"function\" === typeof newChild.then)\n return updateSlot(\n returnFiber,\n oldFiber,\n unwrapThenable(newChild),\n lanes\n );\n if (newChild.$$typeof === REACT_CONTEXT_TYPE)\n return updateSlot(\n returnFiber,\n oldFiber,\n readContextDuringReconciliation(returnFiber, newChild),\n lanes\n );\n throwOnInvalidObjectTypeImpl(returnFiber, newChild);\n }\n return null;\n }\n function updateFromMap(\n existingChildren,\n returnFiber,\n newIdx,\n newChild,\n lanes\n ) {\n if (\n (\"string\" === typeof newChild && \"\" !== newChild) ||\n \"number\" === typeof newChild ||\n \"bigint\" === typeof newChild\n )\n return (\n (existingChildren = existingChildren.get(newIdx) || null),\n updateTextNode(returnFiber, existingChildren, \"\" + newChild, lanes)\n );\n if (\"object\" === typeof newChild && null !== newChild) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return (\n (existingChildren =\n existingChildren.get(\n null === newChild.key ? newIdx : newChild.key\n ) || null),\n updateElement(returnFiber, existingChildren, newChild, lanes)\n );\n case REACT_PORTAL_TYPE:\n return (\n (existingChildren =\n existingChildren.get(\n null === newChild.key ? newIdx : newChild.key\n ) || null),\n updatePortal(returnFiber, existingChildren, newChild, lanes)\n );\n case REACT_LAZY_TYPE:\n return (\n (newChild = resolveLazy(newChild)),\n updateFromMap(\n existingChildren,\n returnFiber,\n newIdx,\n newChild,\n lanes\n )\n );\n }\n if (isArrayImpl(newChild) || getIteratorFn(newChild))\n return (\n (existingChildren = existingChildren.get(newIdx) || null),\n updateFragment(returnFiber, existingChildren, newChild, lanes, null)\n );\n if (\"function\" === typeof newChild.then)\n return updateFromMap(\n existingChildren,\n returnFiber,\n newIdx,\n unwrapThenable(newChild),\n lanes\n );\n if (newChild.$$typeof === REACT_CONTEXT_TYPE)\n return updateFromMap(\n existingChildren,\n returnFiber,\n newIdx,\n readContextDuringReconciliation(returnFiber, newChild),\n lanes\n );\n throwOnInvalidObjectTypeImpl(returnFiber, newChild);\n }\n return null;\n }\n function reconcileChildrenArray(\n returnFiber,\n currentFirstChild,\n newChildren,\n lanes\n ) {\n for (\n var resultingFirstChild = null,\n previousNewFiber = null,\n oldFiber = currentFirstChild,\n newIdx = (currentFirstChild = 0),\n nextOldFiber = null;\n null !== oldFiber && newIdx < newChildren.length;\n newIdx++\n ) {\n oldFiber.index > newIdx\n ? ((nextOldFiber = oldFiber), (oldFiber = null))\n : (nextOldFiber = oldFiber.sibling);\n var newFiber = updateSlot(\n returnFiber,\n oldFiber,\n newChildren[newIdx],\n lanes\n );\n if (null === newFiber) {\n null === oldFiber && (oldFiber = nextOldFiber);\n break;\n }\n shouldTrackSideEffects &&\n oldFiber &&\n null === newFiber.alternate &&\n deleteChild(returnFiber, oldFiber);\n currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);\n null === previousNewFiber\n ? (resultingFirstChild = newFiber)\n : (previousNewFiber.sibling = newFiber);\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n if (newIdx === newChildren.length)\n return (\n deleteRemainingChildren(returnFiber, oldFiber),\n isHydrating && pushTreeFork(returnFiber, newIdx),\n resultingFirstChild\n );\n if (null === oldFiber) {\n for (; newIdx < newChildren.length; newIdx++)\n (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)),\n null !== oldFiber &&\n ((currentFirstChild = placeChild(\n oldFiber,\n currentFirstChild,\n newIdx\n )),\n null === previousNewFiber\n ? (resultingFirstChild = oldFiber)\n : (previousNewFiber.sibling = oldFiber),\n (previousNewFiber = oldFiber));\n isHydrating && pushTreeFork(returnFiber, newIdx);\n return resultingFirstChild;\n }\n for (\n oldFiber = mapRemainingChildren(oldFiber);\n newIdx < newChildren.length;\n newIdx++\n )\n (nextOldFiber = updateFromMap(\n oldFiber,\n returnFiber,\n newIdx,\n newChildren[newIdx],\n lanes\n )),\n null !== nextOldFiber &&\n (shouldTrackSideEffects &&\n null !== nextOldFiber.alternate &&\n oldFiber.delete(\n null === nextOldFiber.key ? newIdx : nextOldFiber.key\n ),\n (currentFirstChild = placeChild(\n nextOldFiber,\n currentFirstChild,\n newIdx\n )),\n null === previousNewFiber\n ? (resultingFirstChild = nextOldFiber)\n : (previousNewFiber.sibling = nextOldFiber),\n (previousNewFiber = nextOldFiber));\n shouldTrackSideEffects &&\n oldFiber.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n isHydrating && pushTreeFork(returnFiber, newIdx);\n return resultingFirstChild;\n }\n function reconcileChildrenIterator(\n returnFiber,\n currentFirstChild,\n newChildren,\n lanes\n ) {\n if (null == newChildren) throw Error(formatProdErrorMessage(151));\n for (\n var resultingFirstChild = null,\n previousNewFiber = null,\n oldFiber = currentFirstChild,\n newIdx = (currentFirstChild = 0),\n nextOldFiber = null,\n step = newChildren.next();\n null !== oldFiber && !step.done;\n newIdx++, step = newChildren.next()\n ) {\n oldFiber.index > newIdx\n ? ((nextOldFiber = oldFiber), (oldFiber = null))\n : (nextOldFiber = oldFiber.sibling);\n var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);\n if (null === newFiber) {\n null === oldFiber && (oldFiber = nextOldFiber);\n break;\n }\n shouldTrackSideEffects &&\n oldFiber &&\n null === newFiber.alternate &&\n deleteChild(returnFiber, oldFiber);\n currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);\n null === previousNewFiber\n ? (resultingFirstChild = newFiber)\n : (previousNewFiber.sibling = newFiber);\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n if (step.done)\n return (\n deleteRemainingChildren(returnFiber, oldFiber),\n isHydrating && pushTreeFork(returnFiber, newIdx),\n resultingFirstChild\n );\n if (null === oldFiber) {\n for (; !step.done; newIdx++, step = newChildren.next())\n (step = createChild(returnFiber, step.value, lanes)),\n null !== step &&\n ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)),\n null === previousNewFiber\n ? (resultingFirstChild = step)\n : (previousNewFiber.sibling = step),\n (previousNewFiber = step));\n isHydrating && pushTreeFork(returnFiber, newIdx);\n return resultingFirstChild;\n }\n for (\n oldFiber = mapRemainingChildren(oldFiber);\n !step.done;\n newIdx++, step = newChildren.next()\n )\n (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)),\n null !== step &&\n (shouldTrackSideEffects &&\n null !== step.alternate &&\n oldFiber.delete(null === step.key ? newIdx : step.key),\n (currentFirstChild = placeChild(step, currentFirstChild, newIdx)),\n null === previousNewFiber\n ? (resultingFirstChild = step)\n : (previousNewFiber.sibling = step),\n (previousNewFiber = step));\n shouldTrackSideEffects &&\n oldFiber.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n isHydrating && pushTreeFork(returnFiber, newIdx);\n return resultingFirstChild;\n }\n function reconcileChildFibersImpl(\n returnFiber,\n currentFirstChild,\n newChild,\n lanes\n ) {\n \"object\" === typeof newChild &&\n null !== newChild &&\n newChild.type === REACT_FRAGMENT_TYPE &&\n null === newChild.key &&\n (newChild = newChild.props.children);\n if (\"object\" === typeof newChild && null !== newChild) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n a: {\n for (var key = newChild.key; null !== currentFirstChild; ) {\n if (currentFirstChild.key === key) {\n key = newChild.type;\n if (key === REACT_FRAGMENT_TYPE) {\n if (7 === currentFirstChild.tag) {\n deleteRemainingChildren(\n returnFiber,\n currentFirstChild.sibling\n );\n lanes = useFiber(\n currentFirstChild,\n newChild.props.children\n );\n lanes.return = returnFiber;\n returnFiber = lanes;\n break a;\n }\n } else if (\n currentFirstChild.elementType === key ||\n (\"object\" === typeof key &&\n null !== key &&\n key.$$typeof === REACT_LAZY_TYPE &&\n resolveLazy(key) === currentFirstChild.type)\n ) {\n deleteRemainingChildren(\n returnFiber,\n currentFirstChild.sibling\n );\n lanes = useFiber(currentFirstChild, newChild.props);\n coerceRef(lanes, newChild);\n lanes.return = returnFiber;\n returnFiber = lanes;\n break a;\n }\n deleteRemainingChildren(returnFiber, currentFirstChild);\n break;\n } else deleteChild(returnFiber, currentFirstChild);\n currentFirstChild = currentFirstChild.sibling;\n }\n newChild.type === REACT_FRAGMENT_TYPE\n ? ((lanes = createFiberFromFragment(\n newChild.props.children,\n returnFiber.mode,\n lanes,\n newChild.key\n )),\n (lanes.return = returnFiber),\n (returnFiber = lanes))\n : ((lanes = createFiberFromTypeAndProps(\n newChild.type,\n newChild.key,\n newChild.props,\n null,\n returnFiber.mode,\n lanes\n )),\n coerceRef(lanes, newChild),\n (lanes.return = returnFiber),\n (returnFiber = lanes));\n }\n return placeSingleChild(returnFiber);\n case REACT_PORTAL_TYPE:\n a: {\n for (key = newChild.key; null !== currentFirstChild; ) {\n if (currentFirstChild.key === key)\n if (\n 4 === currentFirstChild.tag &&\n currentFirstChild.stateNode.containerInfo ===\n newChild.containerInfo &&\n currentFirstChild.stateNode.implementation ===\n newChild.implementation\n ) {\n deleteRemainingChildren(\n returnFiber,\n currentFirstChild.sibling\n );\n lanes = useFiber(currentFirstChild, newChild.children || []);\n lanes.return = returnFiber;\n returnFiber = lanes;\n break a;\n } else {\n deleteRemainingChildren(returnFiber, currentFirstChild);\n break;\n }\n else deleteChild(returnFiber, currentFirstChild);\n currentFirstChild = currentFirstChild.sibling;\n }\n lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes);\n lanes.return = returnFiber;\n returnFiber = lanes;\n }\n return placeSingleChild(returnFiber);\n case REACT_LAZY_TYPE:\n return (\n (newChild = resolveLazy(newChild)),\n reconcileChildFibersImpl(\n returnFiber,\n currentFirstChild,\n newChild,\n lanes\n )\n );\n }\n if (isArrayImpl(newChild))\n return reconcileChildrenArray(\n returnFiber,\n currentFirstChild,\n newChild,\n lanes\n );\n if (getIteratorFn(newChild)) {\n key = getIteratorFn(newChild);\n if (\"function\" !== typeof key) throw Error(formatProdErrorMessage(150));\n newChild = key.call(newChild);\n return reconcileChildrenIterator(\n returnFiber,\n currentFirstChild,\n newChild,\n lanes\n );\n }\n if (\"function\" === typeof newChild.then)\n return reconcileChildFibersImpl(\n returnFiber,\n currentFirstChild,\n unwrapThenable(newChild),\n lanes\n );\n if (newChild.$$typeof === REACT_CONTEXT_TYPE)\n return reconcileChildFibersImpl(\n returnFiber,\n currentFirstChild,\n readContextDuringReconciliation(returnFiber, newChild),\n lanes\n );\n throwOnInvalidObjectTypeImpl(returnFiber, newChild);\n }\n return (\"string\" === typeof newChild && \"\" !== newChild) ||\n \"number\" === typeof newChild ||\n \"bigint\" === typeof newChild\n ? ((newChild = \"\" + newChild),\n null !== currentFirstChild && 6 === currentFirstChild.tag\n ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),\n (lanes = useFiber(currentFirstChild, newChild)),\n (lanes.return = returnFiber),\n (returnFiber = lanes))\n : (deleteRemainingChildren(returnFiber, currentFirstChild),\n (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)),\n (lanes.return = returnFiber),\n (returnFiber = lanes)),\n placeSingleChild(returnFiber))\n : deleteRemainingChildren(returnFiber, currentFirstChild);\n }\n return function (returnFiber, currentFirstChild, newChild, lanes) {\n try {\n thenableIndexCounter$1 = 0;\n var firstChildFiber = reconcileChildFibersImpl(\n returnFiber,\n currentFirstChild,\n newChild,\n lanes\n );\n thenableState$1 = null;\n return firstChildFiber;\n } catch (x) {\n if (x === SuspenseException || x === SuspenseActionException) throw x;\n var fiber = createFiberImplClass(29, x, null, returnFiber.mode);\n fiber.lanes = lanes;\n fiber.return = returnFiber;\n return fiber;\n } finally {\n }\n };\n}\nvar reconcileChildFibers = createChildReconciler(!0),\n mountChildFibers = createChildReconciler(!1),\n hasForceUpdate = !1;\nfunction initializeUpdateQueue(fiber) {\n fiber.updateQueue = {\n baseState: fiber.memoizedState,\n firstBaseUpdate: null,\n lastBaseUpdate: null,\n shared: { pending: null, lanes: 0, hiddenCallbacks: null },\n callbacks: null\n };\n}\nfunction cloneUpdateQueue(current, workInProgress) {\n current = current.updateQueue;\n workInProgress.updateQueue === current &&\n (workInProgress.updateQueue = {\n baseState: current.baseState,\n firstBaseUpdate: current.firstBaseUpdate,\n lastBaseUpdate: current.lastBaseUpdate,\n shared: current.shared,\n callbacks: null\n });\n}\nfunction createUpdate(lane) {\n return { lane: lane, tag: 0, payload: null, callback: null, next: null };\n}\nfunction enqueueUpdate(fiber, update, lane) {\n var updateQueue = fiber.updateQueue;\n if (null === updateQueue) return null;\n updateQueue = updateQueue.shared;\n if (0 !== (executionContext & 2)) {\n var pending = updateQueue.pending;\n null === pending\n ? (update.next = update)\n : ((update.next = pending.next), (pending.next = update));\n updateQueue.pending = update;\n update = getRootForUpdatedFiber(fiber);\n markUpdateLaneFromFiberToRoot(fiber, null, lane);\n return update;\n }\n enqueueUpdate$1(fiber, updateQueue, update, lane);\n return getRootForUpdatedFiber(fiber);\n}\nfunction entangleTransitions(root, fiber, lane) {\n fiber = fiber.updateQueue;\n if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194048))) {\n var queueLanes = fiber.lanes;\n queueLanes &= root.pendingLanes;\n lane |= queueLanes;\n fiber.lanes = lane;\n markRootEntangled(root, lane);\n }\n}\nfunction enqueueCapturedUpdate(workInProgress, capturedUpdate) {\n var queue = workInProgress.updateQueue,\n current = workInProgress.alternate;\n if (\n null !== current &&\n ((current = current.updateQueue), queue === current)\n ) {\n var newFirst = null,\n newLast = null;\n queue = queue.firstBaseUpdate;\n if (null !== queue) {\n do {\n var clone = {\n lane: queue.lane,\n tag: queue.tag,\n payload: queue.payload,\n callback: null,\n next: null\n };\n null === newLast\n ? (newFirst = newLast = clone)\n : (newLast = newLast.next = clone);\n queue = queue.next;\n } while (null !== queue);\n null === newLast\n ? (newFirst = newLast = capturedUpdate)\n : (newLast = newLast.next = capturedUpdate);\n } else newFirst = newLast = capturedUpdate;\n queue = {\n baseState: current.baseState,\n firstBaseUpdate: newFirst,\n lastBaseUpdate: newLast,\n shared: current.shared,\n callbacks: current.callbacks\n };\n workInProgress.updateQueue = queue;\n return;\n }\n workInProgress = queue.lastBaseUpdate;\n null === workInProgress\n ? (queue.firstBaseUpdate = capturedUpdate)\n : (workInProgress.next = capturedUpdate);\n queue.lastBaseUpdate = capturedUpdate;\n}\nvar didReadFromEntangledAsyncAction = !1;\nfunction suspendIfUpdateReadFromEntangledAsyncAction() {\n if (didReadFromEntangledAsyncAction) {\n var entangledActionThenable = currentEntangledActionThenable;\n if (null !== entangledActionThenable) throw entangledActionThenable;\n }\n}\nfunction processUpdateQueue(\n workInProgress$jscomp$0,\n props,\n instance$jscomp$0,\n renderLanes\n) {\n didReadFromEntangledAsyncAction = !1;\n var queue = workInProgress$jscomp$0.updateQueue;\n hasForceUpdate = !1;\n var firstBaseUpdate = queue.firstBaseUpdate,\n lastBaseUpdate = queue.lastBaseUpdate,\n pendingQueue = queue.shared.pending;\n if (null !== pendingQueue) {\n queue.shared.pending = null;\n var lastPendingUpdate = pendingQueue,\n firstPendingUpdate = lastPendingUpdate.next;\n lastPendingUpdate.next = null;\n null === lastBaseUpdate\n ? (firstBaseUpdate = firstPendingUpdate)\n : (lastBaseUpdate.next = firstPendingUpdate);\n lastBaseUpdate = lastPendingUpdate;\n var current = workInProgress$jscomp$0.alternate;\n null !== current &&\n ((current = current.updateQueue),\n (pendingQueue = current.lastBaseUpdate),\n pendingQueue !== lastBaseUpdate &&\n (null === pendingQueue\n ? (current.firstBaseUpdate = firstPendingUpdate)\n : (pendingQueue.next = firstPendingUpdate),\n (current.lastBaseUpdate = lastPendingUpdate)));\n }\n if (null !== firstBaseUpdate) {\n var newState = queue.baseState;\n lastBaseUpdate = 0;\n current = firstPendingUpdate = lastPendingUpdate = null;\n pendingQueue = firstBaseUpdate;\n do {\n var updateLane = pendingQueue.lane & -536870913,\n isHiddenUpdate = updateLane !== pendingQueue.lane;\n if (\n isHiddenUpdate\n ? (workInProgressRootRenderLanes & updateLane) === updateLane\n : (renderLanes & updateLane) === updateLane\n ) {\n 0 !== updateLane &&\n updateLane === currentEntangledLane &&\n (didReadFromEntangledAsyncAction = !0);\n null !== current &&\n (current = current.next =\n {\n lane: 0,\n tag: pendingQueue.tag,\n payload: pendingQueue.payload,\n callback: null,\n next: null\n });\n a: {\n var workInProgress = workInProgress$jscomp$0,\n update = pendingQueue;\n updateLane = props;\n var instance = instance$jscomp$0;\n switch (update.tag) {\n case 1:\n workInProgress = update.payload;\n if (\"function\" === typeof workInProgress) {\n newState = workInProgress.call(instance, newState, updateLane);\n break a;\n }\n newState = workInProgress;\n break a;\n case 3:\n workInProgress.flags = (workInProgress.flags & -65537) | 128;\n case 0:\n workInProgress = update.payload;\n updateLane =\n \"function\" === typeof workInProgress\n ? workInProgress.call(instance, newState, updateLane)\n : workInProgress;\n if (null === updateLane || void 0 === updateLane) break a;\n newState = assign({}, newState, updateLane);\n break a;\n case 2:\n hasForceUpdate = !0;\n }\n }\n updateLane = pendingQueue.callback;\n null !== updateLane &&\n ((workInProgress$jscomp$0.flags |= 64),\n isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192),\n (isHiddenUpdate = queue.callbacks),\n null === isHiddenUpdate\n ? (queue.callbacks = [updateLane])\n : isHiddenUpdate.push(updateLane));\n } else\n (isHiddenUpdate = {\n lane: updateLane,\n tag: pendingQueue.tag,\n payload: pendingQueue.payload,\n callback: pendingQueue.callback,\n next: null\n }),\n null === current\n ? ((firstPendingUpdate = current = isHiddenUpdate),\n (lastPendingUpdate = newState))\n : (current = current.next = isHiddenUpdate),\n (lastBaseUpdate |= updateLane);\n pendingQueue = pendingQueue.next;\n if (null === pendingQueue)\n if (((pendingQueue = queue.shared.pending), null === pendingQueue))\n break;\n else\n (isHiddenUpdate = pendingQueue),\n (pendingQueue = isHiddenUpdate.next),\n (isHiddenUpdate.next = null),\n (queue.lastBaseUpdate = isHiddenUpdate),\n (queue.shared.pending = null);\n } while (1);\n null === current && (lastPendingUpdate = newState);\n queue.baseState = lastPendingUpdate;\n queue.firstBaseUpdate = firstPendingUpdate;\n queue.lastBaseUpdate = current;\n null === firstBaseUpdate && (queue.shared.lanes = 0);\n workInProgressRootSkippedLanes |= lastBaseUpdate;\n workInProgress$jscomp$0.lanes = lastBaseUpdate;\n workInProgress$jscomp$0.memoizedState = newState;\n }\n}\nfunction callCallback(callback, context) {\n if (\"function\" !== typeof callback)\n throw Error(formatProdErrorMessage(191, callback));\n callback.call(context);\n}\nfunction commitCallbacks(updateQueue, context) {\n var callbacks = updateQueue.callbacks;\n if (null !== callbacks)\n for (\n updateQueue.callbacks = null, updateQueue = 0;\n updateQueue < callbacks.length;\n updateQueue++\n )\n callCallback(callbacks[updateQueue], context);\n}\nvar currentTreeHiddenStackCursor = createCursor(null),\n prevEntangledRenderLanesCursor = createCursor(0);\nfunction pushHiddenContext(fiber, context) {\n fiber = entangledRenderLanes;\n push(prevEntangledRenderLanesCursor, fiber);\n push(currentTreeHiddenStackCursor, context);\n entangledRenderLanes = fiber | context.baseLanes;\n}\nfunction reuseHiddenContextOnStack() {\n push(prevEntangledRenderLanesCursor, entangledRenderLanes);\n push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current);\n}\nfunction popHiddenContext() {\n entangledRenderLanes = prevEntangledRenderLanesCursor.current;\n pop(currentTreeHiddenStackCursor);\n pop(prevEntangledRenderLanesCursor);\n}\nvar suspenseHandlerStackCursor = createCursor(null),\n shellBoundary = null;\nfunction pushPrimaryTreeSuspenseHandler(handler) {\n var current = handler.alternate;\n push(suspenseStackCursor, suspenseStackCursor.current & 1);\n push(suspenseHandlerStackCursor, handler);\n null === shellBoundary &&\n (null === current || null !== currentTreeHiddenStackCursor.current\n ? (shellBoundary = handler)\n : null !== current.memoizedState && (shellBoundary = handler));\n}\nfunction pushDehydratedActivitySuspenseHandler(fiber) {\n push(suspenseStackCursor, suspenseStackCursor.current);\n push(suspenseHandlerStackCursor, fiber);\n null === shellBoundary && (shellBoundary = fiber);\n}\nfunction pushOffscreenSuspenseHandler(fiber) {\n 22 === fiber.tag\n ? (push(suspenseStackCursor, suspenseStackCursor.current),\n push(suspenseHandlerStackCursor, fiber),\n null === shellBoundary && (shellBoundary = fiber))\n : reuseSuspenseHandlerOnStack(fiber);\n}\nfunction reuseSuspenseHandlerOnStack() {\n push(suspenseStackCursor, suspenseStackCursor.current);\n push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current);\n}\nfunction popSuspenseHandler(fiber) {\n pop(suspenseHandlerStackCursor);\n shellBoundary === fiber && (shellBoundary = null);\n pop(suspenseStackCursor);\n}\nvar suspenseStackCursor = createCursor(0);\nfunction findFirstSuspended(row) {\n for (var node = row; null !== node; ) {\n if (13 === node.tag) {\n var state = node.memoizedState;\n if (\n null !== state &&\n ((state = state.dehydrated),\n null === state ||\n isSuspenseInstancePending(state) ||\n isSuspenseInstanceFallback(state))\n )\n return node;\n } else if (\n 19 === node.tag &&\n (\"forwards\" === node.memoizedProps.revealOrder ||\n \"backwards\" === node.memoizedProps.revealOrder ||\n \"unstable_legacy-backwards\" === node.memoizedProps.revealOrder ||\n \"together\" === node.memoizedProps.revealOrder)\n ) {\n if (0 !== (node.flags & 128)) return node;\n } else if (null !== node.child) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n if (node === row) break;\n for (; null === node.sibling; ) {\n if (null === node.return || node.return === row) return null;\n node = node.return;\n }\n node.sibling.return = node.return;\n node = node.sibling;\n }\n return null;\n}\nvar renderLanes = 0,\n currentlyRenderingFiber = null,\n currentHook = null,\n workInProgressHook = null,\n didScheduleRenderPhaseUpdate = !1,\n didScheduleRenderPhaseUpdateDuringThisPass = !1,\n shouldDoubleInvokeUserFnsInHooksDEV = !1,\n localIdCounter = 0,\n thenableIndexCounter = 0,\n thenableState = null,\n globalClientIdCounter = 0;\nfunction throwInvalidHookError() {\n throw Error(formatProdErrorMessage(321));\n}\nfunction areHookInputsEqual(nextDeps, prevDeps) {\n if (null === prevDeps) return !1;\n for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)\n if (!objectIs(nextDeps[i], prevDeps[i])) return !1;\n return !0;\n}\nfunction renderWithHooks(\n current,\n workInProgress,\n Component,\n props,\n secondArg,\n nextRenderLanes\n) {\n renderLanes = nextRenderLanes;\n currentlyRenderingFiber = workInProgress;\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null;\n workInProgress.lanes = 0;\n ReactSharedInternals.H =\n null === current || null === current.memoizedState\n ? HooksDispatcherOnMount\n : HooksDispatcherOnUpdate;\n shouldDoubleInvokeUserFnsInHooksDEV = !1;\n nextRenderLanes = Component(props, secondArg);\n shouldDoubleInvokeUserFnsInHooksDEV = !1;\n didScheduleRenderPhaseUpdateDuringThisPass &&\n (nextRenderLanes = renderWithHooksAgain(\n workInProgress,\n Component,\n props,\n secondArg\n ));\n finishRenderingHooks(current);\n return nextRenderLanes;\n}\nfunction finishRenderingHooks(current) {\n ReactSharedInternals.H = ContextOnlyDispatcher;\n var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;\n renderLanes = 0;\n workInProgressHook = currentHook = currentlyRenderingFiber = null;\n didScheduleRenderPhaseUpdate = !1;\n thenableIndexCounter = 0;\n thenableState = null;\n if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300));\n null === current ||\n didReceiveUpdate ||\n ((current = current.dependencies),\n null !== current &&\n checkIfContextChanged(current) &&\n (didReceiveUpdate = !0));\n}\nfunction renderWithHooksAgain(workInProgress, Component, props, secondArg) {\n currentlyRenderingFiber = workInProgress;\n var numberOfReRenders = 0;\n do {\n didScheduleRenderPhaseUpdateDuringThisPass && (thenableState = null);\n thenableIndexCounter = 0;\n didScheduleRenderPhaseUpdateDuringThisPass = !1;\n if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301));\n numberOfReRenders += 1;\n workInProgressHook = currentHook = null;\n if (null != workInProgress.updateQueue) {\n var children = workInProgress.updateQueue;\n children.lastEffect = null;\n children.events = null;\n children.stores = null;\n null != children.memoCache && (children.memoCache.index = 0);\n }\n ReactSharedInternals.H = HooksDispatcherOnRerender;\n children = Component(props, secondArg);\n } while (didScheduleRenderPhaseUpdateDuringThisPass);\n return children;\n}\nfunction TransitionAwareHostComponent() {\n var dispatcher = ReactSharedInternals.H,\n maybeThenable = dispatcher.useState()[0];\n maybeThenable =\n \"function\" === typeof maybeThenable.then\n ? useThenable(maybeThenable)\n : maybeThenable;\n dispatcher = dispatcher.useState()[0];\n (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher &&\n (currentlyRenderingFiber.flags |= 1024);\n return maybeThenable;\n}\nfunction checkDidRenderIdHook() {\n var didRenderIdHook = 0 !== localIdCounter;\n localIdCounter = 0;\n return didRenderIdHook;\n}\nfunction bailoutHooks(current, workInProgress, lanes) {\n workInProgress.updateQueue = current.updateQueue;\n workInProgress.flags &= -2053;\n current.lanes &= ~lanes;\n}\nfunction resetHooksOnUnwind(workInProgress) {\n if (didScheduleRenderPhaseUpdate) {\n for (\n workInProgress = workInProgress.memoizedState;\n null !== workInProgress;\n\n ) {\n var queue = workInProgress.queue;\n null !== queue && (queue.pending = null);\n workInProgress = workInProgress.next;\n }\n didScheduleRenderPhaseUpdate = !1;\n }\n renderLanes = 0;\n workInProgressHook = currentHook = currentlyRenderingFiber = null;\n didScheduleRenderPhaseUpdateDuringThisPass = !1;\n thenableIndexCounter = localIdCounter = 0;\n thenableState = null;\n}\nfunction mountWorkInProgressHook() {\n var hook = {\n memoizedState: null,\n baseState: null,\n baseQueue: null,\n queue: null,\n next: null\n };\n null === workInProgressHook\n ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook)\n : (workInProgressHook = workInProgressHook.next = hook);\n return workInProgressHook;\n}\nfunction updateWorkInProgressHook() {\n if (null === currentHook) {\n var nextCurrentHook = currentlyRenderingFiber.alternate;\n nextCurrentHook =\n null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;\n } else nextCurrentHook = currentHook.next;\n var nextWorkInProgressHook =\n null === workInProgressHook\n ? currentlyRenderingFiber.memoizedState\n : workInProgressHook.next;\n if (null !== nextWorkInProgressHook)\n (workInProgressHook = nextWorkInProgressHook),\n (currentHook = nextCurrentHook);\n else {\n if (null === nextCurrentHook) {\n if (null === currentlyRenderingFiber.alternate)\n throw Error(formatProdErrorMessage(467));\n throw Error(formatProdErrorMessage(310));\n }\n currentHook = nextCurrentHook;\n nextCurrentHook = {\n memoizedState: currentHook.memoizedState,\n baseState: currentHook.baseState,\n baseQueue: currentHook.baseQueue,\n queue: currentHook.queue,\n next: null\n };\n null === workInProgressHook\n ? (currentlyRenderingFiber.memoizedState = workInProgressHook =\n nextCurrentHook)\n : (workInProgressHook = workInProgressHook.next = nextCurrentHook);\n }\n return workInProgressHook;\n}\nfunction createFunctionComponentUpdateQueue() {\n return { lastEffect: null, events: null, stores: null, memoCache: null };\n}\nfunction useThenable(thenable) {\n var index = thenableIndexCounter;\n thenableIndexCounter += 1;\n null === thenableState && (thenableState = []);\n thenable = trackUsedThenable(thenableState, thenable, index);\n index = currentlyRenderingFiber;\n null ===\n (null === workInProgressHook\n ? index.memoizedState\n : workInProgressHook.next) &&\n ((index = index.alternate),\n (ReactSharedInternals.H =\n null === index || null === index.memoizedState\n ? HooksDispatcherOnMount\n : HooksDispatcherOnUpdate));\n return thenable;\n}\nfunction use(usable) {\n if (null !== usable && \"object\" === typeof usable) {\n if (\"function\" === typeof usable.then) return useThenable(usable);\n if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);\n }\n throw Error(formatProdErrorMessage(438, String(usable)));\n}\nfunction useMemoCache(size) {\n var memoCache = null,\n updateQueue = currentlyRenderingFiber.updateQueue;\n null !== updateQueue && (memoCache = updateQueue.memoCache);\n if (null == memoCache) {\n var current = currentlyRenderingFiber.alternate;\n null !== current &&\n ((current = current.updateQueue),\n null !== current &&\n ((current = current.memoCache),\n null != current &&\n (memoCache = {\n data: current.data.map(function (array) {\n return array.slice();\n }),\n index: 0\n })));\n }\n null == memoCache && (memoCache = { data: [], index: 0 });\n null === updateQueue &&\n ((updateQueue = createFunctionComponentUpdateQueue()),\n (currentlyRenderingFiber.updateQueue = updateQueue));\n updateQueue.memoCache = memoCache;\n updateQueue = memoCache.data[memoCache.index];\n if (void 0 === updateQueue)\n for (\n updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0;\n current < size;\n current++\n )\n updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;\n memoCache.index++;\n return updateQueue;\n}\nfunction basicStateReducer(state, action) {\n return \"function\" === typeof action ? action(state) : action;\n}\nfunction updateReducer(reducer) {\n var hook = updateWorkInProgressHook();\n return updateReducerImpl(hook, currentHook, reducer);\n}\nfunction updateReducerImpl(hook, current, reducer) {\n var queue = hook.queue;\n if (null === queue) throw Error(formatProdErrorMessage(311));\n queue.lastRenderedReducer = reducer;\n var baseQueue = hook.baseQueue,\n pendingQueue = queue.pending;\n if (null !== pendingQueue) {\n if (null !== baseQueue) {\n var baseFirst = baseQueue.next;\n baseQueue.next = pendingQueue.next;\n pendingQueue.next = baseFirst;\n }\n current.baseQueue = baseQueue = pendingQueue;\n queue.pending = null;\n }\n pendingQueue = hook.baseState;\n if (null === baseQueue) hook.memoizedState = pendingQueue;\n else {\n current = baseQueue.next;\n var newBaseQueueFirst = (baseFirst = null),\n newBaseQueueLast = null,\n update = current,\n didReadFromEntangledAsyncAction$60 = !1;\n do {\n var updateLane = update.lane & -536870913;\n if (\n updateLane !== update.lane\n ? (workInProgressRootRenderLanes & updateLane) === updateLane\n : (renderLanes & updateLane) === updateLane\n ) {\n var revertLane = update.revertLane;\n if (0 === revertLane)\n null !== newBaseQueueLast &&\n (newBaseQueueLast = newBaseQueueLast.next =\n {\n lane: 0,\n revertLane: 0,\n gesture: null,\n action: update.action,\n hasEagerState: update.hasEagerState,\n eagerState: update.eagerState,\n next: null\n }),\n updateLane === currentEntangledLane &&\n (didReadFromEntangledAsyncAction$60 = !0);\n else if ((renderLanes & revertLane) === revertLane) {\n update = update.next;\n revertLane === currentEntangledLane &&\n (didReadFromEntangledAsyncAction$60 = !0);\n continue;\n } else\n (updateLane = {\n lane: 0,\n revertLane: update.revertLane,\n gesture: null,\n action: update.action,\n hasEagerState: update.hasEagerState,\n eagerState: update.eagerState,\n next: null\n }),\n null === newBaseQueueLast\n ? ((newBaseQueueFirst = newBaseQueueLast = updateLane),\n (baseFirst = pendingQueue))\n : (newBaseQueueLast = newBaseQueueLast.next = updateLane),\n (currentlyRenderingFiber.lanes |= revertLane),\n (workInProgressRootSkippedLanes |= revertLane);\n updateLane = update.action;\n shouldDoubleInvokeUserFnsInHooksDEV &&\n reducer(pendingQueue, updateLane);\n pendingQueue = update.hasEagerState\n ? update.eagerState\n : reducer(pendingQueue, updateLane);\n } else\n (revertLane = {\n lane: updateLane,\n revertLane: update.revertLane,\n gesture: update.gesture,\n action: update.action,\n hasEagerState: update.hasEagerState,\n eagerState: update.eagerState,\n next: null\n }),\n null === newBaseQueueLast\n ? ((newBaseQueueFirst = newBaseQueueLast = revertLane),\n (baseFirst = pendingQueue))\n : (newBaseQueueLast = newBaseQueueLast.next = revertLane),\n (currentlyRenderingFiber.lanes |= updateLane),\n (workInProgressRootSkippedLanes |= updateLane);\n update = update.next;\n } while (null !== update && update !== current);\n null === newBaseQueueLast\n ? (baseFirst = pendingQueue)\n : (newBaseQueueLast.next = newBaseQueueFirst);\n if (\n !objectIs(pendingQueue, hook.memoizedState) &&\n ((didReceiveUpdate = !0),\n didReadFromEntangledAsyncAction$60 &&\n ((reducer = currentEntangledActionThenable), null !== reducer))\n )\n throw reducer;\n hook.memoizedState = pendingQueue;\n hook.baseState = baseFirst;\n hook.baseQueue = newBaseQueueLast;\n queue.lastRenderedState = pendingQueue;\n }\n null === baseQueue && (queue.lanes = 0);\n return [hook.memoizedState, queue.dispatch];\n}\nfunction rerenderReducer(reducer) {\n var hook = updateWorkInProgressHook(),\n queue = hook.queue;\n if (null === queue) throw Error(formatProdErrorMessage(311));\n queue.lastRenderedReducer = reducer;\n var dispatch = queue.dispatch,\n lastRenderPhaseUpdate = queue.pending,\n newState = hook.memoizedState;\n if (null !== lastRenderPhaseUpdate) {\n queue.pending = null;\n var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);\n do (newState = reducer(newState, update.action)), (update = update.next);\n while (update !== lastRenderPhaseUpdate);\n objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0);\n hook.memoizedState = newState;\n null === hook.baseQueue && (hook.baseState = newState);\n queue.lastRenderedState = newState;\n }\n return [newState, dispatch];\n}\nfunction updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n var fiber = currentlyRenderingFiber,\n hook = updateWorkInProgressHook(),\n isHydrating$jscomp$0 = isHydrating;\n if (isHydrating$jscomp$0) {\n if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407));\n getServerSnapshot = getServerSnapshot();\n } else getServerSnapshot = getSnapshot();\n var snapshotChanged = !objectIs(\n (currentHook || hook).memoizedState,\n getServerSnapshot\n );\n snapshotChanged &&\n ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0));\n hook = hook.queue;\n updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [\n subscribe\n ]);\n if (\n hook.getSnapshot !== getSnapshot ||\n snapshotChanged ||\n (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1)\n ) {\n fiber.flags |= 2048;\n pushSimpleEffect(\n 9,\n { destroy: void 0 },\n updateStoreInstance.bind(\n null,\n fiber,\n hook,\n getServerSnapshot,\n getSnapshot\n ),\n null\n );\n if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349));\n isHydrating$jscomp$0 ||\n 0 !== (renderLanes & 127) ||\n pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);\n }\n return getServerSnapshot;\n}\nfunction pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {\n fiber.flags |= 16384;\n fiber = { getSnapshot: getSnapshot, value: renderedSnapshot };\n getSnapshot = currentlyRenderingFiber.updateQueue;\n null === getSnapshot\n ? ((getSnapshot = createFunctionComponentUpdateQueue()),\n (currentlyRenderingFiber.updateQueue = getSnapshot),\n (getSnapshot.stores = [fiber]))\n : ((renderedSnapshot = getSnapshot.stores),\n null === renderedSnapshot\n ? (getSnapshot.stores = [fiber])\n : renderedSnapshot.push(fiber));\n}\nfunction updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {\n inst.value = nextSnapshot;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);\n}\nfunction subscribeToStore(fiber, inst, subscribe) {\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);\n });\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction forceStoreRerender(fiber) {\n var root = enqueueConcurrentRenderForLane(fiber, 2);\n null !== root && scheduleUpdateOnFiber(root, fiber, 2);\n}\nfunction mountStateImpl(initialState) {\n var hook = mountWorkInProgressHook();\n if (\"function\" === typeof initialState) {\n var initialStateInitializer = initialState;\n initialState = initialStateInitializer();\n if (shouldDoubleInvokeUserFnsInHooksDEV) {\n setIsStrictModeForDevtools(!0);\n try {\n initialStateInitializer();\n } finally {\n setIsStrictModeForDevtools(!1);\n }\n }\n }\n hook.memoizedState = hook.baseState = initialState;\n hook.queue = {\n pending: null,\n lanes: 0,\n dispatch: null,\n lastRenderedReducer: basicStateReducer,\n lastRenderedState: initialState\n };\n return hook;\n}\nfunction updateOptimisticImpl(hook, current, passthrough, reducer) {\n hook.baseState = passthrough;\n return updateReducerImpl(\n hook,\n currentHook,\n \"function\" === typeof reducer ? reducer : basicStateReducer\n );\n}\nfunction dispatchActionState(\n fiber,\n actionQueue,\n setPendingState,\n setState,\n payload\n) {\n if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));\n fiber = actionQueue.action;\n if (null !== fiber) {\n var actionNode = {\n payload: payload,\n action: fiber,\n next: null,\n isTransition: !0,\n status: \"pending\",\n value: null,\n reason: null,\n listeners: [],\n then: function (listener) {\n actionNode.listeners.push(listener);\n }\n };\n null !== ReactSharedInternals.T\n ? setPendingState(!0)\n : (actionNode.isTransition = !1);\n setState(actionNode);\n setPendingState = actionQueue.pending;\n null === setPendingState\n ? ((actionNode.next = actionQueue.pending = actionNode),\n runActionStateAction(actionQueue, actionNode))\n : ((actionNode.next = setPendingState.next),\n (actionQueue.pending = setPendingState.next = actionNode));\n }\n}\nfunction runActionStateAction(actionQueue, node) {\n var action = node.action,\n payload = node.payload,\n prevState = actionQueue.state;\n if (node.isTransition) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = action(prevState, payload),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n handleActionReturnValue(actionQueue, node, returnValue);\n } catch (error) {\n onActionError(actionQueue, node, error);\n } finally {\n null !== prevTransition &&\n null !== currentTransition.types &&\n (prevTransition.types = currentTransition.types),\n (ReactSharedInternals.T = prevTransition);\n }\n } else\n try {\n (prevTransition = action(prevState, payload)),\n handleActionReturnValue(actionQueue, node, prevTransition);\n } catch (error$66) {\n onActionError(actionQueue, node, error$66);\n }\n}\nfunction handleActionReturnValue(actionQueue, node, returnValue) {\n null !== returnValue &&\n \"object\" === typeof returnValue &&\n \"function\" === typeof returnValue.then\n ? returnValue.then(\n function (nextState) {\n onActionSuccess(actionQueue, node, nextState);\n },\n function (error) {\n return onActionError(actionQueue, node, error);\n }\n )\n : onActionSuccess(actionQueue, node, returnValue);\n}\nfunction onActionSuccess(actionQueue, actionNode, nextState) {\n actionNode.status = \"fulfilled\";\n actionNode.value = nextState;\n notifyActionListeners(actionNode);\n actionQueue.state = nextState;\n actionNode = actionQueue.pending;\n null !== actionNode &&\n ((nextState = actionNode.next),\n nextState === actionNode\n ? (actionQueue.pending = null)\n : ((nextState = nextState.next),\n (actionNode.next = nextState),\n runActionStateAction(actionQueue, nextState)));\n}\nfunction onActionError(actionQueue, actionNode, error) {\n var last = actionQueue.pending;\n actionQueue.pending = null;\n if (null !== last) {\n last = last.next;\n do\n (actionNode.status = \"rejected\"),\n (actionNode.reason = error),\n notifyActionListeners(actionNode),\n (actionNode = actionNode.next);\n while (actionNode !== last);\n }\n actionQueue.action = null;\n}\nfunction notifyActionListeners(actionNode) {\n actionNode = actionNode.listeners;\n for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])();\n}\nfunction actionStateReducer(oldState, newState) {\n return newState;\n}\nfunction mountActionState(action, initialStateProp) {\n if (isHydrating) {\n var ssrFormState = workInProgressRoot.formState;\n if (null !== ssrFormState) {\n a: {\n var JSCompiler_inline_result = currentlyRenderingFiber;\n if (isHydrating) {\n if (nextHydratableInstance) {\n b: {\n var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance;\n for (\n var inRootOrSingleton = rootOrSingletonContext;\n 8 !== JSCompiler_inline_result$jscomp$0.nodeType;\n\n ) {\n if (!inRootOrSingleton) {\n JSCompiler_inline_result$jscomp$0 = null;\n break b;\n }\n JSCompiler_inline_result$jscomp$0 = getNextHydratable(\n JSCompiler_inline_result$jscomp$0.nextSibling\n );\n if (null === JSCompiler_inline_result$jscomp$0) {\n JSCompiler_inline_result$jscomp$0 = null;\n break b;\n }\n }\n inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data;\n JSCompiler_inline_result$jscomp$0 =\n \"F!\" === inRootOrSingleton || \"F\" === inRootOrSingleton\n ? JSCompiler_inline_result$jscomp$0\n : null;\n }\n if (JSCompiler_inline_result$jscomp$0) {\n nextHydratableInstance = getNextHydratable(\n JSCompiler_inline_result$jscomp$0.nextSibling\n );\n JSCompiler_inline_result =\n \"F!\" === JSCompiler_inline_result$jscomp$0.data;\n break a;\n }\n }\n throwOnHydrationMismatch(JSCompiler_inline_result);\n }\n JSCompiler_inline_result = !1;\n }\n JSCompiler_inline_result && (initialStateProp = ssrFormState[0]);\n }\n }\n ssrFormState = mountWorkInProgressHook();\n ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;\n JSCompiler_inline_result = {\n pending: null,\n lanes: 0,\n dispatch: null,\n lastRenderedReducer: actionStateReducer,\n lastRenderedState: initialStateProp\n };\n ssrFormState.queue = JSCompiler_inline_result;\n ssrFormState = dispatchSetState.bind(\n null,\n currentlyRenderingFiber,\n JSCompiler_inline_result\n );\n JSCompiler_inline_result.dispatch = ssrFormState;\n JSCompiler_inline_result = mountStateImpl(!1);\n inRootOrSingleton = dispatchOptimisticSetState.bind(\n null,\n currentlyRenderingFiber,\n !1,\n JSCompiler_inline_result.queue\n );\n JSCompiler_inline_result = mountWorkInProgressHook();\n JSCompiler_inline_result$jscomp$0 = {\n state: initialStateProp,\n dispatch: null,\n action: action,\n pending: null\n };\n JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0;\n ssrFormState = dispatchActionState.bind(\n null,\n currentlyRenderingFiber,\n JSCompiler_inline_result$jscomp$0,\n inRootOrSingleton,\n ssrFormState\n );\n JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState;\n JSCompiler_inline_result.memoizedState = action;\n return [initialStateProp, ssrFormState, !1];\n}\nfunction updateActionState(action) {\n var stateHook = updateWorkInProgressHook();\n return updateActionStateImpl(stateHook, currentHook, action);\n}\nfunction updateActionStateImpl(stateHook, currentStateHook, action) {\n currentStateHook = updateReducerImpl(\n stateHook,\n currentStateHook,\n actionStateReducer\n )[0];\n stateHook = updateReducer(basicStateReducer)[0];\n if (\n \"object\" === typeof currentStateHook &&\n null !== currentStateHook &&\n \"function\" === typeof currentStateHook.then\n )\n try {\n var state = useThenable(currentStateHook);\n } catch (x) {\n if (x === SuspenseException) throw SuspenseActionException;\n throw x;\n }\n else state = currentStateHook;\n currentStateHook = updateWorkInProgressHook();\n var actionQueue = currentStateHook.queue,\n dispatch = actionQueue.dispatch;\n action !== currentStateHook.memoizedState &&\n ((currentlyRenderingFiber.flags |= 2048),\n pushSimpleEffect(\n 9,\n { destroy: void 0 },\n actionStateActionEffect.bind(null, actionQueue, action),\n null\n ));\n return [state, dispatch, stateHook];\n}\nfunction actionStateActionEffect(actionQueue, action) {\n actionQueue.action = action;\n}\nfunction rerenderActionState(action) {\n var stateHook = updateWorkInProgressHook(),\n currentStateHook = currentHook;\n if (null !== currentStateHook)\n return updateActionStateImpl(stateHook, currentStateHook, action);\n updateWorkInProgressHook();\n stateHook = stateHook.memoizedState;\n currentStateHook = updateWorkInProgressHook();\n var dispatch = currentStateHook.queue.dispatch;\n currentStateHook.memoizedState = action;\n return [stateHook, dispatch, !1];\n}\nfunction pushSimpleEffect(tag, inst, create, deps) {\n tag = { tag: tag, create: create, deps: deps, inst: inst, next: null };\n inst = currentlyRenderingFiber.updateQueue;\n null === inst &&\n ((inst = createFunctionComponentUpdateQueue()),\n (currentlyRenderingFiber.updateQueue = inst));\n create = inst.lastEffect;\n null === create\n ? (inst.lastEffect = tag.next = tag)\n : ((deps = create.next),\n (create.next = tag),\n (tag.next = deps),\n (inst.lastEffect = tag));\n return tag;\n}\nfunction updateRef() {\n return updateWorkInProgressHook().memoizedState;\n}\nfunction mountEffectImpl(fiberFlags, hookFlags, create, deps) {\n var hook = mountWorkInProgressHook();\n currentlyRenderingFiber.flags |= fiberFlags;\n hook.memoizedState = pushSimpleEffect(\n 1 | hookFlags,\n { destroy: void 0 },\n create,\n void 0 === deps ? null : deps\n );\n}\nfunction updateEffectImpl(fiberFlags, hookFlags, create, deps) {\n var hook = updateWorkInProgressHook();\n deps = void 0 === deps ? null : deps;\n var inst = hook.memoizedState.inst;\n null !== currentHook &&\n null !== deps &&\n areHookInputsEqual(deps, currentHook.memoizedState.deps)\n ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps))\n : ((currentlyRenderingFiber.flags |= fiberFlags),\n (hook.memoizedState = pushSimpleEffect(\n 1 | hookFlags,\n inst,\n create,\n deps\n )));\n}\nfunction mountEffect(create, deps) {\n mountEffectImpl(8390656, 8, create, deps);\n}\nfunction updateEffect(create, deps) {\n updateEffectImpl(2048, 8, create, deps);\n}\nfunction useEffectEventImpl(payload) {\n currentlyRenderingFiber.flags |= 4;\n var componentUpdateQueue = currentlyRenderingFiber.updateQueue;\n if (null === componentUpdateQueue)\n (componentUpdateQueue = createFunctionComponentUpdateQueue()),\n (currentlyRenderingFiber.updateQueue = componentUpdateQueue),\n (componentUpdateQueue.events = [payload]);\n else {\n var events = componentUpdateQueue.events;\n null === events\n ? (componentUpdateQueue.events = [payload])\n : events.push(payload);\n }\n}\nfunction updateEvent(callback) {\n var ref = updateWorkInProgressHook().memoizedState;\n useEffectEventImpl({ ref: ref, nextImpl: callback });\n return function () {\n if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440));\n return ref.impl.apply(void 0, arguments);\n };\n}\nfunction updateInsertionEffect(create, deps) {\n return updateEffectImpl(4, 2, create, deps);\n}\nfunction updateLayoutEffect(create, deps) {\n return updateEffectImpl(4, 4, create, deps);\n}\nfunction imperativeHandleEffect(create, ref) {\n if (\"function\" === typeof ref) {\n create = create();\n var refCleanup = ref(create);\n return function () {\n \"function\" === typeof refCleanup ? refCleanup() : ref(null);\n };\n }\n if (null !== ref && void 0 !== ref)\n return (\n (create = create()),\n (ref.current = create),\n function () {\n ref.current = null;\n }\n );\n}\nfunction updateImperativeHandle(ref, create, deps) {\n deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;\n updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps);\n}\nfunction mountDebugValue() {}\nfunction updateCallback(callback, deps) {\n var hook = updateWorkInProgressHook();\n deps = void 0 === deps ? null : deps;\n var prevState = hook.memoizedState;\n if (null !== deps && areHookInputsEqual(deps, prevState[1]))\n return prevState[0];\n hook.memoizedState = [callback, deps];\n return callback;\n}\nfunction updateMemo(nextCreate, deps) {\n var hook = updateWorkInProgressHook();\n deps = void 0 === deps ? null : deps;\n var prevState = hook.memoizedState;\n if (null !== deps && areHookInputsEqual(deps, prevState[1]))\n return prevState[0];\n prevState = nextCreate();\n if (shouldDoubleInvokeUserFnsInHooksDEV) {\n setIsStrictModeForDevtools(!0);\n try {\n nextCreate();\n } finally {\n setIsStrictModeForDevtools(!1);\n }\n }\n hook.memoizedState = [prevState, deps];\n return prevState;\n}\nfunction mountDeferredValueImpl(hook, value, initialValue) {\n if (\n void 0 === initialValue ||\n (0 !== (renderLanes & 1073741824) &&\n 0 === (workInProgressRootRenderLanes & 261930))\n )\n return (hook.memoizedState = value);\n hook.memoizedState = initialValue;\n hook = requestDeferredLane();\n currentlyRenderingFiber.lanes |= hook;\n workInProgressRootSkippedLanes |= hook;\n return initialValue;\n}\nfunction updateDeferredValueImpl(hook, prevValue, value, initialValue) {\n if (objectIs(value, prevValue)) return value;\n if (null !== currentTreeHiddenStackCursor.current)\n return (\n (hook = mountDeferredValueImpl(hook, value, initialValue)),\n objectIs(hook, prevValue) || (didReceiveUpdate = !0),\n hook\n );\n if (\n 0 === (renderLanes & 42) ||\n (0 !== (renderLanes & 1073741824) &&\n 0 === (workInProgressRootRenderLanes & 261930))\n )\n return (didReceiveUpdate = !0), (hook.memoizedState = value);\n hook = requestDeferredLane();\n currentlyRenderingFiber.lanes |= hook;\n workInProgressRootSkippedLanes |= hook;\n return prevValue;\n}\nfunction startTransition(fiber, queue, pendingState, finishedState, callback) {\n var previousPriority = ReactDOMSharedInternals.p;\n ReactDOMSharedInternals.p =\n 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n ReactSharedInternals.T = currentTransition;\n dispatchOptimisticSetState(fiber, !1, queue, pendingState);\n try {\n var returnValue = callback(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n if (\n null !== returnValue &&\n \"object\" === typeof returnValue &&\n \"function\" === typeof returnValue.then\n ) {\n var thenableForFinishedState = chainThenableValue(\n returnValue,\n finishedState\n );\n dispatchSetStateInternal(\n fiber,\n queue,\n thenableForFinishedState,\n requestUpdateLane(fiber)\n );\n } else\n dispatchSetStateInternal(\n fiber,\n queue,\n finishedState,\n requestUpdateLane(fiber)\n );\n } catch (error) {\n dispatchSetStateInternal(\n fiber,\n queue,\n { then: function () {}, status: \"rejected\", reason: error },\n requestUpdateLane()\n );\n } finally {\n (ReactDOMSharedInternals.p = previousPriority),\n null !== prevTransition &&\n null !== currentTransition.types &&\n (prevTransition.types = currentTransition.types),\n (ReactSharedInternals.T = prevTransition);\n }\n}\nfunction noop() {}\nfunction startHostTransition(formFiber, pendingState, action, formData) {\n if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476));\n var queue = ensureFormComponentIsStateful(formFiber).queue;\n startTransition(\n formFiber,\n queue,\n pendingState,\n sharedNotPendingObject,\n null === action\n ? noop\n : function () {\n requestFormReset$1(formFiber);\n return action(formData);\n }\n );\n}\nfunction ensureFormComponentIsStateful(formFiber) {\n var existingStateHook = formFiber.memoizedState;\n if (null !== existingStateHook) return existingStateHook;\n existingStateHook = {\n memoizedState: sharedNotPendingObject,\n baseState: sharedNotPendingObject,\n baseQueue: null,\n queue: {\n pending: null,\n lanes: 0,\n dispatch: null,\n lastRenderedReducer: basicStateReducer,\n lastRenderedState: sharedNotPendingObject\n },\n next: null\n };\n var initialResetState = {};\n existingStateHook.next = {\n memoizedState: initialResetState,\n baseState: initialResetState,\n baseQueue: null,\n queue: {\n pending: null,\n lanes: 0,\n dispatch: null,\n lastRenderedReducer: basicStateReducer,\n lastRenderedState: initialResetState\n },\n next: null\n };\n formFiber.memoizedState = existingStateHook;\n formFiber = formFiber.alternate;\n null !== formFiber && (formFiber.memoizedState = existingStateHook);\n return existingStateHook;\n}\nfunction requestFormReset$1(formFiber) {\n var stateHook = ensureFormComponentIsStateful(formFiber);\n null === stateHook.next && (stateHook = formFiber.alternate.memoizedState);\n dispatchSetStateInternal(\n formFiber,\n stateHook.next.queue,\n {},\n requestUpdateLane()\n );\n}\nfunction useHostTransitionStatus() {\n return readContext(HostTransitionContext);\n}\nfunction updateId() {\n return updateWorkInProgressHook().memoizedState;\n}\nfunction updateRefresh() {\n return updateWorkInProgressHook().memoizedState;\n}\nfunction refreshCache(fiber) {\n for (var provider = fiber.return; null !== provider; ) {\n switch (provider.tag) {\n case 24:\n case 3:\n var lane = requestUpdateLane();\n fiber = createUpdate(lane);\n var root$69 = enqueueUpdate(provider, fiber, lane);\n null !== root$69 &&\n (scheduleUpdateOnFiber(root$69, provider, lane),\n entangleTransitions(root$69, provider, lane));\n provider = { cache: createCache() };\n fiber.payload = provider;\n return;\n }\n provider = provider.return;\n }\n}\nfunction dispatchReducerAction(fiber, queue, action) {\n var lane = requestUpdateLane();\n action = {\n lane: lane,\n revertLane: 0,\n gesture: null,\n action: action,\n hasEagerState: !1,\n eagerState: null,\n next: null\n };\n isRenderPhaseUpdate(fiber)\n ? enqueueRenderPhaseUpdate(queue, action)\n : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)),\n null !== action &&\n (scheduleUpdateOnFiber(action, fiber, lane),\n entangleTransitionUpdate(action, queue, lane)));\n}\nfunction dispatchSetState(fiber, queue, action) {\n var lane = requestUpdateLane();\n dispatchSetStateInternal(fiber, queue, action, lane);\n}\nfunction dispatchSetStateInternal(fiber, queue, action, lane) {\n var update = {\n lane: lane,\n revertLane: 0,\n gesture: null,\n action: action,\n hasEagerState: !1,\n eagerState: null,\n next: null\n };\n if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);\n else {\n var alternate = fiber.alternate;\n if (\n 0 === fiber.lanes &&\n (null === alternate || 0 === alternate.lanes) &&\n ((alternate = queue.lastRenderedReducer), null !== alternate)\n )\n try {\n var currentState = queue.lastRenderedState,\n eagerState = alternate(currentState, action);\n update.hasEagerState = !0;\n update.eagerState = eagerState;\n if (objectIs(eagerState, currentState))\n return (\n enqueueUpdate$1(fiber, queue, update, 0),\n null === workInProgressRoot && finishQueueingConcurrentUpdates(),\n !1\n );\n } catch (error) {\n } finally {\n }\n action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);\n if (null !== action)\n return (\n scheduleUpdateOnFiber(action, fiber, lane),\n entangleTransitionUpdate(action, queue, lane),\n !0\n );\n }\n return !1;\n}\nfunction dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {\n action = {\n lane: 2,\n revertLane: requestTransitionLane(),\n gesture: null,\n action: action,\n hasEagerState: !1,\n eagerState: null,\n next: null\n };\n if (isRenderPhaseUpdate(fiber)) {\n if (throwIfDuringRender) throw Error(formatProdErrorMessage(479));\n } else\n (throwIfDuringRender = enqueueConcurrentHookUpdate(\n fiber,\n queue,\n action,\n 2\n )),\n null !== throwIfDuringRender &&\n scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2);\n}\nfunction isRenderPhaseUpdate(fiber) {\n var alternate = fiber.alternate;\n return (\n fiber === currentlyRenderingFiber ||\n (null !== alternate && alternate === currentlyRenderingFiber)\n );\n}\nfunction enqueueRenderPhaseUpdate(queue, update) {\n didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate =\n !0;\n var pending = queue.pending;\n null === pending\n ? (update.next = update)\n : ((update.next = pending.next), (pending.next = update));\n queue.pending = update;\n}\nfunction entangleTransitionUpdate(root, queue, lane) {\n if (0 !== (lane & 4194048)) {\n var queueLanes = queue.lanes;\n queueLanes &= root.pendingLanes;\n lane |= queueLanes;\n queue.lanes = lane;\n markRootEntangled(root, lane);\n }\n}\nvar ContextOnlyDispatcher = {\n readContext: readContext,\n use: use,\n useCallback: throwInvalidHookError,\n useContext: throwInvalidHookError,\n useEffect: throwInvalidHookError,\n useImperativeHandle: throwInvalidHookError,\n useLayoutEffect: throwInvalidHookError,\n useInsertionEffect: throwInvalidHookError,\n useMemo: throwInvalidHookError,\n useReducer: throwInvalidHookError,\n useRef: throwInvalidHookError,\n useState: throwInvalidHookError,\n useDebugValue: throwInvalidHookError,\n useDeferredValue: throwInvalidHookError,\n useTransition: throwInvalidHookError,\n useSyncExternalStore: throwInvalidHookError,\n useId: throwInvalidHookError,\n useHostTransitionStatus: throwInvalidHookError,\n useFormState: throwInvalidHookError,\n useActionState: throwInvalidHookError,\n useOptimistic: throwInvalidHookError,\n useMemoCache: throwInvalidHookError,\n useCacheRefresh: throwInvalidHookError\n};\nContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;\nvar HooksDispatcherOnMount = {\n readContext: readContext,\n use: use,\n useCallback: function (callback, deps) {\n mountWorkInProgressHook().memoizedState = [\n callback,\n void 0 === deps ? null : deps\n ];\n return callback;\n },\n useContext: readContext,\n useEffect: mountEffect,\n useImperativeHandle: function (ref, create, deps) {\n deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;\n mountEffectImpl(\n 4194308,\n 4,\n imperativeHandleEffect.bind(null, create, ref),\n deps\n );\n },\n useLayoutEffect: function (create, deps) {\n return mountEffectImpl(4194308, 4, create, deps);\n },\n useInsertionEffect: function (create, deps) {\n mountEffectImpl(4, 2, create, deps);\n },\n useMemo: function (nextCreate, deps) {\n var hook = mountWorkInProgressHook();\n deps = void 0 === deps ? null : deps;\n var nextValue = nextCreate();\n if (shouldDoubleInvokeUserFnsInHooksDEV) {\n setIsStrictModeForDevtools(!0);\n try {\n nextCreate();\n } finally {\n setIsStrictModeForDevtools(!1);\n }\n }\n hook.memoizedState = [nextValue, deps];\n return nextValue;\n },\n useReducer: function (reducer, initialArg, init) {\n var hook = mountWorkInProgressHook();\n if (void 0 !== init) {\n var initialState = init(initialArg);\n if (shouldDoubleInvokeUserFnsInHooksDEV) {\n setIsStrictModeForDevtools(!0);\n try {\n init(initialArg);\n } finally {\n setIsStrictModeForDevtools(!1);\n }\n }\n } else initialState = initialArg;\n hook.memoizedState = hook.baseState = initialState;\n reducer = {\n pending: null,\n lanes: 0,\n dispatch: null,\n lastRenderedReducer: reducer,\n lastRenderedState: initialState\n };\n hook.queue = reducer;\n reducer = reducer.dispatch = dispatchReducerAction.bind(\n null,\n currentlyRenderingFiber,\n reducer\n );\n return [hook.memoizedState, reducer];\n },\n useRef: function (initialValue) {\n var hook = mountWorkInProgressHook();\n initialValue = { current: initialValue };\n return (hook.memoizedState = initialValue);\n },\n useState: function (initialState) {\n initialState = mountStateImpl(initialState);\n var queue = initialState.queue,\n dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue);\n queue.dispatch = dispatch;\n return [initialState.memoizedState, dispatch];\n },\n useDebugValue: mountDebugValue,\n useDeferredValue: function (value, initialValue) {\n var hook = mountWorkInProgressHook();\n return mountDeferredValueImpl(hook, value, initialValue);\n },\n useTransition: function () {\n var stateHook = mountStateImpl(!1);\n stateHook = startTransition.bind(\n null,\n currentlyRenderingFiber,\n stateHook.queue,\n !0,\n !1\n );\n mountWorkInProgressHook().memoizedState = stateHook;\n return [!1, stateHook];\n },\n useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) {\n var fiber = currentlyRenderingFiber,\n hook = mountWorkInProgressHook();\n if (isHydrating) {\n if (void 0 === getServerSnapshot)\n throw Error(formatProdErrorMessage(407));\n getServerSnapshot = getServerSnapshot();\n } else {\n getServerSnapshot = getSnapshot();\n if (null === workInProgressRoot)\n throw Error(formatProdErrorMessage(349));\n 0 !== (workInProgressRootRenderLanes & 127) ||\n pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);\n }\n hook.memoizedState = getServerSnapshot;\n var inst = { value: getServerSnapshot, getSnapshot: getSnapshot };\n hook.queue = inst;\n mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [\n subscribe\n ]);\n fiber.flags |= 2048;\n pushSimpleEffect(\n 9,\n { destroy: void 0 },\n updateStoreInstance.bind(\n null,\n fiber,\n inst,\n getServerSnapshot,\n getSnapshot\n ),\n null\n );\n return getServerSnapshot;\n },\n useId: function () {\n var hook = mountWorkInProgressHook(),\n identifierPrefix = workInProgressRoot.identifierPrefix;\n if (isHydrating) {\n var JSCompiler_inline_result = treeContextOverflow;\n var idWithLeadingBit = treeContextId;\n JSCompiler_inline_result =\n (\n idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1))\n ).toString(32) + JSCompiler_inline_result;\n identifierPrefix =\n \"_\" + identifierPrefix + \"R_\" + JSCompiler_inline_result;\n JSCompiler_inline_result = localIdCounter++;\n 0 < JSCompiler_inline_result &&\n (identifierPrefix += \"H\" + JSCompiler_inline_result.toString(32));\n identifierPrefix += \"_\";\n } else\n (JSCompiler_inline_result = globalClientIdCounter++),\n (identifierPrefix =\n \"_\" +\n identifierPrefix +\n \"r_\" +\n JSCompiler_inline_result.toString(32) +\n \"_\");\n return (hook.memoizedState = identifierPrefix);\n },\n useHostTransitionStatus: useHostTransitionStatus,\n useFormState: mountActionState,\n useActionState: mountActionState,\n useOptimistic: function (passthrough) {\n var hook = mountWorkInProgressHook();\n hook.memoizedState = hook.baseState = passthrough;\n var queue = {\n pending: null,\n lanes: 0,\n dispatch: null,\n lastRenderedReducer: null,\n lastRenderedState: null\n };\n hook.queue = queue;\n hook = dispatchOptimisticSetState.bind(\n null,\n currentlyRenderingFiber,\n !0,\n queue\n );\n queue.dispatch = hook;\n return [passthrough, hook];\n },\n useMemoCache: useMemoCache,\n useCacheRefresh: function () {\n return (mountWorkInProgressHook().memoizedState = refreshCache.bind(\n null,\n currentlyRenderingFiber\n ));\n },\n useEffectEvent: function (callback) {\n var hook = mountWorkInProgressHook(),\n ref = { impl: callback };\n hook.memoizedState = ref;\n return function () {\n if (0 !== (executionContext & 2))\n throw Error(formatProdErrorMessage(440));\n return ref.impl.apply(void 0, arguments);\n };\n }\n },\n HooksDispatcherOnUpdate = {\n readContext: readContext,\n use: use,\n useCallback: updateCallback,\n useContext: readContext,\n useEffect: updateEffect,\n useImperativeHandle: updateImperativeHandle,\n useInsertionEffect: updateInsertionEffect,\n useLayoutEffect: updateLayoutEffect,\n useMemo: updateMemo,\n useReducer: updateReducer,\n useRef: updateRef,\n useState: function () {\n return updateReducer(basicStateReducer);\n },\n useDebugValue: mountDebugValue,\n useDeferredValue: function (value, initialValue) {\n var hook = updateWorkInProgressHook();\n return updateDeferredValueImpl(\n hook,\n currentHook.memoizedState,\n value,\n initialValue\n );\n },\n useTransition: function () {\n var booleanOrThenable = updateReducer(basicStateReducer)[0],\n start = updateWorkInProgressHook().memoizedState;\n return [\n \"boolean\" === typeof booleanOrThenable\n ? booleanOrThenable\n : useThenable(booleanOrThenable),\n start\n ];\n },\n useSyncExternalStore: updateSyncExternalStore,\n useId: updateId,\n useHostTransitionStatus: useHostTransitionStatus,\n useFormState: updateActionState,\n useActionState: updateActionState,\n useOptimistic: function (passthrough, reducer) {\n var hook = updateWorkInProgressHook();\n return updateOptimisticImpl(hook, currentHook, passthrough, reducer);\n },\n useMemoCache: useMemoCache,\n useCacheRefresh: updateRefresh\n };\nHooksDispatcherOnUpdate.useEffectEvent = updateEvent;\nvar HooksDispatcherOnRerender = {\n readContext: readContext,\n use: use,\n useCallback: updateCallback,\n useContext: readContext,\n useEffect: updateEffect,\n useImperativeHandle: updateImperativeHandle,\n useInsertionEffect: updateInsertionEffect,\n useLayoutEffect: updateLayoutEffect,\n useMemo: updateMemo,\n useReducer: rerenderReducer,\n useRef: updateRef,\n useState: function () {\n return rerenderReducer(basicStateReducer);\n },\n useDebugValue: mountDebugValue,\n useDeferredValue: function (value, initialValue) {\n var hook = updateWorkInProgressHook();\n return null === currentHook\n ? mountDeferredValueImpl(hook, value, initialValue)\n : updateDeferredValueImpl(\n hook,\n currentHook.memoizedState,\n value,\n initialValue\n );\n },\n useTransition: function () {\n var booleanOrThenable = rerenderReducer(basicStateReducer)[0],\n start = updateWorkInProgressHook().memoizedState;\n return [\n \"boolean\" === typeof booleanOrThenable\n ? booleanOrThenable\n : useThenable(booleanOrThenable),\n start\n ];\n },\n useSyncExternalStore: updateSyncExternalStore,\n useId: updateId,\n useHostTransitionStatus: useHostTransitionStatus,\n useFormState: rerenderActionState,\n useActionState: rerenderActionState,\n useOptimistic: function (passthrough, reducer) {\n var hook = updateWorkInProgressHook();\n if (null !== currentHook)\n return updateOptimisticImpl(hook, currentHook, passthrough, reducer);\n hook.baseState = passthrough;\n return [passthrough, hook.queue.dispatch];\n },\n useMemoCache: useMemoCache,\n useCacheRefresh: updateRefresh\n};\nHooksDispatcherOnRerender.useEffectEvent = updateEvent;\nfunction applyDerivedStateFromProps(\n workInProgress,\n ctor,\n getDerivedStateFromProps,\n nextProps\n) {\n ctor = workInProgress.memoizedState;\n getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);\n getDerivedStateFromProps =\n null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps\n ? ctor\n : assign({}, ctor, getDerivedStateFromProps);\n workInProgress.memoizedState = getDerivedStateFromProps;\n 0 === workInProgress.lanes &&\n (workInProgress.updateQueue.baseState = getDerivedStateFromProps);\n}\nvar classComponentUpdater = {\n enqueueSetState: function (inst, payload, callback) {\n inst = inst._reactInternals;\n var lane = requestUpdateLane(),\n update = createUpdate(lane);\n update.payload = payload;\n void 0 !== callback && null !== callback && (update.callback = callback);\n payload = enqueueUpdate(inst, update, lane);\n null !== payload &&\n (scheduleUpdateOnFiber(payload, inst, lane),\n entangleTransitions(payload, inst, lane));\n },\n enqueueReplaceState: function (inst, payload, callback) {\n inst = inst._reactInternals;\n var lane = requestUpdateLane(),\n update = createUpdate(lane);\n update.tag = 1;\n update.payload = payload;\n void 0 !== callback && null !== callback && (update.callback = callback);\n payload = enqueueUpdate(inst, update, lane);\n null !== payload &&\n (scheduleUpdateOnFiber(payload, inst, lane),\n entangleTransitions(payload, inst, lane));\n },\n enqueueForceUpdate: function (inst, callback) {\n inst = inst._reactInternals;\n var lane = requestUpdateLane(),\n update = createUpdate(lane);\n update.tag = 2;\n void 0 !== callback && null !== callback && (update.callback = callback);\n callback = enqueueUpdate(inst, update, lane);\n null !== callback &&\n (scheduleUpdateOnFiber(callback, inst, lane),\n entangleTransitions(callback, inst, lane));\n }\n};\nfunction checkShouldComponentUpdate(\n workInProgress,\n ctor,\n oldProps,\n newProps,\n oldState,\n newState,\n nextContext\n) {\n workInProgress = workInProgress.stateNode;\n return \"function\" === typeof workInProgress.shouldComponentUpdate\n ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext)\n : ctor.prototype && ctor.prototype.isPureReactComponent\n ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)\n : !0;\n}\nfunction callComponentWillReceiveProps(\n workInProgress,\n instance,\n newProps,\n nextContext\n) {\n workInProgress = instance.state;\n \"function\" === typeof instance.componentWillReceiveProps &&\n instance.componentWillReceiveProps(newProps, nextContext);\n \"function\" === typeof instance.UNSAFE_componentWillReceiveProps &&\n instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);\n instance.state !== workInProgress &&\n classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n}\nfunction resolveClassComponentProps(Component, baseProps) {\n var newProps = baseProps;\n if (\"ref\" in baseProps) {\n newProps = {};\n for (var propName in baseProps)\n \"ref\" !== propName && (newProps[propName] = baseProps[propName]);\n }\n if ((Component = Component.defaultProps)) {\n newProps === baseProps && (newProps = assign({}, newProps));\n for (var propName$73 in Component)\n void 0 === newProps[propName$73] &&\n (newProps[propName$73] = Component[propName$73]);\n }\n return newProps;\n}\nfunction defaultOnUncaughtError(error) {\n reportGlobalError(error);\n}\nfunction defaultOnCaughtError(error) {\n console.error(error);\n}\nfunction defaultOnRecoverableError(error) {\n reportGlobalError(error);\n}\nfunction logUncaughtError(root, errorInfo) {\n try {\n var onUncaughtError = root.onUncaughtError;\n onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack });\n } catch (e$74) {\n setTimeout(function () {\n throw e$74;\n });\n }\n}\nfunction logCaughtError(root, boundary, errorInfo) {\n try {\n var onCaughtError = root.onCaughtError;\n onCaughtError(errorInfo.value, {\n componentStack: errorInfo.stack,\n errorBoundary: 1 === boundary.tag ? boundary.stateNode : null\n });\n } catch (e$75) {\n setTimeout(function () {\n throw e$75;\n });\n }\n}\nfunction createRootErrorUpdate(root, errorInfo, lane) {\n lane = createUpdate(lane);\n lane.tag = 3;\n lane.payload = { element: null };\n lane.callback = function () {\n logUncaughtError(root, errorInfo);\n };\n return lane;\n}\nfunction createClassErrorUpdate(lane) {\n lane = createUpdate(lane);\n lane.tag = 3;\n return lane;\n}\nfunction initializeClassErrorUpdate(update, root, fiber, errorInfo) {\n var getDerivedStateFromError = fiber.type.getDerivedStateFromError;\n if (\"function\" === typeof getDerivedStateFromError) {\n var error = errorInfo.value;\n update.payload = function () {\n return getDerivedStateFromError(error);\n };\n update.callback = function () {\n logCaughtError(root, fiber, errorInfo);\n };\n }\n var inst = fiber.stateNode;\n null !== inst &&\n \"function\" === typeof inst.componentDidCatch &&\n (update.callback = function () {\n logCaughtError(root, fiber, errorInfo);\n \"function\" !== typeof getDerivedStateFromError &&\n (null === legacyErrorBoundariesThatAlreadyFailed\n ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))\n : legacyErrorBoundariesThatAlreadyFailed.add(this));\n var stack = errorInfo.stack;\n this.componentDidCatch(errorInfo.value, {\n componentStack: null !== stack ? stack : \"\"\n });\n });\n}\nfunction throwException(\n root,\n returnFiber,\n sourceFiber,\n value,\n rootRenderLanes\n) {\n sourceFiber.flags |= 32768;\n if (\n null !== value &&\n \"object\" === typeof value &&\n \"function\" === typeof value.then\n ) {\n returnFiber = sourceFiber.alternate;\n null !== returnFiber &&\n propagateParentContextChanges(\n returnFiber,\n sourceFiber,\n rootRenderLanes,\n !0\n );\n sourceFiber = suspenseHandlerStackCursor.current;\n if (null !== sourceFiber) {\n switch (sourceFiber.tag) {\n case 31:\n case 13:\n return (\n null === shellBoundary\n ? renderDidSuspendDelayIfPossible()\n : null === sourceFiber.alternate &&\n 0 === workInProgressRootExitStatus &&\n (workInProgressRootExitStatus = 3),\n (sourceFiber.flags &= -257),\n (sourceFiber.flags |= 65536),\n (sourceFiber.lanes = rootRenderLanes),\n value === noopSuspenseyCommitThenable\n ? (sourceFiber.flags |= 16384)\n : ((returnFiber = sourceFiber.updateQueue),\n null === returnFiber\n ? (sourceFiber.updateQueue = new Set([value]))\n : returnFiber.add(value),\n attachPingListener(root, value, rootRenderLanes)),\n !1\n );\n case 22:\n return (\n (sourceFiber.flags |= 65536),\n value === noopSuspenseyCommitThenable\n ? (sourceFiber.flags |= 16384)\n : ((returnFiber = sourceFiber.updateQueue),\n null === returnFiber\n ? ((returnFiber = {\n transitions: null,\n markerInstances: null,\n retryQueue: new Set([value])\n }),\n (sourceFiber.updateQueue = returnFiber))\n : ((sourceFiber = returnFiber.retryQueue),\n null === sourceFiber\n ? (returnFiber.retryQueue = new Set([value]))\n : sourceFiber.add(value)),\n attachPingListener(root, value, rootRenderLanes)),\n !1\n );\n }\n throw Error(formatProdErrorMessage(435, sourceFiber.tag));\n }\n attachPingListener(root, value, rootRenderLanes);\n renderDidSuspendDelayIfPossible();\n return !1;\n }\n if (isHydrating)\n return (\n (returnFiber = suspenseHandlerStackCursor.current),\n null !== returnFiber\n ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256),\n (returnFiber.flags |= 65536),\n (returnFiber.lanes = rootRenderLanes),\n value !== HydrationMismatchException &&\n ((root = Error(formatProdErrorMessage(422), { cause: value })),\n queueHydrationError(createCapturedValueAtFiber(root, sourceFiber))))\n : (value !== HydrationMismatchException &&\n ((returnFiber = Error(formatProdErrorMessage(423), {\n cause: value\n })),\n queueHydrationError(\n createCapturedValueAtFiber(returnFiber, sourceFiber)\n )),\n (root = root.current.alternate),\n (root.flags |= 65536),\n (rootRenderLanes &= -rootRenderLanes),\n (root.lanes |= rootRenderLanes),\n (value = createCapturedValueAtFiber(value, sourceFiber)),\n (rootRenderLanes = createRootErrorUpdate(\n root.stateNode,\n value,\n rootRenderLanes\n )),\n enqueueCapturedUpdate(root, rootRenderLanes),\n 4 !== workInProgressRootExitStatus &&\n (workInProgressRootExitStatus = 2)),\n !1\n );\n var wrapperError = Error(formatProdErrorMessage(520), { cause: value });\n wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber);\n null === workInProgressRootConcurrentErrors\n ? (workInProgressRootConcurrentErrors = [wrapperError])\n : workInProgressRootConcurrentErrors.push(wrapperError);\n 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);\n if (null === returnFiber) return !0;\n value = createCapturedValueAtFiber(value, sourceFiber);\n sourceFiber = returnFiber;\n do {\n switch (sourceFiber.tag) {\n case 3:\n return (\n (sourceFiber.flags |= 65536),\n (root = rootRenderLanes & -rootRenderLanes),\n (sourceFiber.lanes |= root),\n (root = createRootErrorUpdate(sourceFiber.stateNode, value, root)),\n enqueueCapturedUpdate(sourceFiber, root),\n !1\n );\n case 1:\n if (\n ((returnFiber = sourceFiber.type),\n (wrapperError = sourceFiber.stateNode),\n 0 === (sourceFiber.flags & 128) &&\n (\"function\" === typeof returnFiber.getDerivedStateFromError ||\n (null !== wrapperError &&\n \"function\" === typeof wrapperError.componentDidCatch &&\n (null === legacyErrorBoundariesThatAlreadyFailed ||\n !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError)))))\n )\n return (\n (sourceFiber.flags |= 65536),\n (rootRenderLanes &= -rootRenderLanes),\n (sourceFiber.lanes |= rootRenderLanes),\n (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)),\n initializeClassErrorUpdate(\n rootRenderLanes,\n root,\n sourceFiber,\n value\n ),\n enqueueCapturedUpdate(sourceFiber, rootRenderLanes),\n !1\n );\n }\n sourceFiber = sourceFiber.return;\n } while (null !== sourceFiber);\n return !1;\n}\nvar SelectiveHydrationException = Error(formatProdErrorMessage(461)),\n didReceiveUpdate = !1;\nfunction reconcileChildren(current, workInProgress, nextChildren, renderLanes) {\n workInProgress.child =\n null === current\n ? mountChildFibers(workInProgress, null, nextChildren, renderLanes)\n : reconcileChildFibers(\n workInProgress,\n current.child,\n nextChildren,\n renderLanes\n );\n}\nfunction updateForwardRef(\n current,\n workInProgress,\n Component,\n nextProps,\n renderLanes\n) {\n Component = Component.render;\n var ref = workInProgress.ref;\n if (\"ref\" in nextProps) {\n var propsWithoutRef = {};\n for (var key in nextProps)\n \"ref\" !== key && (propsWithoutRef[key] = nextProps[key]);\n } else propsWithoutRef = nextProps;\n prepareToReadContext(workInProgress);\n nextProps = renderWithHooks(\n current,\n workInProgress,\n Component,\n propsWithoutRef,\n ref,\n renderLanes\n );\n key = checkDidRenderIdHook();\n if (null !== current && !didReceiveUpdate)\n return (\n bailoutHooks(current, workInProgress, renderLanes),\n bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)\n );\n isHydrating && key && pushMaterializedTreeId(workInProgress);\n workInProgress.flags |= 1;\n reconcileChildren(current, workInProgress, nextProps, renderLanes);\n return workInProgress.child;\n}\nfunction updateMemoComponent(\n current,\n workInProgress,\n Component,\n nextProps,\n renderLanes\n) {\n if (null === current) {\n var type = Component.type;\n if (\n \"function\" === typeof type &&\n !shouldConstruct(type) &&\n void 0 === type.defaultProps &&\n null === Component.compare\n )\n return (\n (workInProgress.tag = 15),\n (workInProgress.type = type),\n updateSimpleMemoComponent(\n current,\n workInProgress,\n type,\n nextProps,\n renderLanes\n )\n );\n current = createFiberFromTypeAndProps(\n Component.type,\n null,\n nextProps,\n workInProgress,\n workInProgress.mode,\n renderLanes\n );\n current.ref = workInProgress.ref;\n current.return = workInProgress;\n return (workInProgress.child = current);\n }\n type = current.child;\n if (!checkScheduledUpdateOrContext(current, renderLanes)) {\n var prevProps = type.memoizedProps;\n Component = Component.compare;\n Component = null !== Component ? Component : shallowEqual;\n if (Component(prevProps, nextProps) && current.ref === workInProgress.ref)\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n }\n workInProgress.flags |= 1;\n current = createWorkInProgress(type, nextProps);\n current.ref = workInProgress.ref;\n current.return = workInProgress;\n return (workInProgress.child = current);\n}\nfunction updateSimpleMemoComponent(\n current,\n workInProgress,\n Component,\n nextProps,\n renderLanes\n) {\n if (null !== current) {\n var prevProps = current.memoizedProps;\n if (\n shallowEqual(prevProps, nextProps) &&\n current.ref === workInProgress.ref\n )\n if (\n ((didReceiveUpdate = !1),\n (workInProgress.pendingProps = nextProps = prevProps),\n checkScheduledUpdateOrContext(current, renderLanes))\n )\n 0 !== (current.flags & 131072) && (didReceiveUpdate = !0);\n else\n return (\n (workInProgress.lanes = current.lanes),\n bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)\n );\n }\n return updateFunctionComponent(\n current,\n workInProgress,\n Component,\n nextProps,\n renderLanes\n );\n}\nfunction updateOffscreenComponent(\n current,\n workInProgress,\n renderLanes,\n nextProps\n) {\n var nextChildren = nextProps.children,\n prevState = null !== current ? current.memoizedState : null;\n null === current &&\n null === workInProgress.stateNode &&\n (workInProgress.stateNode = {\n _visibility: 1,\n _pendingMarkers: null,\n _retryCache: null,\n _transitions: null\n });\n if (\"hidden\" === nextProps.mode) {\n if (0 !== (workInProgress.flags & 128)) {\n prevState =\n null !== prevState ? prevState.baseLanes | renderLanes : renderLanes;\n if (null !== current) {\n nextProps = workInProgress.child = current.child;\n for (nextChildren = 0; null !== nextProps; )\n (nextChildren =\n nextChildren | nextProps.lanes | nextProps.childLanes),\n (nextProps = nextProps.sibling);\n nextProps = nextChildren & ~prevState;\n } else (nextProps = 0), (workInProgress.child = null);\n return deferHiddenOffscreenComponent(\n current,\n workInProgress,\n prevState,\n renderLanes,\n nextProps\n );\n }\n if (0 !== (renderLanes & 536870912))\n (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }),\n null !== current &&\n pushTransition(\n workInProgress,\n null !== prevState ? prevState.cachePool : null\n ),\n null !== prevState\n ? pushHiddenContext(workInProgress, prevState)\n : reuseHiddenContextOnStack(),\n pushOffscreenSuspenseHandler(workInProgress);\n else\n return (\n (nextProps = workInProgress.lanes = 536870912),\n deferHiddenOffscreenComponent(\n current,\n workInProgress,\n null !== prevState ? prevState.baseLanes | renderLanes : renderLanes,\n renderLanes,\n nextProps\n )\n );\n } else\n null !== prevState\n ? (pushTransition(workInProgress, prevState.cachePool),\n pushHiddenContext(workInProgress, prevState),\n reuseSuspenseHandlerOnStack(workInProgress),\n (workInProgress.memoizedState = null))\n : (null !== current && pushTransition(workInProgress, null),\n reuseHiddenContextOnStack(),\n reuseSuspenseHandlerOnStack(workInProgress));\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\nfunction bailoutOffscreenComponent(current, workInProgress) {\n (null !== current && 22 === current.tag) ||\n null !== workInProgress.stateNode ||\n (workInProgress.stateNode = {\n _visibility: 1,\n _pendingMarkers: null,\n _retryCache: null,\n _transitions: null\n });\n return workInProgress.sibling;\n}\nfunction deferHiddenOffscreenComponent(\n current,\n workInProgress,\n nextBaseLanes,\n renderLanes,\n remainingChildLanes\n) {\n var JSCompiler_inline_result = peekCacheFromPool();\n JSCompiler_inline_result =\n null === JSCompiler_inline_result\n ? null\n : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result };\n workInProgress.memoizedState = {\n baseLanes: nextBaseLanes,\n cachePool: JSCompiler_inline_result\n };\n null !== current && pushTransition(workInProgress, null);\n reuseHiddenContextOnStack();\n pushOffscreenSuspenseHandler(workInProgress);\n null !== current &&\n propagateParentContextChanges(current, workInProgress, renderLanes, !0);\n workInProgress.childLanes = remainingChildLanes;\n return null;\n}\nfunction mountActivityChildren(workInProgress, nextProps) {\n nextProps = mountWorkInProgressOffscreenFiber(\n { mode: nextProps.mode, children: nextProps.children },\n workInProgress.mode\n );\n nextProps.ref = workInProgress.ref;\n workInProgress.child = nextProps;\n nextProps.return = workInProgress;\n return nextProps;\n}\nfunction retryActivityComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n) {\n reconcileChildFibers(workInProgress, current.child, null, renderLanes);\n current = mountActivityChildren(workInProgress, workInProgress.pendingProps);\n current.flags |= 2;\n popSuspenseHandler(workInProgress);\n workInProgress.memoizedState = null;\n return current;\n}\nfunction updateActivityComponent(current, workInProgress, renderLanes) {\n var nextProps = workInProgress.pendingProps,\n didSuspend = 0 !== (workInProgress.flags & 128);\n workInProgress.flags &= -129;\n if (null === current) {\n if (isHydrating) {\n if (\"hidden\" === nextProps.mode)\n return (\n (current = mountActivityChildren(workInProgress, nextProps)),\n (workInProgress.lanes = 536870912),\n bailoutOffscreenComponent(null, current)\n );\n pushDehydratedActivitySuspenseHandler(workInProgress);\n (current = nextHydratableInstance)\n ? ((current = canHydrateHydrationBoundary(\n current,\n rootOrSingletonContext\n )),\n (current = null !== current && \"&\" === current.data ? current : null),\n null !== current &&\n ((workInProgress.memoizedState = {\n dehydrated: current,\n treeContext:\n null !== treeContextProvider\n ? { id: treeContextId, overflow: treeContextOverflow }\n : null,\n retryLane: 536870912,\n hydrationErrors: null\n }),\n (renderLanes = createFiberFromDehydratedFragment(current)),\n (renderLanes.return = workInProgress),\n (workInProgress.child = renderLanes),\n (hydrationParentFiber = workInProgress),\n (nextHydratableInstance = null)))\n : (current = null);\n if (null === current) throw throwOnHydrationMismatch(workInProgress);\n workInProgress.lanes = 536870912;\n return null;\n }\n return mountActivityChildren(workInProgress, nextProps);\n }\n var prevState = current.memoizedState;\n if (null !== prevState) {\n var dehydrated = prevState.dehydrated;\n pushDehydratedActivitySuspenseHandler(workInProgress);\n if (didSuspend)\n if (workInProgress.flags & 256)\n (workInProgress.flags &= -257),\n (workInProgress = retryActivityComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n ));\n else if (null !== workInProgress.memoizedState)\n (workInProgress.child = current.child),\n (workInProgress.flags |= 128),\n (workInProgress = null);\n else throw Error(formatProdErrorMessage(558));\n else if (\n (didReceiveUpdate ||\n propagateParentContextChanges(current, workInProgress, renderLanes, !1),\n (didSuspend = 0 !== (renderLanes & current.childLanes)),\n didReceiveUpdate || didSuspend)\n ) {\n nextProps = workInProgressRoot;\n if (\n null !== nextProps &&\n ((dehydrated = getBumpedLaneForHydration(nextProps, renderLanes)),\n 0 !== dehydrated && dehydrated !== prevState.retryLane)\n )\n throw (\n ((prevState.retryLane = dehydrated),\n enqueueConcurrentRenderForLane(current, dehydrated),\n scheduleUpdateOnFiber(nextProps, current, dehydrated),\n SelectiveHydrationException)\n );\n renderDidSuspendDelayIfPossible();\n workInProgress = retryActivityComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n );\n } else\n (current = prevState.treeContext),\n (nextHydratableInstance = getNextHydratable(dehydrated.nextSibling)),\n (hydrationParentFiber = workInProgress),\n (isHydrating = !0),\n (hydrationErrors = null),\n (rootOrSingletonContext = !1),\n null !== current &&\n restoreSuspendedTreeContext(workInProgress, current),\n (workInProgress = mountActivityChildren(workInProgress, nextProps)),\n (workInProgress.flags |= 4096);\n return workInProgress;\n }\n current = createWorkInProgress(current.child, {\n mode: nextProps.mode,\n children: nextProps.children\n });\n current.ref = workInProgress.ref;\n workInProgress.child = current;\n current.return = workInProgress;\n return current;\n}\nfunction markRef(current, workInProgress) {\n var ref = workInProgress.ref;\n if (null === ref)\n null !== current &&\n null !== current.ref &&\n (workInProgress.flags |= 4194816);\n else {\n if (\"function\" !== typeof ref && \"object\" !== typeof ref)\n throw Error(formatProdErrorMessage(284));\n if (null === current || current.ref !== ref)\n workInProgress.flags |= 4194816;\n }\n}\nfunction updateFunctionComponent(\n current,\n workInProgress,\n Component,\n nextProps,\n renderLanes\n) {\n prepareToReadContext(workInProgress);\n Component = renderWithHooks(\n current,\n workInProgress,\n Component,\n nextProps,\n void 0,\n renderLanes\n );\n nextProps = checkDidRenderIdHook();\n if (null !== current && !didReceiveUpdate)\n return (\n bailoutHooks(current, workInProgress, renderLanes),\n bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)\n );\n isHydrating && nextProps && pushMaterializedTreeId(workInProgress);\n workInProgress.flags |= 1;\n reconcileChildren(current, workInProgress, Component, renderLanes);\n return workInProgress.child;\n}\nfunction replayFunctionComponent(\n current,\n workInProgress,\n nextProps,\n Component,\n secondArg,\n renderLanes\n) {\n prepareToReadContext(workInProgress);\n workInProgress.updateQueue = null;\n nextProps = renderWithHooksAgain(\n workInProgress,\n Component,\n nextProps,\n secondArg\n );\n finishRenderingHooks(current);\n Component = checkDidRenderIdHook();\n if (null !== current && !didReceiveUpdate)\n return (\n bailoutHooks(current, workInProgress, renderLanes),\n bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes)\n );\n isHydrating && Component && pushMaterializedTreeId(workInProgress);\n workInProgress.flags |= 1;\n reconcileChildren(current, workInProgress, nextProps, renderLanes);\n return workInProgress.child;\n}\nfunction updateClassComponent(\n current,\n workInProgress,\n Component,\n nextProps,\n renderLanes\n) {\n prepareToReadContext(workInProgress);\n if (null === workInProgress.stateNode) {\n var context = emptyContextObject,\n contextType = Component.contextType;\n \"object\" === typeof contextType &&\n null !== contextType &&\n (context = readContext(contextType));\n context = new Component(nextProps, context);\n workInProgress.memoizedState =\n null !== context.state && void 0 !== context.state ? context.state : null;\n context.updater = classComponentUpdater;\n workInProgress.stateNode = context;\n context._reactInternals = workInProgress;\n context = workInProgress.stateNode;\n context.props = nextProps;\n context.state = workInProgress.memoizedState;\n context.refs = {};\n initializeUpdateQueue(workInProgress);\n contextType = Component.contextType;\n context.context =\n \"object\" === typeof contextType && null !== contextType\n ? readContext(contextType)\n : emptyContextObject;\n context.state = workInProgress.memoizedState;\n contextType = Component.getDerivedStateFromProps;\n \"function\" === typeof contextType &&\n (applyDerivedStateFromProps(\n workInProgress,\n Component,\n contextType,\n nextProps\n ),\n (context.state = workInProgress.memoizedState));\n \"function\" === typeof Component.getDerivedStateFromProps ||\n \"function\" === typeof context.getSnapshotBeforeUpdate ||\n (\"function\" !== typeof context.UNSAFE_componentWillMount &&\n \"function\" !== typeof context.componentWillMount) ||\n ((contextType = context.state),\n \"function\" === typeof context.componentWillMount &&\n context.componentWillMount(),\n \"function\" === typeof context.UNSAFE_componentWillMount &&\n context.UNSAFE_componentWillMount(),\n contextType !== context.state &&\n classComponentUpdater.enqueueReplaceState(context, context.state, null),\n processUpdateQueue(workInProgress, nextProps, context, renderLanes),\n suspendIfUpdateReadFromEntangledAsyncAction(),\n (context.state = workInProgress.memoizedState));\n \"function\" === typeof context.componentDidMount &&\n (workInProgress.flags |= 4194308);\n nextProps = !0;\n } else if (null === current) {\n context = workInProgress.stateNode;\n var unresolvedOldProps = workInProgress.memoizedProps,\n oldProps = resolveClassComponentProps(Component, unresolvedOldProps);\n context.props = oldProps;\n var oldContext = context.context,\n contextType$jscomp$0 = Component.contextType;\n contextType = emptyContextObject;\n \"object\" === typeof contextType$jscomp$0 &&\n null !== contextType$jscomp$0 &&\n (contextType = readContext(contextType$jscomp$0));\n var getDerivedStateFromProps = Component.getDerivedStateFromProps;\n contextType$jscomp$0 =\n \"function\" === typeof getDerivedStateFromProps ||\n \"function\" === typeof context.getSnapshotBeforeUpdate;\n unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps;\n contextType$jscomp$0 ||\n (\"function\" !== typeof context.UNSAFE_componentWillReceiveProps &&\n \"function\" !== typeof context.componentWillReceiveProps) ||\n ((unresolvedOldProps || oldContext !== contextType) &&\n callComponentWillReceiveProps(\n workInProgress,\n context,\n nextProps,\n contextType\n ));\n hasForceUpdate = !1;\n var oldState = workInProgress.memoizedState;\n context.state = oldState;\n processUpdateQueue(workInProgress, nextProps, context, renderLanes);\n suspendIfUpdateReadFromEntangledAsyncAction();\n oldContext = workInProgress.memoizedState;\n unresolvedOldProps || oldState !== oldContext || hasForceUpdate\n ? (\"function\" === typeof getDerivedStateFromProps &&\n (applyDerivedStateFromProps(\n workInProgress,\n Component,\n getDerivedStateFromProps,\n nextProps\n ),\n (oldContext = workInProgress.memoizedState)),\n (oldProps =\n hasForceUpdate ||\n checkShouldComponentUpdate(\n workInProgress,\n Component,\n oldProps,\n nextProps,\n oldState,\n oldContext,\n contextType\n ))\n ? (contextType$jscomp$0 ||\n (\"function\" !== typeof context.UNSAFE_componentWillMount &&\n \"function\" !== typeof context.componentWillMount) ||\n (\"function\" === typeof context.componentWillMount &&\n context.componentWillMount(),\n \"function\" === typeof context.UNSAFE_componentWillMount &&\n context.UNSAFE_componentWillMount()),\n \"function\" === typeof context.componentDidMount &&\n (workInProgress.flags |= 4194308))\n : (\"function\" === typeof context.componentDidMount &&\n (workInProgress.flags |= 4194308),\n (workInProgress.memoizedProps = nextProps),\n (workInProgress.memoizedState = oldContext)),\n (context.props = nextProps),\n (context.state = oldContext),\n (context.context = contextType),\n (nextProps = oldProps))\n : (\"function\" === typeof context.componentDidMount &&\n (workInProgress.flags |= 4194308),\n (nextProps = !1));\n } else {\n context = workInProgress.stateNode;\n cloneUpdateQueue(current, workInProgress);\n contextType = workInProgress.memoizedProps;\n contextType$jscomp$0 = resolveClassComponentProps(Component, contextType);\n context.props = contextType$jscomp$0;\n getDerivedStateFromProps = workInProgress.pendingProps;\n oldState = context.context;\n oldContext = Component.contextType;\n oldProps = emptyContextObject;\n \"object\" === typeof oldContext &&\n null !== oldContext &&\n (oldProps = readContext(oldContext));\n unresolvedOldProps = Component.getDerivedStateFromProps;\n (oldContext =\n \"function\" === typeof unresolvedOldProps ||\n \"function\" === typeof context.getSnapshotBeforeUpdate) ||\n (\"function\" !== typeof context.UNSAFE_componentWillReceiveProps &&\n \"function\" !== typeof context.componentWillReceiveProps) ||\n ((contextType !== getDerivedStateFromProps || oldState !== oldProps) &&\n callComponentWillReceiveProps(\n workInProgress,\n context,\n nextProps,\n oldProps\n ));\n hasForceUpdate = !1;\n oldState = workInProgress.memoizedState;\n context.state = oldState;\n processUpdateQueue(workInProgress, nextProps, context, renderLanes);\n suspendIfUpdateReadFromEntangledAsyncAction();\n var newState = workInProgress.memoizedState;\n contextType !== getDerivedStateFromProps ||\n oldState !== newState ||\n hasForceUpdate ||\n (null !== current &&\n null !== current.dependencies &&\n checkIfContextChanged(current.dependencies))\n ? (\"function\" === typeof unresolvedOldProps &&\n (applyDerivedStateFromProps(\n workInProgress,\n Component,\n unresolvedOldProps,\n nextProps\n ),\n (newState = workInProgress.memoizedState)),\n (contextType$jscomp$0 =\n hasForceUpdate ||\n checkShouldComponentUpdate(\n workInProgress,\n Component,\n contextType$jscomp$0,\n nextProps,\n oldState,\n newState,\n oldProps\n ) ||\n (null !== current &&\n null !== current.dependencies &&\n checkIfContextChanged(current.dependencies)))\n ? (oldContext ||\n (\"function\" !== typeof context.UNSAFE_componentWillUpdate &&\n \"function\" !== typeof context.componentWillUpdate) ||\n (\"function\" === typeof context.componentWillUpdate &&\n context.componentWillUpdate(nextProps, newState, oldProps),\n \"function\" === typeof context.UNSAFE_componentWillUpdate &&\n context.UNSAFE_componentWillUpdate(\n nextProps,\n newState,\n oldProps\n )),\n \"function\" === typeof context.componentDidUpdate &&\n (workInProgress.flags |= 4),\n \"function\" === typeof context.getSnapshotBeforeUpdate &&\n (workInProgress.flags |= 1024))\n : (\"function\" !== typeof context.componentDidUpdate ||\n (contextType === current.memoizedProps &&\n oldState === current.memoizedState) ||\n (workInProgress.flags |= 4),\n \"function\" !== typeof context.getSnapshotBeforeUpdate ||\n (contextType === current.memoizedProps &&\n oldState === current.memoizedState) ||\n (workInProgress.flags |= 1024),\n (workInProgress.memoizedProps = nextProps),\n (workInProgress.memoizedState = newState)),\n (context.props = nextProps),\n (context.state = newState),\n (context.context = oldProps),\n (nextProps = contextType$jscomp$0))\n : (\"function\" !== typeof context.componentDidUpdate ||\n (contextType === current.memoizedProps &&\n oldState === current.memoizedState) ||\n (workInProgress.flags |= 4),\n \"function\" !== typeof context.getSnapshotBeforeUpdate ||\n (contextType === current.memoizedProps &&\n oldState === current.memoizedState) ||\n (workInProgress.flags |= 1024),\n (nextProps = !1));\n }\n context = nextProps;\n markRef(current, workInProgress);\n nextProps = 0 !== (workInProgress.flags & 128);\n context || nextProps\n ? ((context = workInProgress.stateNode),\n (Component =\n nextProps && \"function\" !== typeof Component.getDerivedStateFromError\n ? null\n : context.render()),\n (workInProgress.flags |= 1),\n null !== current && nextProps\n ? ((workInProgress.child = reconcileChildFibers(\n workInProgress,\n current.child,\n null,\n renderLanes\n )),\n (workInProgress.child = reconcileChildFibers(\n workInProgress,\n null,\n Component,\n renderLanes\n )))\n : reconcileChildren(current, workInProgress, Component, renderLanes),\n (workInProgress.memoizedState = context.state),\n (current = workInProgress.child))\n : (current = bailoutOnAlreadyFinishedWork(\n current,\n workInProgress,\n renderLanes\n ));\n return current;\n}\nfunction mountHostRootWithoutHydrating(\n current,\n workInProgress,\n nextChildren,\n renderLanes\n) {\n resetHydrationState();\n workInProgress.flags |= 256;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\nvar SUSPENDED_MARKER = {\n dehydrated: null,\n treeContext: null,\n retryLane: 0,\n hydrationErrors: null\n};\nfunction mountSuspenseOffscreenState(renderLanes) {\n return { baseLanes: renderLanes, cachePool: getSuspendedCache() };\n}\nfunction getRemainingWorkInPrimaryTree(\n current,\n primaryTreeDidDefer,\n renderLanes\n) {\n current = null !== current ? current.childLanes & ~renderLanes : 0;\n primaryTreeDidDefer && (current |= workInProgressDeferredLane);\n return current;\n}\nfunction updateSuspenseComponent(current, workInProgress, renderLanes) {\n var nextProps = workInProgress.pendingProps,\n showFallback = !1,\n didSuspend = 0 !== (workInProgress.flags & 128),\n JSCompiler_temp;\n (JSCompiler_temp = didSuspend) ||\n (JSCompiler_temp =\n null !== current && null === current.memoizedState\n ? !1\n : 0 !== (suspenseStackCursor.current & 2));\n JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129));\n JSCompiler_temp = 0 !== (workInProgress.flags & 32);\n workInProgress.flags &= -33;\n if (null === current) {\n if (isHydrating) {\n showFallback\n ? pushPrimaryTreeSuspenseHandler(workInProgress)\n : reuseSuspenseHandlerOnStack(workInProgress);\n (current = nextHydratableInstance)\n ? ((current = canHydrateHydrationBoundary(\n current,\n rootOrSingletonContext\n )),\n (current = null !== current && \"&\" !== current.data ? current : null),\n null !== current &&\n ((workInProgress.memoizedState = {\n dehydrated: current,\n treeContext:\n null !== treeContextProvider\n ? { id: treeContextId, overflow: treeContextOverflow }\n : null,\n retryLane: 536870912,\n hydrationErrors: null\n }),\n (renderLanes = createFiberFromDehydratedFragment(current)),\n (renderLanes.return = workInProgress),\n (workInProgress.child = renderLanes),\n (hydrationParentFiber = workInProgress),\n (nextHydratableInstance = null)))\n : (current = null);\n if (null === current) throw throwOnHydrationMismatch(workInProgress);\n isSuspenseInstanceFallback(current)\n ? (workInProgress.lanes = 32)\n : (workInProgress.lanes = 536870912);\n return null;\n }\n var nextPrimaryChildren = nextProps.children;\n nextProps = nextProps.fallback;\n if (showFallback)\n return (\n reuseSuspenseHandlerOnStack(workInProgress),\n (showFallback = workInProgress.mode),\n (nextPrimaryChildren = mountWorkInProgressOffscreenFiber(\n { mode: \"hidden\", children: nextPrimaryChildren },\n showFallback\n )),\n (nextProps = createFiberFromFragment(\n nextProps,\n showFallback,\n renderLanes,\n null\n )),\n (nextPrimaryChildren.return = workInProgress),\n (nextProps.return = workInProgress),\n (nextPrimaryChildren.sibling = nextProps),\n (workInProgress.child = nextPrimaryChildren),\n (nextProps = workInProgress.child),\n (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)),\n (nextProps.childLanes = getRemainingWorkInPrimaryTree(\n current,\n JSCompiler_temp,\n renderLanes\n )),\n (workInProgress.memoizedState = SUSPENDED_MARKER),\n bailoutOffscreenComponent(null, nextProps)\n );\n pushPrimaryTreeSuspenseHandler(workInProgress);\n return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren);\n }\n var prevState = current.memoizedState;\n if (\n null !== prevState &&\n ((nextPrimaryChildren = prevState.dehydrated), null !== nextPrimaryChildren)\n ) {\n if (didSuspend)\n workInProgress.flags & 256\n ? (pushPrimaryTreeSuspenseHandler(workInProgress),\n (workInProgress.flags &= -257),\n (workInProgress = retrySuspenseComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n )))\n : null !== workInProgress.memoizedState\n ? (reuseSuspenseHandlerOnStack(workInProgress),\n (workInProgress.child = current.child),\n (workInProgress.flags |= 128),\n (workInProgress = null))\n : (reuseSuspenseHandlerOnStack(workInProgress),\n (nextPrimaryChildren = nextProps.fallback),\n (showFallback = workInProgress.mode),\n (nextProps = mountWorkInProgressOffscreenFiber(\n { mode: \"visible\", children: nextProps.children },\n showFallback\n )),\n (nextPrimaryChildren = createFiberFromFragment(\n nextPrimaryChildren,\n showFallback,\n renderLanes,\n null\n )),\n (nextPrimaryChildren.flags |= 2),\n (nextProps.return = workInProgress),\n (nextPrimaryChildren.return = workInProgress),\n (nextProps.sibling = nextPrimaryChildren),\n (workInProgress.child = nextProps),\n reconcileChildFibers(\n workInProgress,\n current.child,\n null,\n renderLanes\n ),\n (nextProps = workInProgress.child),\n (nextProps.memoizedState =\n mountSuspenseOffscreenState(renderLanes)),\n (nextProps.childLanes = getRemainingWorkInPrimaryTree(\n current,\n JSCompiler_temp,\n renderLanes\n )),\n (workInProgress.memoizedState = SUSPENDED_MARKER),\n (workInProgress = bailoutOffscreenComponent(null, nextProps)));\n else if (\n (pushPrimaryTreeSuspenseHandler(workInProgress),\n isSuspenseInstanceFallback(nextPrimaryChildren))\n ) {\n JSCompiler_temp =\n nextPrimaryChildren.nextSibling &&\n nextPrimaryChildren.nextSibling.dataset;\n if (JSCompiler_temp) var digest = JSCompiler_temp.dgst;\n JSCompiler_temp = digest;\n nextProps = Error(formatProdErrorMessage(419));\n nextProps.stack = \"\";\n nextProps.digest = JSCompiler_temp;\n queueHydrationError({ value: nextProps, source: null, stack: null });\n workInProgress = retrySuspenseComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n );\n } else if (\n (didReceiveUpdate ||\n propagateParentContextChanges(current, workInProgress, renderLanes, !1),\n (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)),\n didReceiveUpdate || JSCompiler_temp)\n ) {\n JSCompiler_temp = workInProgressRoot;\n if (\n null !== JSCompiler_temp &&\n ((nextProps = getBumpedLaneForHydration(JSCompiler_temp, renderLanes)),\n 0 !== nextProps && nextProps !== prevState.retryLane)\n )\n throw (\n ((prevState.retryLane = nextProps),\n enqueueConcurrentRenderForLane(current, nextProps),\n scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps),\n SelectiveHydrationException)\n );\n isSuspenseInstancePending(nextPrimaryChildren) ||\n renderDidSuspendDelayIfPossible();\n workInProgress = retrySuspenseComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n );\n } else\n isSuspenseInstancePending(nextPrimaryChildren)\n ? ((workInProgress.flags |= 192),\n (workInProgress.child = current.child),\n (workInProgress = null))\n : ((current = prevState.treeContext),\n (nextHydratableInstance = getNextHydratable(\n nextPrimaryChildren.nextSibling\n )),\n (hydrationParentFiber = workInProgress),\n (isHydrating = !0),\n (hydrationErrors = null),\n (rootOrSingletonContext = !1),\n null !== current &&\n restoreSuspendedTreeContext(workInProgress, current),\n (workInProgress = mountSuspensePrimaryChildren(\n workInProgress,\n nextProps.children\n )),\n (workInProgress.flags |= 4096));\n return workInProgress;\n }\n if (showFallback)\n return (\n reuseSuspenseHandlerOnStack(workInProgress),\n (nextPrimaryChildren = nextProps.fallback),\n (showFallback = workInProgress.mode),\n (prevState = current.child),\n (digest = prevState.sibling),\n (nextProps = createWorkInProgress(prevState, {\n mode: \"hidden\",\n children: nextProps.children\n })),\n (nextProps.subtreeFlags = prevState.subtreeFlags & 65011712),\n null !== digest\n ? (nextPrimaryChildren = createWorkInProgress(\n digest,\n nextPrimaryChildren\n ))\n : ((nextPrimaryChildren = createFiberFromFragment(\n nextPrimaryChildren,\n showFallback,\n renderLanes,\n null\n )),\n (nextPrimaryChildren.flags |= 2)),\n (nextPrimaryChildren.return = workInProgress),\n (nextProps.return = workInProgress),\n (nextProps.sibling = nextPrimaryChildren),\n (workInProgress.child = nextProps),\n bailoutOffscreenComponent(null, nextProps),\n (nextProps = workInProgress.child),\n (nextPrimaryChildren = current.child.memoizedState),\n null === nextPrimaryChildren\n ? (nextPrimaryChildren = mountSuspenseOffscreenState(renderLanes))\n : ((showFallback = nextPrimaryChildren.cachePool),\n null !== showFallback\n ? ((prevState = CacheContext._currentValue),\n (showFallback =\n showFallback.parent !== prevState\n ? { parent: prevState, pool: prevState }\n : showFallback))\n : (showFallback = getSuspendedCache()),\n (nextPrimaryChildren = {\n baseLanes: nextPrimaryChildren.baseLanes | renderLanes,\n cachePool: showFallback\n })),\n (nextProps.memoizedState = nextPrimaryChildren),\n (nextProps.childLanes = getRemainingWorkInPrimaryTree(\n current,\n JSCompiler_temp,\n renderLanes\n )),\n (workInProgress.memoizedState = SUSPENDED_MARKER),\n bailoutOffscreenComponent(current.child, nextProps)\n );\n pushPrimaryTreeSuspenseHandler(workInProgress);\n renderLanes = current.child;\n current = renderLanes.sibling;\n renderLanes = createWorkInProgress(renderLanes, {\n mode: \"visible\",\n children: nextProps.children\n });\n renderLanes.return = workInProgress;\n renderLanes.sibling = null;\n null !== current &&\n ((JSCompiler_temp = workInProgress.deletions),\n null === JSCompiler_temp\n ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16))\n : JSCompiler_temp.push(current));\n workInProgress.child = renderLanes;\n workInProgress.memoizedState = null;\n return renderLanes;\n}\nfunction mountSuspensePrimaryChildren(workInProgress, primaryChildren) {\n primaryChildren = mountWorkInProgressOffscreenFiber(\n { mode: \"visible\", children: primaryChildren },\n workInProgress.mode\n );\n primaryChildren.return = workInProgress;\n return (workInProgress.child = primaryChildren);\n}\nfunction mountWorkInProgressOffscreenFiber(offscreenProps, mode) {\n offscreenProps = createFiberImplClass(22, offscreenProps, null, mode);\n offscreenProps.lanes = 0;\n return offscreenProps;\n}\nfunction retrySuspenseComponentWithoutHydrating(\n current,\n workInProgress,\n renderLanes\n) {\n reconcileChildFibers(workInProgress, current.child, null, renderLanes);\n current = mountSuspensePrimaryChildren(\n workInProgress,\n workInProgress.pendingProps.children\n );\n current.flags |= 2;\n workInProgress.memoizedState = null;\n return current;\n}\nfunction scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) {\n fiber.lanes |= renderLanes;\n var alternate = fiber.alternate;\n null !== alternate && (alternate.lanes |= renderLanes);\n scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot);\n}\nfunction initSuspenseListRenderState(\n workInProgress,\n isBackwards,\n tail,\n lastContentRow,\n tailMode,\n treeForkCount\n) {\n var renderState = workInProgress.memoizedState;\n null === renderState\n ? (workInProgress.memoizedState = {\n isBackwards: isBackwards,\n rendering: null,\n renderingStartTime: 0,\n last: lastContentRow,\n tail: tail,\n tailMode: tailMode,\n treeForkCount: treeForkCount\n })\n : ((renderState.isBackwards = isBackwards),\n (renderState.rendering = null),\n (renderState.renderingStartTime = 0),\n (renderState.last = lastContentRow),\n (renderState.tail = tail),\n (renderState.tailMode = tailMode),\n (renderState.treeForkCount = treeForkCount));\n}\nfunction updateSuspenseListComponent(current, workInProgress, renderLanes) {\n var nextProps = workInProgress.pendingProps,\n revealOrder = nextProps.revealOrder,\n tailMode = nextProps.tail;\n nextProps = nextProps.children;\n var suspenseContext = suspenseStackCursor.current,\n shouldForceFallback = 0 !== (suspenseContext & 2);\n shouldForceFallback\n ? ((suspenseContext = (suspenseContext & 1) | 2),\n (workInProgress.flags |= 128))\n : (suspenseContext &= 1);\n push(suspenseStackCursor, suspenseContext);\n reconcileChildren(current, workInProgress, nextProps, renderLanes);\n nextProps = isHydrating ? treeForkCount : 0;\n if (!shouldForceFallback && null !== current && 0 !== (current.flags & 128))\n a: for (current = workInProgress.child; null !== current; ) {\n if (13 === current.tag)\n null !== current.memoizedState &&\n scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);\n else if (19 === current.tag)\n scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress);\n else if (null !== current.child) {\n current.child.return = current;\n current = current.child;\n continue;\n }\n if (current === workInProgress) break a;\n for (; null === current.sibling; ) {\n if (null === current.return || current.return === workInProgress)\n break a;\n current = current.return;\n }\n current.sibling.return = current.return;\n current = current.sibling;\n }\n switch (revealOrder) {\n case \"forwards\":\n renderLanes = workInProgress.child;\n for (revealOrder = null; null !== renderLanes; )\n (current = renderLanes.alternate),\n null !== current &&\n null === findFirstSuspended(current) &&\n (revealOrder = renderLanes),\n (renderLanes = renderLanes.sibling);\n renderLanes = revealOrder;\n null === renderLanes\n ? ((revealOrder = workInProgress.child), (workInProgress.child = null))\n : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null));\n initSuspenseListRenderState(\n workInProgress,\n !1,\n revealOrder,\n renderLanes,\n tailMode,\n nextProps\n );\n break;\n case \"backwards\":\n case \"unstable_legacy-backwards\":\n renderLanes = null;\n revealOrder = workInProgress.child;\n for (workInProgress.child = null; null !== revealOrder; ) {\n current = revealOrder.alternate;\n if (null !== current && null === findFirstSuspended(current)) {\n workInProgress.child = revealOrder;\n break;\n }\n current = revealOrder.sibling;\n revealOrder.sibling = renderLanes;\n renderLanes = revealOrder;\n revealOrder = current;\n }\n initSuspenseListRenderState(\n workInProgress,\n !0,\n renderLanes,\n null,\n tailMode,\n nextProps\n );\n break;\n case \"together\":\n initSuspenseListRenderState(\n workInProgress,\n !1,\n null,\n null,\n void 0,\n nextProps\n );\n break;\n default:\n workInProgress.memoizedState = null;\n }\n return workInProgress.child;\n}\nfunction bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {\n null !== current && (workInProgress.dependencies = current.dependencies);\n workInProgressRootSkippedLanes |= workInProgress.lanes;\n if (0 === (renderLanes & workInProgress.childLanes))\n if (null !== current) {\n if (\n (propagateParentContextChanges(\n current,\n workInProgress,\n renderLanes,\n !1\n ),\n 0 === (renderLanes & workInProgress.childLanes))\n )\n return null;\n } else return null;\n if (null !== current && workInProgress.child !== current.child)\n throw Error(formatProdErrorMessage(153));\n if (null !== workInProgress.child) {\n current = workInProgress.child;\n renderLanes = createWorkInProgress(current, current.pendingProps);\n workInProgress.child = renderLanes;\n for (renderLanes.return = workInProgress; null !== current.sibling; )\n (current = current.sibling),\n (renderLanes = renderLanes.sibling =\n createWorkInProgress(current, current.pendingProps)),\n (renderLanes.return = workInProgress);\n renderLanes.sibling = null;\n }\n return workInProgress.child;\n}\nfunction checkScheduledUpdateOrContext(current, renderLanes) {\n if (0 !== (current.lanes & renderLanes)) return !0;\n current = current.dependencies;\n return null !== current && checkIfContextChanged(current) ? !0 : !1;\n}\nfunction attemptEarlyBailoutIfNoScheduledUpdate(\n current,\n workInProgress,\n renderLanes\n) {\n switch (workInProgress.tag) {\n case 3:\n pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n pushProvider(workInProgress, CacheContext, current.memoizedState.cache);\n resetHydrationState();\n break;\n case 27:\n case 5:\n pushHostContext(workInProgress);\n break;\n case 4:\n pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n break;\n case 10:\n pushProvider(\n workInProgress,\n workInProgress.type,\n workInProgress.memoizedProps.value\n );\n break;\n case 31:\n if (null !== workInProgress.memoizedState)\n return (\n (workInProgress.flags |= 128),\n pushDehydratedActivitySuspenseHandler(workInProgress),\n null\n );\n break;\n case 13:\n var state$102 = workInProgress.memoizedState;\n if (null !== state$102) {\n if (null !== state$102.dehydrated)\n return (\n pushPrimaryTreeSuspenseHandler(workInProgress),\n (workInProgress.flags |= 128),\n null\n );\n if (0 !== (renderLanes & workInProgress.child.childLanes))\n return updateSuspenseComponent(current, workInProgress, renderLanes);\n pushPrimaryTreeSuspenseHandler(workInProgress);\n current = bailoutOnAlreadyFinishedWork(\n current,\n workInProgress,\n renderLanes\n );\n return null !== current ? current.sibling : null;\n }\n pushPrimaryTreeSuspenseHandler(workInProgress);\n break;\n case 19:\n var didSuspendBefore = 0 !== (current.flags & 128);\n state$102 = 0 !== (renderLanes & workInProgress.childLanes);\n state$102 ||\n (propagateParentContextChanges(\n current,\n workInProgress,\n renderLanes,\n !1\n ),\n (state$102 = 0 !== (renderLanes & workInProgress.childLanes)));\n if (didSuspendBefore) {\n if (state$102)\n return updateSuspenseListComponent(\n current,\n workInProgress,\n renderLanes\n );\n workInProgress.flags |= 128;\n }\n didSuspendBefore = workInProgress.memoizedState;\n null !== didSuspendBefore &&\n ((didSuspendBefore.rendering = null),\n (didSuspendBefore.tail = null),\n (didSuspendBefore.lastEffect = null));\n push(suspenseStackCursor, suspenseStackCursor.current);\n if (state$102) break;\n else return null;\n case 22:\n return (\n (workInProgress.lanes = 0),\n updateOffscreenComponent(\n current,\n workInProgress,\n renderLanes,\n workInProgress.pendingProps\n )\n );\n case 24:\n pushProvider(workInProgress, CacheContext, current.memoizedState.cache);\n }\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n}\nfunction beginWork(current, workInProgress, renderLanes) {\n if (null !== current)\n if (current.memoizedProps !== workInProgress.pendingProps)\n didReceiveUpdate = !0;\n else {\n if (\n !checkScheduledUpdateOrContext(current, renderLanes) &&\n 0 === (workInProgress.flags & 128)\n )\n return (\n (didReceiveUpdate = !1),\n attemptEarlyBailoutIfNoScheduledUpdate(\n current,\n workInProgress,\n renderLanes\n )\n );\n didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1;\n }\n else\n (didReceiveUpdate = !1),\n isHydrating &&\n 0 !== (workInProgress.flags & 1048576) &&\n pushTreeId(workInProgress, treeForkCount, workInProgress.index);\n workInProgress.lanes = 0;\n switch (workInProgress.tag) {\n case 16:\n a: {\n var props = workInProgress.pendingProps;\n current = resolveLazy(workInProgress.elementType);\n workInProgress.type = current;\n if (\"function\" === typeof current)\n shouldConstruct(current)\n ? ((props = resolveClassComponentProps(current, props)),\n (workInProgress.tag = 1),\n (workInProgress = updateClassComponent(\n null,\n workInProgress,\n current,\n props,\n renderLanes\n )))\n : ((workInProgress.tag = 0),\n (workInProgress = updateFunctionComponent(\n null,\n workInProgress,\n current,\n props,\n renderLanes\n )));\n else {\n if (void 0 !== current && null !== current) {\n var $$typeof = current.$$typeof;\n if ($$typeof === REACT_FORWARD_REF_TYPE) {\n workInProgress.tag = 11;\n workInProgress = updateForwardRef(\n null,\n workInProgress,\n current,\n props,\n renderLanes\n );\n break a;\n } else if ($$typeof === REACT_MEMO_TYPE) {\n workInProgress.tag = 14;\n workInProgress = updateMemoComponent(\n null,\n workInProgress,\n current,\n props,\n renderLanes\n );\n break a;\n }\n }\n workInProgress = getComponentNameFromType(current) || current;\n throw Error(formatProdErrorMessage(306, workInProgress, \"\"));\n }\n }\n return workInProgress;\n case 0:\n return updateFunctionComponent(\n current,\n workInProgress,\n workInProgress.type,\n workInProgress.pendingProps,\n renderLanes\n );\n case 1:\n return (\n (props = workInProgress.type),\n ($$typeof = resolveClassComponentProps(\n props,\n workInProgress.pendingProps\n )),\n updateClassComponent(\n current,\n workInProgress,\n props,\n $$typeof,\n renderLanes\n )\n );\n case 3:\n a: {\n pushHostContainer(\n workInProgress,\n workInProgress.stateNode.containerInfo\n );\n if (null === current) throw Error(formatProdErrorMessage(387));\n props = workInProgress.pendingProps;\n var prevState = workInProgress.memoizedState;\n $$typeof = prevState.element;\n cloneUpdateQueue(current, workInProgress);\n processUpdateQueue(workInProgress, props, null, renderLanes);\n var nextState = workInProgress.memoizedState;\n props = nextState.cache;\n pushProvider(workInProgress, CacheContext, props);\n props !== prevState.cache &&\n propagateContextChanges(\n workInProgress,\n [CacheContext],\n renderLanes,\n !0\n );\n suspendIfUpdateReadFromEntangledAsyncAction();\n props = nextState.element;\n if (prevState.isDehydrated)\n if (\n ((prevState = {\n element: props,\n isDehydrated: !1,\n cache: nextState.cache\n }),\n (workInProgress.updateQueue.baseState = prevState),\n (workInProgress.memoizedState = prevState),\n workInProgress.flags & 256)\n ) {\n workInProgress = mountHostRootWithoutHydrating(\n current,\n workInProgress,\n props,\n renderLanes\n );\n break a;\n } else if (props !== $$typeof) {\n $$typeof = createCapturedValueAtFiber(\n Error(formatProdErrorMessage(424)),\n workInProgress\n );\n queueHydrationError($$typeof);\n workInProgress = mountHostRootWithoutHydrating(\n current,\n workInProgress,\n props,\n renderLanes\n );\n break a;\n } else {\n current = workInProgress.stateNode.containerInfo;\n switch (current.nodeType) {\n case 9:\n current = current.body;\n break;\n default:\n current =\n \"HTML\" === current.nodeName\n ? current.ownerDocument.body\n : current;\n }\n nextHydratableInstance = getNextHydratable(current.firstChild);\n hydrationParentFiber = workInProgress;\n isHydrating = !0;\n hydrationErrors = null;\n rootOrSingletonContext = !0;\n renderLanes = mountChildFibers(\n workInProgress,\n null,\n props,\n renderLanes\n );\n for (workInProgress.child = renderLanes; renderLanes; )\n (renderLanes.flags = (renderLanes.flags & -3) | 4096),\n (renderLanes = renderLanes.sibling);\n }\n else {\n resetHydrationState();\n if (props === $$typeof) {\n workInProgress = bailoutOnAlreadyFinishedWork(\n current,\n workInProgress,\n renderLanes\n );\n break a;\n }\n reconcileChildren(current, workInProgress, props, renderLanes);\n }\n workInProgress = workInProgress.child;\n }\n return workInProgress;\n case 26:\n return (\n markRef(current, workInProgress),\n null === current\n ? (renderLanes = getResource(\n workInProgress.type,\n null,\n workInProgress.pendingProps,\n null\n ))\n ? (workInProgress.memoizedState = renderLanes)\n : isHydrating ||\n ((renderLanes = workInProgress.type),\n (current = workInProgress.pendingProps),\n (props = getOwnerDocumentFromRootContainer(\n rootInstanceStackCursor.current\n ).createElement(renderLanes)),\n (props[internalInstanceKey] = workInProgress),\n (props[internalPropsKey] = current),\n setInitialProperties(props, renderLanes, current),\n markNodeAsHoistable(props),\n (workInProgress.stateNode = props))\n : (workInProgress.memoizedState = getResource(\n workInProgress.type,\n current.memoizedProps,\n workInProgress.pendingProps,\n current.memoizedState\n )),\n null\n );\n case 27:\n return (\n pushHostContext(workInProgress),\n null === current &&\n isHydrating &&\n ((props = workInProgress.stateNode =\n resolveSingletonInstance(\n workInProgress.type,\n workInProgress.pendingProps,\n rootInstanceStackCursor.current\n )),\n (hydrationParentFiber = workInProgress),\n (rootOrSingletonContext = !0),\n ($$typeof = nextHydratableInstance),\n isSingletonScope(workInProgress.type)\n ? ((previousHydratableOnEnteringScopedSingleton = $$typeof),\n (nextHydratableInstance = getNextHydratable(props.firstChild)))\n : (nextHydratableInstance = $$typeof)),\n reconcileChildren(\n current,\n workInProgress,\n workInProgress.pendingProps.children,\n renderLanes\n ),\n markRef(current, workInProgress),\n null === current && (workInProgress.flags |= 4194304),\n workInProgress.child\n );\n case 5:\n if (null === current && isHydrating) {\n if (($$typeof = props = nextHydratableInstance))\n (props = canHydrateInstance(\n props,\n workInProgress.type,\n workInProgress.pendingProps,\n rootOrSingletonContext\n )),\n null !== props\n ? ((workInProgress.stateNode = props),\n (hydrationParentFiber = workInProgress),\n (nextHydratableInstance = getNextHydratable(props.firstChild)),\n (rootOrSingletonContext = !1),\n ($$typeof = !0))\n : ($$typeof = !1);\n $$typeof || throwOnHydrationMismatch(workInProgress);\n }\n pushHostContext(workInProgress);\n $$typeof = workInProgress.type;\n prevState = workInProgress.pendingProps;\n nextState = null !== current ? current.memoizedProps : null;\n props = prevState.children;\n shouldSetTextContent($$typeof, prevState)\n ? (props = null)\n : null !== nextState &&\n shouldSetTextContent($$typeof, nextState) &&\n (workInProgress.flags |= 32);\n null !== workInProgress.memoizedState &&\n (($$typeof = renderWithHooks(\n current,\n workInProgress,\n TransitionAwareHostComponent,\n null,\n null,\n renderLanes\n )),\n (HostTransitionContext._currentValue = $$typeof));\n markRef(current, workInProgress);\n reconcileChildren(current, workInProgress, props, renderLanes);\n return workInProgress.child;\n case 6:\n if (null === current && isHydrating) {\n if ((current = renderLanes = nextHydratableInstance))\n (renderLanes = canHydrateTextInstance(\n renderLanes,\n workInProgress.pendingProps,\n rootOrSingletonContext\n )),\n null !== renderLanes\n ? ((workInProgress.stateNode = renderLanes),\n (hydrationParentFiber = workInProgress),\n (nextHydratableInstance = null),\n (current = !0))\n : (current = !1);\n current || throwOnHydrationMismatch(workInProgress);\n }\n return null;\n case 13:\n return updateSuspenseComponent(current, workInProgress, renderLanes);\n case 4:\n return (\n pushHostContainer(\n workInProgress,\n workInProgress.stateNode.containerInfo\n ),\n (props = workInProgress.pendingProps),\n null === current\n ? (workInProgress.child = reconcileChildFibers(\n workInProgress,\n null,\n props,\n renderLanes\n ))\n : reconcileChildren(current, workInProgress, props, renderLanes),\n workInProgress.child\n );\n case 11:\n return updateForwardRef(\n current,\n workInProgress,\n workInProgress.type,\n workInProgress.pendingProps,\n renderLanes\n );\n case 7:\n return (\n reconcileChildren(\n current,\n workInProgress,\n workInProgress.pendingProps,\n renderLanes\n ),\n workInProgress.child\n );\n case 8:\n return (\n reconcileChildren(\n current,\n workInProgress,\n workInProgress.pendingProps.children,\n renderLanes\n ),\n workInProgress.child\n );\n case 12:\n return (\n reconcileChildren(\n current,\n workInProgress,\n workInProgress.pendingProps.children,\n renderLanes\n ),\n workInProgress.child\n );\n case 10:\n return (\n (props = workInProgress.pendingProps),\n pushProvider(workInProgress, workInProgress.type, props.value),\n reconcileChildren(current, workInProgress, props.children, renderLanes),\n workInProgress.child\n );\n case 9:\n return (\n ($$typeof = workInProgress.type._context),\n (props = workInProgress.pendingProps.children),\n prepareToReadContext(workInProgress),\n ($$typeof = readContext($$typeof)),\n (props = props($$typeof)),\n (workInProgress.flags |= 1),\n reconcileChildren(current, workInProgress, props, renderLanes),\n workInProgress.child\n );\n case 14:\n return updateMemoComponent(\n current,\n workInProgress,\n workInProgress.type,\n workInProgress.pendingProps,\n renderLanes\n );\n case 15:\n return updateSimpleMemoComponent(\n current,\n workInProgress,\n workInProgress.type,\n workInProgress.pendingProps,\n renderLanes\n );\n case 19:\n return updateSuspenseListComponent(current, workInProgress, renderLanes);\n case 31:\n return updateActivityComponent(current, workInProgress, renderLanes);\n case 22:\n return updateOffscreenComponent(\n current,\n workInProgress,\n renderLanes,\n workInProgress.pendingProps\n );\n case 24:\n return (\n prepareToReadContext(workInProgress),\n (props = readContext(CacheContext)),\n null === current\n ? (($$typeof = peekCacheFromPool()),\n null === $$typeof &&\n (($$typeof = workInProgressRoot),\n (prevState = createCache()),\n ($$typeof.pooledCache = prevState),\n prevState.refCount++,\n null !== prevState && ($$typeof.pooledCacheLanes |= renderLanes),\n ($$typeof = prevState)),\n (workInProgress.memoizedState = { parent: props, cache: $$typeof }),\n initializeUpdateQueue(workInProgress),\n pushProvider(workInProgress, CacheContext, $$typeof))\n : (0 !== (current.lanes & renderLanes) &&\n (cloneUpdateQueue(current, workInProgress),\n processUpdateQueue(workInProgress, null, null, renderLanes),\n suspendIfUpdateReadFromEntangledAsyncAction()),\n ($$typeof = current.memoizedState),\n (prevState = workInProgress.memoizedState),\n $$typeof.parent !== props\n ? (($$typeof = { parent: props, cache: props }),\n (workInProgress.memoizedState = $$typeof),\n 0 === workInProgress.lanes &&\n (workInProgress.memoizedState =\n workInProgress.updateQueue.baseState =\n $$typeof),\n pushProvider(workInProgress, CacheContext, props))\n : ((props = prevState.cache),\n pushProvider(workInProgress, CacheContext, props),\n props !== $$typeof.cache &&\n propagateContextChanges(\n workInProgress,\n [CacheContext],\n renderLanes,\n !0\n ))),\n reconcileChildren(\n current,\n workInProgress,\n workInProgress.pendingProps.children,\n renderLanes\n ),\n workInProgress.child\n );\n case 29:\n throw workInProgress.pendingProps;\n }\n throw Error(formatProdErrorMessage(156, workInProgress.tag));\n}\nfunction markUpdate(workInProgress) {\n workInProgress.flags |= 4;\n}\nfunction preloadInstanceAndSuspendIfNeeded(\n workInProgress,\n type,\n oldProps,\n newProps,\n renderLanes\n) {\n if ((type = 0 !== (workInProgress.mode & 32))) type = !1;\n if (type) {\n if (\n ((workInProgress.flags |= 16777216),\n (renderLanes & 335544128) === renderLanes)\n )\n if (workInProgress.stateNode.complete) workInProgress.flags |= 8192;\n else if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192;\n else\n throw (\n ((suspendedThenable = noopSuspenseyCommitThenable),\n SuspenseyCommitException)\n );\n } else workInProgress.flags &= -16777217;\n}\nfunction preloadResourceAndSuspendIfNeeded(workInProgress, resource) {\n if (\"stylesheet\" !== resource.type || 0 !== (resource.state.loading & 4))\n workInProgress.flags &= -16777217;\n else if (((workInProgress.flags |= 16777216), !preloadResource(resource)))\n if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192;\n else\n throw (\n ((suspendedThenable = noopSuspenseyCommitThenable),\n SuspenseyCommitException)\n );\n}\nfunction scheduleRetryEffect(workInProgress, retryQueue) {\n null !== retryQueue && (workInProgress.flags |= 4);\n workInProgress.flags & 16384 &&\n ((retryQueue =\n 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912),\n (workInProgress.lanes |= retryQueue),\n (workInProgressSuspendedRetryLanes |= retryQueue));\n}\nfunction cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {\n if (!isHydrating)\n switch (renderState.tailMode) {\n case \"hidden\":\n hasRenderedATailFallback = renderState.tail;\n for (var lastTailNode = null; null !== hasRenderedATailFallback; )\n null !== hasRenderedATailFallback.alternate &&\n (lastTailNode = hasRenderedATailFallback),\n (hasRenderedATailFallback = hasRenderedATailFallback.sibling);\n null === lastTailNode\n ? (renderState.tail = null)\n : (lastTailNode.sibling = null);\n break;\n case \"collapsed\":\n lastTailNode = renderState.tail;\n for (var lastTailNode$106 = null; null !== lastTailNode; )\n null !== lastTailNode.alternate && (lastTailNode$106 = lastTailNode),\n (lastTailNode = lastTailNode.sibling);\n null === lastTailNode$106\n ? hasRenderedATailFallback || null === renderState.tail\n ? (renderState.tail = null)\n : (renderState.tail.sibling = null)\n : (lastTailNode$106.sibling = null);\n }\n}\nfunction bubbleProperties(completedWork) {\n var didBailout =\n null !== completedWork.alternate &&\n completedWork.alternate.child === completedWork.child,\n newChildLanes = 0,\n subtreeFlags = 0;\n if (didBailout)\n for (var child$107 = completedWork.child; null !== child$107; )\n (newChildLanes |= child$107.lanes | child$107.childLanes),\n (subtreeFlags |= child$107.subtreeFlags & 65011712),\n (subtreeFlags |= child$107.flags & 65011712),\n (child$107.return = completedWork),\n (child$107 = child$107.sibling);\n else\n for (child$107 = completedWork.child; null !== child$107; )\n (newChildLanes |= child$107.lanes | child$107.childLanes),\n (subtreeFlags |= child$107.subtreeFlags),\n (subtreeFlags |= child$107.flags),\n (child$107.return = completedWork),\n (child$107 = child$107.sibling);\n completedWork.subtreeFlags |= subtreeFlags;\n completedWork.childLanes = newChildLanes;\n return didBailout;\n}\nfunction completeWork(current, workInProgress, renderLanes) {\n var newProps = workInProgress.pendingProps;\n popTreeContext(workInProgress);\n switch (workInProgress.tag) {\n case 16:\n case 15:\n case 0:\n case 11:\n case 7:\n case 8:\n case 12:\n case 9:\n case 14:\n return bubbleProperties(workInProgress), null;\n case 1:\n return bubbleProperties(workInProgress), null;\n case 3:\n renderLanes = workInProgress.stateNode;\n newProps = null;\n null !== current && (newProps = current.memoizedState.cache);\n workInProgress.memoizedState.cache !== newProps &&\n (workInProgress.flags |= 2048);\n popProvider(CacheContext);\n popHostContainer();\n renderLanes.pendingContext &&\n ((renderLanes.context = renderLanes.pendingContext),\n (renderLanes.pendingContext = null));\n if (null === current || null === current.child)\n popHydrationState(workInProgress)\n ? markUpdate(workInProgress)\n : null === current ||\n (current.memoizedState.isDehydrated &&\n 0 === (workInProgress.flags & 256)) ||\n ((workInProgress.flags |= 1024),\n upgradeHydrationErrorsToRecoverable());\n bubbleProperties(workInProgress);\n return null;\n case 26:\n var type = workInProgress.type,\n nextResource = workInProgress.memoizedState;\n null === current\n ? (markUpdate(workInProgress),\n null !== nextResource\n ? (bubbleProperties(workInProgress),\n preloadResourceAndSuspendIfNeeded(workInProgress, nextResource))\n : (bubbleProperties(workInProgress),\n preloadInstanceAndSuspendIfNeeded(\n workInProgress,\n type,\n null,\n newProps,\n renderLanes\n )))\n : nextResource\n ? nextResource !== current.memoizedState\n ? (markUpdate(workInProgress),\n bubbleProperties(workInProgress),\n preloadResourceAndSuspendIfNeeded(workInProgress, nextResource))\n : (bubbleProperties(workInProgress),\n (workInProgress.flags &= -16777217))\n : ((current = current.memoizedProps),\n current !== newProps && markUpdate(workInProgress),\n bubbleProperties(workInProgress),\n preloadInstanceAndSuspendIfNeeded(\n workInProgress,\n type,\n current,\n newProps,\n renderLanes\n ));\n return null;\n case 27:\n popHostContext(workInProgress);\n renderLanes = rootInstanceStackCursor.current;\n type = workInProgress.type;\n if (null !== current && null != workInProgress.stateNode)\n current.memoizedProps !== newProps && markUpdate(workInProgress);\n else {\n if (!newProps) {\n if (null === workInProgress.stateNode)\n throw Error(formatProdErrorMessage(166));\n bubbleProperties(workInProgress);\n return null;\n }\n current = contextStackCursor.current;\n popHydrationState(workInProgress)\n ? prepareToHydrateHostInstance(workInProgress, current)\n : ((current = resolveSingletonInstance(type, newProps, renderLanes)),\n (workInProgress.stateNode = current),\n markUpdate(workInProgress));\n }\n bubbleProperties(workInProgress);\n return null;\n case 5:\n popHostContext(workInProgress);\n type = workInProgress.type;\n if (null !== current && null != workInProgress.stateNode)\n current.memoizedProps !== newProps && markUpdate(workInProgress);\n else {\n if (!newProps) {\n if (null === workInProgress.stateNode)\n throw Error(formatProdErrorMessage(166));\n bubbleProperties(workInProgress);\n return null;\n }\n nextResource = contextStackCursor.current;\n if (popHydrationState(workInProgress))\n prepareToHydrateHostInstance(workInProgress, nextResource);\n else {\n var ownerDocument = getOwnerDocumentFromRootContainer(\n rootInstanceStackCursor.current\n );\n switch (nextResource) {\n case 1:\n nextResource = ownerDocument.createElementNS(\n \"http://www.w3.org/2000/svg\",\n type\n );\n break;\n case 2:\n nextResource = ownerDocument.createElementNS(\n \"http://www.w3.org/1998/Math/MathML\",\n type\n );\n break;\n default:\n switch (type) {\n case \"svg\":\n nextResource = ownerDocument.createElementNS(\n \"http://www.w3.org/2000/svg\",\n type\n );\n break;\n case \"math\":\n nextResource = ownerDocument.createElementNS(\n \"http://www.w3.org/1998/Math/MathML\",\n type\n );\n break;\n case \"script\":\n nextResource = ownerDocument.createElement(\"div\");\n nextResource.innerHTML = \"\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationRawTagOpen(code) {\n if (code === 47) {\n effects.consume(code);\n buffer = '';\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In raw continuation, after ` | \n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function continuationRawEndTag(code) {\n if (code === 62) {\n const name = buffer.toLowerCase();\n if (htmlRawNames.includes(name)) {\n effects.consume(code);\n return continuationClose;\n }\n return continuation(code);\n }\n if (asciiAlpha(code) && buffer.length < 8) {\n // Always the case.\n effects.consume(code);\n buffer += String.fromCharCode(code);\n return continuationRawEndTag;\n }\n return continuation(code);\n }\n\n /**\n * In cdata continuation, after `]`, expecting `]>`.\n *\n * ```markdown\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationCdataInside(code) {\n if (code === 93) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In declaration or instruction continuation, at `>`.\n *\n * ```markdown\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | \n * ^\n * > | &<]]>\n * ^\n * ```\n *\n * @type {State}\n */\n function continuationDeclarationInside(code) {\n if (code === 62) {\n effects.consume(code);\n return continuationClose;\n }\n\n // More dashes.\n if (code === 45 && marker === 2) {\n effects.consume(code);\n return continuationDeclarationInside;\n }\n return continuation(code);\n }\n\n /**\n * In closed continuation: everything we get until the eol/eof is part of it.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationClose(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"htmlFlowData\");\n return continuationAfter(code);\n }\n effects.consume(code);\n return continuationClose;\n }\n\n /**\n * Done.\n *\n * ```markdown\n * > | \n * ^\n * ```\n *\n * @type {State}\n */\n function continuationAfter(code) {\n effects.exit(\"htmlFlow\");\n // // Feel free to interrupt.\n // tokenizer.interrupt = false\n // // No longer concrete.\n // tokenizer.concrete = false\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeNonLazyContinuationStart(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * At eol, before continuation.\n *\n * ```markdown\n * > | * ```js\n * ^\n * | b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * A continuation.\n *\n * ```markdown\n * | * ```js\n * > | b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n return self.parser.lazy[self.now().line] ? nok(code) : ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeBlankLineBefore(effects, ok, nok) {\n return start;\n\n /**\n * Before eol, expecting blank line.\n *\n * ```markdown\n * > |
\n * ^\n * |\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return effects.attempt(blankLine, ok, nok);\n }\n}", "/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiAlphanumeric, asciiAlpha, markdownLineEndingOrSpace, markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const htmlText = {\n name: 'htmlText',\n tokenize: tokenizeHtmlText\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeHtmlText(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable | undefined} */\n let marker;\n /** @type {number} */\n let index;\n /** @type {State} */\n let returnState;\n return start;\n\n /**\n * Start of HTML (text).\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"htmlText\");\n effects.enter(\"htmlTextData\");\n effects.consume(code);\n return open;\n }\n\n /**\n * After `<`, at tag name or other stuff.\n *\n * ```markdown\n * > | a c\n * ^\n * > | a c\n * ^\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 33) {\n effects.consume(code);\n return declarationOpen;\n }\n if (code === 47) {\n effects.consume(code);\n return tagCloseStart;\n }\n if (code === 63) {\n effects.consume(code);\n return instruction;\n }\n\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagOpen;\n }\n return nok(code);\n }\n\n /**\n * After ` | a c\n * ^\n * > | a c\n * ^\n * > | a &<]]> c\n * ^\n * ```\n *\n * @type {State}\n */\n function declarationOpen(code) {\n if (code === 45) {\n effects.consume(code);\n return commentOpenInside;\n }\n if (code === 91) {\n effects.consume(code);\n index = 0;\n return cdataOpenInside;\n }\n if (asciiAlpha(code)) {\n effects.consume(code);\n return declaration;\n }\n return nok(code);\n }\n\n /**\n * In a comment, after ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentOpenInside(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return nok(code);\n }\n\n /**\n * In comment.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function comment(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 45) {\n effects.consume(code);\n return commentClose;\n }\n if (markdownLineEnding(code)) {\n returnState = comment;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return comment;\n }\n\n /**\n * In comment, after `-`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentClose(code) {\n if (code === 45) {\n effects.consume(code);\n return commentEnd;\n }\n return comment(code);\n }\n\n /**\n * In comment, after `--`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function commentEnd(code) {\n return code === 62 ? end(code) : code === 45 ? commentClose(code) : comment(code);\n }\n\n /**\n * After ` | a &<]]> b\n * ^^^^^^\n * ```\n *\n * @type {State}\n */\n function cdataOpenInside(code) {\n const value = \"CDATA[\";\n if (code === value.charCodeAt(index++)) {\n effects.consume(code);\n return index === value.length ? cdata : cdataOpenInside;\n }\n return nok(code);\n }\n\n /**\n * In CDATA.\n *\n * ```markdown\n * > | a &<]]> b\n * ^^^\n * ```\n *\n * @type {State}\n */\n function cdata(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataClose;\n }\n if (markdownLineEnding(code)) {\n returnState = cdata;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return cdata;\n }\n\n /**\n * In CDATA, after `]`, at another `]`.\n *\n * ```markdown\n * > | a &<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataClose(code) {\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In CDATA, after `]]`, at `>`.\n *\n * ```markdown\n * > | a &<]]> b\n * ^\n * ```\n *\n * @type {State}\n */\n function cdataEnd(code) {\n if (code === 62) {\n return end(code);\n }\n if (code === 93) {\n effects.consume(code);\n return cdataEnd;\n }\n return cdata(code);\n }\n\n /**\n * In declaration.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function declaration(code) {\n if (code === null || code === 62) {\n return end(code);\n }\n if (markdownLineEnding(code)) {\n returnState = declaration;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return declaration;\n }\n\n /**\n * In instruction.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function instruction(code) {\n if (code === null) {\n return nok(code);\n }\n if (code === 63) {\n effects.consume(code);\n return instructionClose;\n }\n if (markdownLineEnding(code)) {\n returnState = instruction;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return instruction;\n }\n\n /**\n * In instruction, after `?`, at `>`.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function instructionClose(code) {\n return code === 62 ? end(code) : instruction(code);\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseStart(code) {\n // ASCII alphabetical.\n if (asciiAlpha(code)) {\n effects.consume(code);\n return tagClose;\n }\n return nok(code);\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagClose(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagClose;\n }\n return tagCloseBetween(code);\n }\n\n /**\n * In closing tag, after tag name.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagCloseBetween(code) {\n if (markdownLineEnding(code)) {\n returnState = tagCloseBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagCloseBetween;\n }\n return end(code);\n }\n\n /**\n * After ` | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpen(code) {\n // ASCII alphanumerical and `-`.\n if (code === 45 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpen;\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In opening tag, after tag name.\n *\n * ```markdown\n * > | a c\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenBetween(code) {\n if (code === 47) {\n effects.consume(code);\n return end;\n }\n\n // ASCII alphabetical and `:` and `_`.\n if (code === 58 || code === 95 || asciiAlpha(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenBetween;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenBetween;\n }\n return end(code);\n }\n\n /**\n * In attribute name.\n *\n * ```markdown\n * > | a d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeName(code) {\n // ASCII alphabetical and `-`, `.`, `:`, and `_`.\n if (code === 45 || code === 46 || code === 58 || code === 95 || asciiAlphanumeric(code)) {\n effects.consume(code);\n return tagOpenAttributeName;\n }\n return tagOpenAttributeNameAfter(code);\n }\n\n /**\n * After attribute name, before initializer, the end of the tag, or\n * whitespace.\n *\n * ```markdown\n * > | a d\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeNameAfter(code) {\n if (code === 61) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeNameAfter;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeNameAfter;\n }\n return tagOpenBetween(code);\n }\n\n /**\n * Before unquoted, double quoted, or single quoted attribute value, allowing\n * whitespace.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueBefore(code) {\n if (code === null || code === 60 || code === 61 || code === 62 || code === 96) {\n return nok(code);\n }\n if (code === 34 || code === 39) {\n effects.consume(code);\n marker = code;\n return tagOpenAttributeValueQuoted;\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueBefore;\n return lineEndingBefore(code);\n }\n if (markdownSpace(code)) {\n effects.consume(code);\n return tagOpenAttributeValueBefore;\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * In double or single quoted attribute value.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuoted(code) {\n if (code === marker) {\n effects.consume(code);\n marker = undefined;\n return tagOpenAttributeValueQuotedAfter;\n }\n if (code === null) {\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n returnState = tagOpenAttributeValueQuoted;\n return lineEndingBefore(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueQuoted;\n }\n\n /**\n * In unquoted attribute value.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueUnquoted(code) {\n if (code === null || code === 34 || code === 39 || code === 60 || code === 61 || code === 96) {\n return nok(code);\n }\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n effects.consume(code);\n return tagOpenAttributeValueUnquoted;\n }\n\n /**\n * After double or single quoted attribute value, before whitespace or the end\n * of the tag.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function tagOpenAttributeValueQuotedAfter(code) {\n if (code === 47 || code === 62 || markdownLineEndingOrSpace(code)) {\n return tagOpenBetween(code);\n }\n return nok(code);\n }\n\n /**\n * In certain circumstances of a tag where only an `>` is allowed.\n *\n * ```markdown\n * > | a e\n * ^\n * ```\n *\n * @type {State}\n */\n function end(code) {\n if (code === 62) {\n effects.consume(code);\n effects.exit(\"htmlTextData\");\n effects.exit(\"htmlText\");\n return ok;\n }\n return nok(code);\n }\n\n /**\n * At eol.\n *\n * > \uD83D\uDC49 **Note**: we can\u2019t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * > | a \n * ```\n *\n * @type {State}\n */\n function lineEndingBefore(code) {\n effects.exit(\"htmlTextData\");\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return lineEndingAfter;\n }\n\n /**\n * After eol, at optional whitespace.\n *\n * > \uD83D\uDC49 **Note**: we can\u2019t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a \n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfter(code) {\n // Always populated by defaults.\n\n return markdownSpace(code) ? factorySpace(effects, lineEndingAfterPrefix, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code) : lineEndingAfterPrefix(code);\n }\n\n /**\n * After eol, after optional whitespace.\n *\n * > \uD83D\uDC49 **Note**: we can\u2019t have blank lines in text, so no need to worry about\n * > empty tokens.\n *\n * ```markdown\n * | a \n * ^\n * ```\n *\n * @type {State}\n */\n function lineEndingAfterPrefix(code) {\n effects.enter(\"htmlTextData\");\n return returnState(code);\n }\n}", "/**\n * @import {\n * Construct,\n * Event,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer,\n * Token\n * } from 'micromark-util-types'\n */\n\nimport { factoryDestination } from 'micromark-factory-destination';\nimport { factoryLabel } from 'micromark-factory-label';\nimport { factoryTitle } from 'micromark-factory-title';\nimport { factoryWhitespace } from 'micromark-factory-whitespace';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/** @type {Construct} */\nexport const labelEnd = {\n name: 'labelEnd',\n resolveAll: resolveAllLabelEnd,\n resolveTo: resolveToLabelEnd,\n tokenize: tokenizeLabelEnd\n};\n\n/** @type {Construct} */\nconst resourceConstruct = {\n tokenize: tokenizeResource\n};\n/** @type {Construct} */\nconst referenceFullConstruct = {\n tokenize: tokenizeReferenceFull\n};\n/** @type {Construct} */\nconst referenceCollapsedConstruct = {\n tokenize: tokenizeReferenceCollapsed\n};\n\n/** @type {Resolver} */\nfunction resolveAllLabelEnd(events) {\n let index = -1;\n /** @type {Array} */\n const newEvents = [];\n while (++index < events.length) {\n const token = events[index][1];\n newEvents.push(events[index]);\n if (token.type === \"labelImage\" || token.type === \"labelLink\" || token.type === \"labelEnd\") {\n // Remove the marker.\n const offset = token.type === \"labelImage\" ? 4 : 2;\n token.type = \"data\";\n index += offset;\n }\n }\n\n // If the events are equal, we don't have to copy newEvents to events\n if (events.length !== newEvents.length) {\n splice(events, 0, events.length, newEvents);\n }\n return events;\n}\n\n/** @type {Resolver} */\nfunction resolveToLabelEnd(events, context) {\n let index = events.length;\n let offset = 0;\n /** @type {Token} */\n let token;\n /** @type {number | undefined} */\n let open;\n /** @type {number | undefined} */\n let close;\n /** @type {Array} */\n let media;\n\n // Find an opening.\n while (index--) {\n token = events[index][1];\n if (open) {\n // If we see another link, or inactive link label, we\u2019ve been here before.\n if (token.type === \"link\" || token.type === \"labelLink\" && token._inactive) {\n break;\n }\n\n // Mark other link openings as inactive, as we can\u2019t have links in\n // links.\n if (events[index][0] === 'enter' && token.type === \"labelLink\") {\n token._inactive = true;\n }\n } else if (close) {\n if (events[index][0] === 'enter' && (token.type === \"labelImage\" || token.type === \"labelLink\") && !token._balanced) {\n open = index;\n if (token.type !== \"labelLink\") {\n offset = 2;\n break;\n }\n }\n } else if (token.type === \"labelEnd\") {\n close = index;\n }\n }\n const group = {\n type: events[open][1].type === \"labelLink\" ? \"link\" : \"image\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n const label = {\n type: \"label\",\n start: {\n ...events[open][1].start\n },\n end: {\n ...events[close][1].end\n }\n };\n const text = {\n type: \"labelText\",\n start: {\n ...events[open + offset + 2][1].end\n },\n end: {\n ...events[close - 2][1].start\n }\n };\n media = [['enter', group, context], ['enter', label, context]];\n\n // Opening marker.\n media = push(media, events.slice(open + 1, open + offset + 3));\n\n // Text open.\n media = push(media, [['enter', text, context]]);\n\n // Always populated by defaults.\n\n // Between.\n media = push(media, resolveAll(context.parser.constructs.insideSpan.null, events.slice(open + offset + 4, close - 3), context));\n\n // Text close, marker close, label close.\n media = push(media, [['exit', text, context], events[close - 2], events[close - 1], ['exit', label, context]]);\n\n // Reference, resource, or so.\n media = push(media, events.slice(close + 1));\n\n // Media close.\n media = push(media, [['exit', group, context]]);\n splice(events, open, events.length, media);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelEnd(effects, ok, nok) {\n const self = this;\n let index = self.events.length;\n /** @type {Token} */\n let labelStart;\n /** @type {boolean} */\n let defined;\n\n // Find an opening.\n while (index--) {\n if ((self.events[index][1].type === \"labelImage\" || self.events[index][1].type === \"labelLink\") && !self.events[index][1]._balanced) {\n labelStart = self.events[index][1];\n break;\n }\n }\n return start;\n\n /**\n * Start of label end.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // If there is not an okay opening.\n if (!labelStart) {\n return nok(code);\n }\n\n // If the corresponding label (link) start is marked as inactive,\n // it means we\u2019d be wrapping a link, like this:\n //\n // ```markdown\n // > | a [b [c](d) e](f) g.\n // ^\n // ```\n //\n // We can\u2019t have that, so it\u2019s just balanced brackets.\n if (labelStart._inactive) {\n return labelEndNok(code);\n }\n defined = self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })));\n effects.enter(\"labelEnd\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelEnd\");\n return after;\n }\n\n /**\n * After `]`.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Note: `markdown-rs` also parses GFM footnotes here, which for us is in\n // an extension.\n\n // Resource (`[asd](fgh)`)?\n if (code === 40) {\n return effects.attempt(resourceConstruct, labelEndOk, defined ? labelEndOk : labelEndNok)(code);\n }\n\n // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference?\n if (code === 91) {\n return effects.attempt(referenceFullConstruct, labelEndOk, defined ? referenceNotFull : labelEndNok)(code);\n }\n\n // Shortcut (`[asd]`) reference?\n return defined ? labelEndOk(code) : labelEndNok(code);\n }\n\n /**\n * After `]`, at `[`, but not at a full reference.\n *\n * > \uD83D\uDC49 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceNotFull(code) {\n return effects.attempt(referenceCollapsedConstruct, labelEndOk, labelEndNok)(code);\n }\n\n /**\n * Done, we found something.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * > | [a][b] c\n * ^\n * > | [a][] b\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndOk(code) {\n // Note: `markdown-rs` does a bunch of stuff here.\n return ok(code);\n }\n\n /**\n * Done, it\u2019s nothing.\n *\n * There was an okay opening, but we didn\u2019t match anything.\n *\n * ```markdown\n * > | [a](b c\n * ^\n * > | [a][b c\n * ^\n * > | [a] b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEndNok(code) {\n labelStart._balanced = true;\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeResource(effects, ok, nok) {\n return resourceStart;\n\n /**\n * At a resource.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceStart(code) {\n effects.enter(\"resource\");\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n return resourceBefore;\n }\n\n /**\n * In resource, after `(`, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBefore(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceOpen)(code) : resourceOpen(code);\n }\n\n /**\n * In resource, after optional whitespace, at `)` or a destination.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceOpen(code) {\n if (code === 41) {\n return resourceEnd(code);\n }\n return factoryDestination(effects, resourceDestinationAfter, resourceDestinationMissing, \"resourceDestination\", \"resourceDestinationLiteral\", \"resourceDestinationLiteralMarker\", \"resourceDestinationRaw\", \"resourceDestinationString\", 32)(code);\n }\n\n /**\n * In resource, after destination, at optional whitespace.\n *\n * ```markdown\n * > | [a](b) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceBetween)(code) : resourceEnd(code);\n }\n\n /**\n * At invalid destination.\n *\n * ```markdown\n * > | [a](<<) b\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceDestinationMissing(code) {\n return nok(code);\n }\n\n /**\n * In resource, after destination and whitespace, at `(` or title.\n *\n * ```markdown\n * > | [a](b ) c\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceBetween(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(effects, resourceTitleAfter, nok, \"resourceTitle\", \"resourceTitleMarker\", \"resourceTitleString\")(code);\n }\n return resourceEnd(code);\n }\n\n /**\n * In resource, after title, at optional whitespace.\n *\n * ```markdown\n * > | [a](b \"c\") d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceTitleAfter(code) {\n return markdownLineEndingOrSpace(code) ? factoryWhitespace(effects, resourceEnd)(code) : resourceEnd(code);\n }\n\n /**\n * In resource, at `)`.\n *\n * ```markdown\n * > | [a](b) d\n * ^\n * ```\n *\n * @type {State}\n */\n function resourceEnd(code) {\n if (code === 41) {\n effects.enter(\"resourceMarker\");\n effects.consume(code);\n effects.exit(\"resourceMarker\");\n effects.exit(\"resource\");\n return ok;\n }\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceFull(effects, ok, nok) {\n const self = this;\n return referenceFull;\n\n /**\n * In a reference (full), at the `[`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFull(code) {\n return factoryLabel.call(self, effects, referenceFullAfter, referenceFullMissing, \"reference\", \"referenceMarker\", \"referenceString\")(code);\n }\n\n /**\n * In a reference (full), after `]`.\n *\n * ```markdown\n * > | [a][b] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullAfter(code) {\n return self.parser.defined.includes(normalizeIdentifier(self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1))) ? ok(code) : nok(code);\n }\n\n /**\n * In reference (full) that was missing.\n *\n * ```markdown\n * > | [a][b d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceFullMissing(code) {\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeReferenceCollapsed(effects, ok, nok) {\n return referenceCollapsedStart;\n\n /**\n * In reference (collapsed), at `[`.\n *\n * > \uD83D\uDC49 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedStart(code) {\n // We only attempt a collapsed label if there\u2019s a `[`.\n\n effects.enter(\"reference\");\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n return referenceCollapsedOpen;\n }\n\n /**\n * In reference (collapsed), at `]`.\n *\n * > \uD83D\uDC49 **Note**: we only get here if the label is defined.\n *\n * ```markdown\n * > | [a][] d\n * ^\n * ```\n *\n * @type {State}\n */\n function referenceCollapsedOpen(code) {\n if (code === 93) {\n effects.enter(\"referenceMarker\");\n effects.consume(code);\n effects.exit(\"referenceMarker\");\n effects.exit(\"reference\");\n return ok;\n }\n return nok(code);\n }\n}", "/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartImage = {\n name: 'labelStartImage',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartImage\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartImage(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * Start of label (image) start.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelImage\");\n effects.enter(\"labelImageMarker\");\n effects.consume(code);\n effects.exit(\"labelImageMarker\");\n return open;\n }\n\n /**\n * After `!`, at `[`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (code === 91) {\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelImage\");\n return after;\n }\n return nok(code);\n }\n\n /**\n * After `![`.\n *\n * ```markdown\n * > | a ![b] c\n * ^\n * ```\n *\n * This is needed in because, when GFM footnotes are enabled, images never\n * form when started with a `^`.\n * Instead, links form:\n *\n * ```markdown\n * ![^a](b)\n *\n * ![^a][b]\n *\n * [b]: c\n * ```\n *\n * ```html\n *

!^a

\n *

!^a

\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // To do: use a new field to do this, this is still needed for\n // `micromark-extension-gfm-footnote`, but the `label-start-link`\n // behavior isn\u2019t.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code);\n }\n}", "/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { labelEnd } from './label-end.js';\n\n/** @type {Construct} */\nexport const labelStartLink = {\n name: 'labelStartLink',\n resolveAll: labelEnd.resolveAll,\n tokenize: tokenizeLabelStartLink\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLabelStartLink(effects, ok, nok) {\n const self = this;\n return start;\n\n /**\n * Start of label (link) start.\n *\n * ```markdown\n * > | a [b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"labelLink\");\n effects.enter(\"labelMarker\");\n effects.consume(code);\n effects.exit(\"labelMarker\");\n effects.exit(\"labelLink\");\n return after;\n }\n\n /** @type {State} */\n function after(code) {\n // To do: this isn\u2019t needed in `micromark-extension-gfm-footnote`,\n // remove.\n // Hidden footnotes hook.\n /* c8 ignore next 3 */\n return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code);\n }\n}", "/**\n * @import {\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {Construct} */\nexport const lineEnding = {\n name: 'lineEnding',\n tokenize: tokenizeLineEnding\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeLineEnding(effects, ok) {\n return start;\n\n /** @type {State} */\n function start(code) {\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return factorySpace(effects, ok, \"linePrefix\");\n }\n}", "/**\n * @import {\n * Code,\n * Construct,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const thematicBreak = {\n name: 'thematicBreak',\n tokenize: tokenizeThematicBreak\n};\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeThematicBreak(effects, ok, nok) {\n let size = 0;\n /** @type {NonNullable} */\n let marker;\n return start;\n\n /**\n * Start of thematic break.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter(\"thematicBreak\");\n // To do: parse indent like `markdown-rs`.\n return before(code);\n }\n\n /**\n * After optional whitespace, at marker.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n marker = code;\n return atBreak(code);\n }\n\n /**\n * After something, before something else.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function atBreak(code) {\n if (code === marker) {\n effects.enter(\"thematicBreakSequence\");\n return sequence(code);\n }\n if (size >= 3 && (code === null || markdownLineEnding(code))) {\n effects.exit(\"thematicBreak\");\n return ok(code);\n }\n return nok(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * > | ***\n * ^\n * ```\n *\n * @type {State}\n */\n function sequence(code) {\n if (code === marker) {\n effects.consume(code);\n size++;\n return sequence;\n }\n effects.exit(\"thematicBreakSequence\");\n return markdownSpace(code) ? factorySpace(effects, atBreak, \"whitespace\")(code) : atBreak(code);\n }\n}", "/**\n * @import {\n * Code,\n * Construct,\n * Exiter,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { asciiDigit, markdownSpace } from 'micromark-util-character';\nimport { blankLine } from './blank-line.js';\nimport { thematicBreak } from './thematic-break.js';\n\n/** @type {Construct} */\nexport const list = {\n continuation: {\n tokenize: tokenizeListContinuation\n },\n exit: tokenizeListEnd,\n name: 'list',\n tokenize: tokenizeListStart\n};\n\n/** @type {Construct} */\nconst listItemPrefixWhitespaceConstruct = {\n partial: true,\n tokenize: tokenizeListItemPrefixWhitespace\n};\n\n/** @type {Construct} */\nconst indentConstruct = {\n partial: true,\n tokenize: tokenizeIndent\n};\n\n// To do: `markdown-rs` parses list items on their own and later stitches them\n// together.\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListStart(effects, ok, nok) {\n const self = this;\n const tail = self.events[self.events.length - 1];\n let initialSize = tail && tail[1].type === \"linePrefix\" ? tail[2].sliceSerialize(tail[1], true).length : 0;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n const kind = self.containerState.type || (code === 42 || code === 43 || code === 45 ? \"listUnordered\" : \"listOrdered\");\n if (kind === \"listUnordered\" ? !self.containerState.marker || code === self.containerState.marker : asciiDigit(code)) {\n if (!self.containerState.type) {\n self.containerState.type = kind;\n effects.enter(kind, {\n _container: true\n });\n }\n if (kind === \"listUnordered\") {\n effects.enter(\"listItemPrefix\");\n return code === 42 || code === 45 ? effects.check(thematicBreak, nok, atMarker)(code) : atMarker(code);\n }\n if (!self.interrupt || code === 49) {\n effects.enter(\"listItemPrefix\");\n effects.enter(\"listItemValue\");\n return inside(code);\n }\n }\n return nok(code);\n }\n\n /** @type {State} */\n function inside(code) {\n if (asciiDigit(code) && ++size < 10) {\n effects.consume(code);\n return inside;\n }\n if ((!self.interrupt || size < 2) && (self.containerState.marker ? code === self.containerState.marker : code === 41 || code === 46)) {\n effects.exit(\"listItemValue\");\n return atMarker(code);\n }\n return nok(code);\n }\n\n /**\n * @type {State}\n **/\n function atMarker(code) {\n effects.enter(\"listItemMarker\");\n effects.consume(code);\n effects.exit(\"listItemMarker\");\n self.containerState.marker = self.containerState.marker || code;\n return effects.check(blankLine,\n // Can\u2019t be empty when interrupting.\n self.interrupt ? nok : onBlank, effects.attempt(listItemPrefixWhitespaceConstruct, endOfPrefix, otherPrefix));\n }\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.initialBlankLine = true;\n initialSize++;\n return endOfPrefix(code);\n }\n\n /** @type {State} */\n function otherPrefix(code) {\n if (markdownSpace(code)) {\n effects.enter(\"listItemPrefixWhitespace\");\n effects.consume(code);\n effects.exit(\"listItemPrefixWhitespace\");\n return endOfPrefix;\n }\n return nok(code);\n }\n\n /** @type {State} */\n function endOfPrefix(code) {\n self.containerState.size = initialSize + self.sliceSerialize(effects.exit(\"listItemPrefix\"), true).length;\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListContinuation(effects, ok, nok) {\n const self = this;\n self.containerState._closeFlow = undefined;\n return effects.check(blankLine, onBlank, notBlank);\n\n /** @type {State} */\n function onBlank(code) {\n self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine;\n\n // We have a blank line.\n // Still, try to consume at most the items size.\n return factorySpace(effects, ok, \"listItemIndent\", self.containerState.size + 1)(code);\n }\n\n /** @type {State} */\n function notBlank(code) {\n if (self.containerState.furtherBlankLines || !markdownSpace(code)) {\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return notInCurrentItem(code);\n }\n self.containerState.furtherBlankLines = undefined;\n self.containerState.initialBlankLine = undefined;\n return effects.attempt(indentConstruct, ok, notInCurrentItem)(code);\n }\n\n /** @type {State} */\n function notInCurrentItem(code) {\n // While we do continue, we signal that the flow should be closed.\n self.containerState._closeFlow = true;\n // As we\u2019re closing flow, we\u2019re no longer interrupting.\n self.interrupt = undefined;\n // Always populated by defaults.\n\n return factorySpace(effects, effects.attempt(list, ok, nok), \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, \"listItemIndent\", self.containerState.size + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === \"listItemIndent\" && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok(code) : nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Exiter}\n */\nfunction tokenizeListEnd(effects) {\n effects.exit(this.containerState.type);\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeListItemPrefixWhitespace(effects, ok, nok) {\n const self = this;\n\n // Always populated by defaults.\n\n return factorySpace(effects, afterPrefix, \"listItemPrefixWhitespace\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4 + 1);\n\n /** @type {State} */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return !markdownSpace(code) && tail && tail[1].type === \"listItemPrefixWhitespace\" ? ok(code) : nok(code);\n }\n}", "/**\n * @import {\n * Code,\n * Construct,\n * Resolver,\n * State,\n * TokenizeContext,\n * Tokenizer\n * } from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownSpace } from 'micromark-util-character';\n/** @type {Construct} */\nexport const setextUnderline = {\n name: 'setextUnderline',\n resolveTo: resolveToSetextUnderline,\n tokenize: tokenizeSetextUnderline\n};\n\n/** @type {Resolver} */\nfunction resolveToSetextUnderline(events, context) {\n // To do: resolve like `markdown-rs`.\n let index = events.length;\n /** @type {number | undefined} */\n let content;\n /** @type {number | undefined} */\n let text;\n /** @type {number | undefined} */\n let definition;\n\n // Find the opening of the content.\n // It\u2019ll always exist: we don\u2019t tokenize if it isn\u2019t there.\n while (index--) {\n if (events[index][0] === 'enter') {\n if (events[index][1].type === \"content\") {\n content = index;\n break;\n }\n if (events[index][1].type === \"paragraph\") {\n text = index;\n }\n }\n // Exit\n else {\n if (events[index][1].type === \"content\") {\n // Remove the content end (if needed we\u2019ll add it later)\n events.splice(index, 1);\n }\n if (!definition && events[index][1].type === \"definition\") {\n definition = index;\n }\n }\n }\n const heading = {\n type: \"setextHeading\",\n start: {\n ...events[content][1].start\n },\n end: {\n ...events[events.length - 1][1].end\n }\n };\n\n // Change the paragraph to setext heading text.\n events[text][1].type = \"setextHeadingText\";\n\n // If we have definitions in the content, we\u2019ll keep on having content,\n // but we need move it.\n if (definition) {\n events.splice(text, 0, ['enter', heading, context]);\n events.splice(definition + 1, 0, ['exit', events[content][1], context]);\n events[content][1].end = {\n ...events[definition][1].end\n };\n } else {\n events[content][1] = heading;\n }\n\n // Add the heading exit at the end.\n events.push(['exit', heading, context]);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * Context.\n * @type {Tokenizer}\n */\nfunction tokenizeSetextUnderline(effects, ok, nok) {\n const self = this;\n /** @type {NonNullable} */\n let marker;\n return start;\n\n /**\n * At start of heading (setext) underline.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n let index = self.events.length;\n /** @type {boolean | undefined} */\n let paragraph;\n // Find an opening.\n while (index--) {\n // Skip enter/exit of line ending, line prefix, and content.\n // We can now either have a definition or a paragraph.\n if (self.events[index][1].type !== \"lineEnding\" && self.events[index][1].type !== \"linePrefix\" && self.events[index][1].type !== \"content\") {\n paragraph = self.events[index][1].type === \"paragraph\";\n break;\n }\n }\n\n // To do: handle lazy/pierce like `markdown-rs`.\n // To do: parse indent like `markdown-rs`.\n if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {\n effects.enter(\"setextHeadingLine\");\n marker = code;\n return before(code);\n }\n return nok(code);\n }\n\n /**\n * After optional whitespace, at `-` or `=`.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function before(code) {\n effects.enter(\"setextHeadingLineSequence\");\n return inside(code);\n }\n\n /**\n * In sequence.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n if (code === marker) {\n effects.consume(code);\n return inside;\n }\n effects.exit(\"setextHeadingLineSequence\");\n return markdownSpace(code) ? factorySpace(effects, after, \"lineSuffix\")(code) : after(code);\n }\n\n /**\n * After sequence, after optional whitespace.\n *\n * ```markdown\n * | aa\n * > | ==\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n if (code === null || markdownLineEnding(code)) {\n effects.exit(\"setextHeadingLine\");\n return ok(code);\n }\n return nok(code);\n }\n}", "/**\n * @import {\n * InitialConstruct,\n * Initializer,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nimport { blankLine, content } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding } from 'micromark-util-character';\n/** @type {InitialConstruct} */\nexport const flow = {\n tokenize: initializeFlow\n};\n\n/**\n * @this {TokenizeContext}\n * Self.\n * @type {Initializer}\n * Initializer.\n */\nfunction initializeFlow(effects) {\n const self = this;\n const initial = effects.attempt(\n // Try to parse a blank line.\n blankLine, atBlankEnding,\n // Try to parse initial flow (essentially, only code).\n effects.attempt(this.parser.constructs.flowInitial, afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content, afterConstruct)), \"linePrefix\")));\n return initial;\n\n /** @type {State} */\n function atBlankEnding(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEndingBlank\");\n effects.consume(code);\n effects.exit(\"lineEndingBlank\");\n self.currentConstruct = undefined;\n return initial;\n }\n\n /** @type {State} */\n function afterConstruct(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n self.currentConstruct = undefined;\n return initial;\n }\n}", "/**\n * @import {\n * Code,\n * InitialConstruct,\n * Initializer,\n * Resolver,\n * State,\n * TokenizeContext\n * } from 'micromark-util-types'\n */\n\nexport const resolver = {\n resolveAll: createResolver()\n};\nexport const string = initializeFactory('string');\nexport const text = initializeFactory('text');\n\n/**\n * @param {'string' | 'text'} field\n * Field.\n * @returns {InitialConstruct}\n * Construct.\n */\nfunction initializeFactory(field) {\n return {\n resolveAll: createResolver(field === 'text' ? resolveAllLineSuffixes : undefined),\n tokenize: initializeText\n };\n\n /**\n * @this {TokenizeContext}\n * Context.\n * @type {Initializer}\n */\n function initializeText(effects) {\n const self = this;\n const constructs = this.parser.constructs[field];\n const text = effects.attempt(constructs, start, notText);\n return start;\n\n /** @type {State} */\n function start(code) {\n return atBreak(code) ? text(code) : notText(code);\n }\n\n /** @type {State} */\n function notText(code) {\n if (code === null) {\n effects.consume(code);\n return;\n }\n effects.enter(\"data\");\n effects.consume(code);\n return data;\n }\n\n /** @type {State} */\n function data(code) {\n if (atBreak(code)) {\n effects.exit(\"data\");\n return text(code);\n }\n\n // Data.\n effects.consume(code);\n return data;\n }\n\n /**\n * @param {Code} code\n * Code.\n * @returns {boolean}\n * Whether the code is a break.\n */\n function atBreak(code) {\n if (code === null) {\n return true;\n }\n const list = constructs[code];\n let index = -1;\n if (list) {\n // Always populated by defaults.\n\n while (++index < list.length) {\n const item = list[index];\n if (!item.previous || item.previous.call(self, self.previous)) {\n return true;\n }\n }\n }\n return false;\n }\n }\n}\n\n/**\n * @param {Resolver | undefined} [extraResolver]\n * Resolver.\n * @returns {Resolver}\n * Resolver.\n */\nfunction createResolver(extraResolver) {\n return resolveAllText;\n\n /** @type {Resolver} */\n function resolveAllText(events, context) {\n let index = -1;\n /** @type {number | undefined} */\n let enter;\n\n // A rather boring computation (to merge adjacent `data` events) which\n // improves mm performance by 29%.\n while (++index <= events.length) {\n if (enter === undefined) {\n if (events[index] && events[index][1].type === \"data\") {\n enter = index;\n index++;\n }\n } else if (!events[index] || events[index][1].type !== \"data\") {\n // Don\u2019t do anything if there is one data token.\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end;\n events.splice(enter + 2, index - enter - 2);\n index = enter + 2;\n }\n enter = undefined;\n }\n }\n return extraResolver ? extraResolver(events, context) : events;\n }\n}\n\n/**\n * A rather ugly set of instructions which again looks at chunks in the input\n * stream.\n * The reason to do this here is that it is *much* faster to parse in reverse.\n * And that we can\u2019t hook into `null` to split the line suffix before an EOF.\n * To do: figure out if we can make this into a clean utility, or even in core.\n * As it will be useful for GFMs literal autolink extension (and maybe even\n * tables?)\n *\n * @type {Resolver}\n */\nfunction resolveAllLineSuffixes(events, context) {\n let eventIndex = 0; // Skip first.\n\n while (++eventIndex <= events.length) {\n if ((eventIndex === events.length || events[eventIndex][1].type === \"lineEnding\") && events[eventIndex - 1][1].type === \"data\") {\n const data = events[eventIndex - 1][1];\n const chunks = context.sliceStream(data);\n let index = chunks.length;\n let bufferIndex = -1;\n let size = 0;\n /** @type {boolean | undefined} */\n let tabs;\n while (index--) {\n const chunk = chunks[index];\n if (typeof chunk === 'string') {\n bufferIndex = chunk.length;\n while (chunk.charCodeAt(bufferIndex - 1) === 32) {\n size++;\n bufferIndex--;\n }\n if (bufferIndex) break;\n bufferIndex = -1;\n }\n // Number\n else if (chunk === -2) {\n tabs = true;\n size++;\n } else if (chunk === -1) {\n // Empty\n } else {\n // Replacement character, exit.\n index++;\n break;\n }\n }\n\n // Allow final trailing whitespace.\n if (context._contentTypeTextTrailing && eventIndex === events.length) {\n size = 0;\n }\n if (size) {\n const token = {\n type: eventIndex === events.length || tabs || size < 2 ? \"lineSuffix\" : \"hardBreakTrailing\",\n start: {\n _bufferIndex: index ? bufferIndex : data.start._bufferIndex + bufferIndex,\n _index: data.start._index + index,\n line: data.end.line,\n column: data.end.column - size,\n offset: data.end.offset - size\n },\n end: {\n ...data.end\n }\n };\n data.end = {\n ...token.start\n };\n if (data.start.offset === data.end.offset) {\n Object.assign(data, token);\n } else {\n events.splice(eventIndex, 0, ['enter', token, context], ['exit', token, context]);\n eventIndex += 2;\n }\n }\n eventIndex++;\n }\n }\n return events;\n}", "/**\n * @import {Extension} from 'micromark-util-types'\n */\n\nimport { attention, autolink, blockQuote, characterEscape, characterReference, codeFenced, codeIndented, codeText, definition, hardBreakEscape, headingAtx, htmlFlow, htmlText, labelEnd, labelStartImage, labelStartLink, lineEnding, list, setextUnderline, thematicBreak } from 'micromark-core-commonmark';\nimport { resolver as resolveText } from './initialize/text.js';\n\n/** @satisfies {Extension['document']} */\nexport const document = {\n [42]: list,\n [43]: list,\n [45]: list,\n [48]: list,\n [49]: list,\n [50]: list,\n [51]: list,\n [52]: list,\n [53]: list,\n [54]: list,\n [55]: list,\n [56]: list,\n [57]: list,\n [62]: blockQuote\n};\n\n/** @satisfies {Extension['contentInitial']} */\nexport const contentInitial = {\n [91]: definition\n};\n\n/** @satisfies {Extension['flowInitial']} */\nexport const flowInitial = {\n [-2]: codeIndented,\n [-1]: codeIndented,\n [32]: codeIndented\n};\n\n/** @satisfies {Extension['flow']} */\nexport const flow = {\n [35]: headingAtx,\n [42]: thematicBreak,\n [45]: [setextUnderline, thematicBreak],\n [60]: htmlFlow,\n [61]: setextUnderline,\n [95]: thematicBreak,\n [96]: codeFenced,\n [126]: codeFenced\n};\n\n/** @satisfies {Extension['string']} */\nexport const string = {\n [38]: characterReference,\n [92]: characterEscape\n};\n\n/** @satisfies {Extension['text']} */\nexport const text = {\n [-5]: lineEnding,\n [-4]: lineEnding,\n [-3]: lineEnding,\n [33]: labelStartImage,\n [38]: characterReference,\n [42]: attention,\n [60]: [autolink, htmlText],\n [91]: labelStartLink,\n [92]: [hardBreakEscape, characterEscape],\n [93]: labelEnd,\n [95]: attention,\n [96]: codeText\n};\n\n/** @satisfies {Extension['insideSpan']} */\nexport const insideSpan = {\n null: [attention, resolveText]\n};\n\n/** @satisfies {Extension['attentionMarkers']} */\nexport const attentionMarkers = {\n null: [42, 95]\n};\n\n/** @satisfies {Extension['disable']} */\nexport const disable = {\n null: []\n};", "/**\n * @import {\n * Chunk,\n * Code,\n * ConstructRecord,\n * Construct,\n * Effects,\n * InitialConstruct,\n * ParseContext,\n * Point,\n * State,\n * TokenizeContext,\n * Token\n * } from 'micromark-util-types'\n */\n\n/**\n * @callback Restore\n * Restore the state.\n * @returns {undefined}\n * Nothing.\n *\n * @typedef Info\n * Info.\n * @property {Restore} restore\n * Restore.\n * @property {number} from\n * From.\n *\n * @callback ReturnHandle\n * Handle a successful run.\n * @param {Construct} construct\n * Construct.\n * @param {Info} info\n * Info.\n * @returns {undefined}\n * Nothing.\n */\n\nimport { markdownLineEnding } from 'micromark-util-character';\nimport { push, splice } from 'micromark-util-chunked';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/**\n * Create a tokenizer.\n * Tokenizers deal with one type of data (e.g., containers, flow, text).\n * The parser is the object dealing with it all.\n * `initialize` works like other constructs, except that only its `tokenize`\n * function is used, in which case it doesn\u2019t receive an `ok` or `nok`.\n * `from` can be given to set the point before the first character, although\n * when further lines are indented, they must be set with `defineSkip`.\n *\n * @param {ParseContext} parser\n * Parser.\n * @param {InitialConstruct} initialize\n * Construct.\n * @param {Omit | undefined} [from]\n * Point (optional).\n * @returns {TokenizeContext}\n * Context.\n */\nexport function createTokenizer(parser, initialize, from) {\n /** @type {Point} */\n let point = {\n _bufferIndex: -1,\n _index: 0,\n line: from && from.line || 1,\n column: from && from.column || 1,\n offset: from && from.offset || 0\n };\n /** @type {Record} */\n const columnStart = {};\n /** @type {Array} */\n const resolveAllConstructs = [];\n /** @type {Array} */\n let chunks = [];\n /** @type {Array} */\n let stack = [];\n /** @type {boolean | undefined} */\n let consumed = true;\n\n /**\n * Tools used for tokenizing.\n *\n * @type {Effects}\n */\n const effects = {\n attempt: constructFactory(onsuccessfulconstruct),\n check: constructFactory(onsuccessfulcheck),\n consume,\n enter,\n exit,\n interrupt: constructFactory(onsuccessfulcheck, {\n interrupt: true\n })\n };\n\n /**\n * State and tools for resolving and serializing.\n *\n * @type {TokenizeContext}\n */\n const context = {\n code: null,\n containerState: {},\n defineSkip,\n events: [],\n now,\n parser,\n previous: null,\n sliceSerialize,\n sliceStream,\n write\n };\n\n /**\n * The state function.\n *\n * @type {State | undefined}\n */\n let state = initialize.tokenize.call(context, effects);\n\n /**\n * Track which character we expect to be consumed, to catch bugs.\n *\n * @type {Code}\n */\n let expectedCode;\n if (initialize.resolveAll) {\n resolveAllConstructs.push(initialize);\n }\n return context;\n\n /** @type {TokenizeContext['write']} */\n function write(slice) {\n chunks = push(chunks, slice);\n main();\n\n // Exit if we\u2019re not done, resolve might change stuff.\n if (chunks[chunks.length - 1] !== null) {\n return [];\n }\n addResult(initialize, 0);\n\n // Otherwise, resolve, and exit.\n context.events = resolveAll(resolveAllConstructs, context.events, context);\n return context.events;\n }\n\n //\n // Tools.\n //\n\n /** @type {TokenizeContext['sliceSerialize']} */\n function sliceSerialize(token, expandTabs) {\n return serializeChunks(sliceStream(token), expandTabs);\n }\n\n /** @type {TokenizeContext['sliceStream']} */\n function sliceStream(token) {\n return sliceChunks(chunks, token);\n }\n\n /** @type {TokenizeContext['now']} */\n function now() {\n // This is a hot path, so we clone manually instead of `Object.assign({}, point)`\n const {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n } = point;\n return {\n _bufferIndex,\n _index,\n line,\n column,\n offset\n };\n }\n\n /** @type {TokenizeContext['defineSkip']} */\n function defineSkip(value) {\n columnStart[value.line] = value.column;\n accountForPotentialSkip();\n }\n\n //\n // State management.\n //\n\n /**\n * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by\n * `consume`).\n * Here is where we walk through the chunks, which either include strings of\n * several characters, or numerical character codes.\n * The reason to do this in a loop instead of a call is so the stack can\n * drain.\n *\n * @returns {undefined}\n * Nothing.\n */\n function main() {\n /** @type {number} */\n let chunkIndex;\n while (point._index < chunks.length) {\n const chunk = chunks[point._index];\n\n // If we\u2019re in a buffer chunk, loop through it.\n if (typeof chunk === 'string') {\n chunkIndex = point._index;\n if (point._bufferIndex < 0) {\n point._bufferIndex = 0;\n }\n while (point._index === chunkIndex && point._bufferIndex < chunk.length) {\n go(chunk.charCodeAt(point._bufferIndex));\n }\n } else {\n go(chunk);\n }\n }\n }\n\n /**\n * Deal with one code.\n *\n * @param {Code} code\n * Code.\n * @returns {undefined}\n * Nothing.\n */\n function go(code) {\n consumed = undefined;\n expectedCode = code;\n state = state(code);\n }\n\n /** @type {Effects['consume']} */\n function consume(code) {\n if (markdownLineEnding(code)) {\n point.line++;\n point.column = 1;\n point.offset += code === -3 ? 2 : 1;\n accountForPotentialSkip();\n } else if (code !== -1) {\n point.column++;\n point.offset++;\n }\n\n // Not in a string chunk.\n if (point._bufferIndex < 0) {\n point._index++;\n } else {\n point._bufferIndex++;\n\n // At end of string chunk.\n if (point._bufferIndex ===\n // Points w/ non-negative `_bufferIndex` reference\n // strings.\n /** @type {string} */\n chunks[point._index].length) {\n point._bufferIndex = -1;\n point._index++;\n }\n }\n\n // Expose the previous character.\n context.previous = code;\n\n // Mark as consumed.\n consumed = true;\n }\n\n /** @type {Effects['enter']} */\n function enter(type, fields) {\n /** @type {Token} */\n // @ts-expect-error Patch instead of assign required fields to help GC.\n const token = fields || {};\n token.type = type;\n token.start = now();\n context.events.push(['enter', token, context]);\n stack.push(token);\n return token;\n }\n\n /** @type {Effects['exit']} */\n function exit(type) {\n const token = stack.pop();\n token.end = now();\n context.events.push(['exit', token, context]);\n return token;\n }\n\n /**\n * Use results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulconstruct(construct, info) {\n addResult(construct, info.from);\n }\n\n /**\n * Discard results.\n *\n * @type {ReturnHandle}\n */\n function onsuccessfulcheck(_, info) {\n info.restore();\n }\n\n /**\n * Factory to attempt/check/interrupt.\n *\n * @param {ReturnHandle} onreturn\n * Callback.\n * @param {{interrupt?: boolean | undefined} | undefined} [fields]\n * Fields.\n */\n function constructFactory(onreturn, fields) {\n return hook;\n\n /**\n * Handle either an object mapping codes to constructs, a list of\n * constructs, or a single construct.\n *\n * @param {Array | ConstructRecord | Construct} constructs\n * Constructs.\n * @param {State} returnState\n * State.\n * @param {State | undefined} [bogusState]\n * State.\n * @returns {State}\n * State.\n */\n function hook(constructs, returnState, bogusState) {\n /** @type {ReadonlyArray} */\n let listOfConstructs;\n /** @type {number} */\n let constructIndex;\n /** @type {Construct} */\n let currentConstruct;\n /** @type {Info} */\n let info;\n return Array.isArray(constructs) ? /* c8 ignore next 1 */\n handleListOfConstructs(constructs) : 'tokenize' in constructs ?\n // Looks like a construct.\n handleListOfConstructs([(/** @type {Construct} */constructs)]) : handleMapOfConstructs(constructs);\n\n /**\n * Handle a list of construct.\n *\n * @param {ConstructRecord} map\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleMapOfConstructs(map) {\n return start;\n\n /** @type {State} */\n function start(code) {\n const left = code !== null && map[code];\n const all = code !== null && map.null;\n const list = [\n // To do: add more extension tests.\n /* c8 ignore next 2 */\n ...(Array.isArray(left) ? left : left ? [left] : []), ...(Array.isArray(all) ? all : all ? [all] : [])];\n return handleListOfConstructs(list)(code);\n }\n }\n\n /**\n * Handle a list of construct.\n *\n * @param {ReadonlyArray} list\n * Constructs.\n * @returns {State}\n * State.\n */\n function handleListOfConstructs(list) {\n listOfConstructs = list;\n constructIndex = 0;\n if (list.length === 0) {\n return bogusState;\n }\n return handleConstruct(list[constructIndex]);\n }\n\n /**\n * Handle a single construct.\n *\n * @param {Construct} construct\n * Construct.\n * @returns {State}\n * State.\n */\n function handleConstruct(construct) {\n return start;\n\n /** @type {State} */\n function start(code) {\n // To do: not needed to store if there is no bogus state, probably?\n // Currently doesn\u2019t work because `inspect` in document does a check\n // w/o a bogus, which doesn\u2019t make sense. But it does seem to help perf\n // by not storing.\n info = store();\n currentConstruct = construct;\n if (!construct.partial) {\n context.currentConstruct = construct;\n }\n\n // Always populated by defaults.\n\n if (construct.name && context.parser.constructs.disable.null.includes(construct.name)) {\n return nok(code);\n }\n return construct.tokenize.call(\n // If we do have fields, create an object w/ `context` as its\n // prototype.\n // This allows a \u201Clive binding\u201D, which is needed for `interrupt`.\n fields ? Object.assign(Object.create(context), fields) : context, effects, ok, nok)(code);\n }\n }\n\n /** @type {State} */\n function ok(code) {\n consumed = true;\n onreturn(currentConstruct, info);\n return returnState;\n }\n\n /** @type {State} */\n function nok(code) {\n consumed = true;\n info.restore();\n if (++constructIndex < listOfConstructs.length) {\n return handleConstruct(listOfConstructs[constructIndex]);\n }\n return bogusState;\n }\n }\n }\n\n /**\n * @param {Construct} construct\n * Construct.\n * @param {number} from\n * From.\n * @returns {undefined}\n * Nothing.\n */\n function addResult(construct, from) {\n if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {\n resolveAllConstructs.push(construct);\n }\n if (construct.resolve) {\n splice(context.events, from, context.events.length - from, construct.resolve(context.events.slice(from), context));\n }\n if (construct.resolveTo) {\n context.events = construct.resolveTo(context.events, context);\n }\n }\n\n /**\n * Store state.\n *\n * @returns {Info}\n * Info.\n */\n function store() {\n const startPoint = now();\n const startPrevious = context.previous;\n const startCurrentConstruct = context.currentConstruct;\n const startEventsIndex = context.events.length;\n const startStack = Array.from(stack);\n return {\n from: startEventsIndex,\n restore\n };\n\n /**\n * Restore state.\n *\n * @returns {undefined}\n * Nothing.\n */\n function restore() {\n point = startPoint;\n context.previous = startPrevious;\n context.currentConstruct = startCurrentConstruct;\n context.events.length = startEventsIndex;\n stack = startStack;\n accountForPotentialSkip();\n }\n }\n\n /**\n * Move the current point a bit forward in the line when it\u2019s on a column\n * skip.\n *\n * @returns {undefined}\n * Nothing.\n */\n function accountForPotentialSkip() {\n if (point.line in columnStart && point.column < 2) {\n point.column = columnStart[point.line];\n point.offset += columnStart[point.line] - 1;\n }\n }\n}\n\n/**\n * Get the chunks from a slice of chunks in the range of a token.\n *\n * @param {ReadonlyArray} chunks\n * Chunks.\n * @param {Pick} token\n * Token.\n * @returns {Array}\n * Chunks.\n */\nfunction sliceChunks(chunks, token) {\n const startIndex = token.start._index;\n const startBufferIndex = token.start._bufferIndex;\n const endIndex = token.end._index;\n const endBufferIndex = token.end._bufferIndex;\n /** @type {Array} */\n let view;\n if (startIndex === endIndex) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)];\n } else {\n view = chunks.slice(startIndex, endIndex);\n if (startBufferIndex > -1) {\n const head = view[0];\n if (typeof head === 'string') {\n view[0] = head.slice(startBufferIndex);\n /* c8 ignore next 4 -- used to be used, no longer */\n } else {\n view.shift();\n }\n }\n if (endBufferIndex > 0) {\n // @ts-expect-error `_bufferIndex` is used on string chunks.\n view.push(chunks[endIndex].slice(0, endBufferIndex));\n }\n }\n return view;\n}\n\n/**\n * Get the string value of a slice of chunks.\n *\n * @param {ReadonlyArray} chunks\n * Chunks.\n * @param {boolean | undefined} [expandTabs=false]\n * Whether to expand tabs (default: `false`).\n * @returns {string}\n * Result.\n */\nfunction serializeChunks(chunks, expandTabs) {\n let index = -1;\n /** @type {Array} */\n const result = [];\n /** @type {boolean | undefined} */\n let atTab;\n while (++index < chunks.length) {\n const chunk = chunks[index];\n /** @type {string} */\n let value;\n if (typeof chunk === 'string') {\n value = chunk;\n } else switch (chunk) {\n case -5:\n {\n value = \"\\r\";\n break;\n }\n case -4:\n {\n value = \"\\n\";\n break;\n }\n case -3:\n {\n value = \"\\r\" + \"\\n\";\n break;\n }\n case -2:\n {\n value = expandTabs ? \" \" : \"\\t\";\n break;\n }\n case -1:\n {\n if (!expandTabs && atTab) continue;\n value = \" \";\n break;\n }\n default:\n {\n // Currently only replacement character.\n value = String.fromCharCode(chunk);\n }\n }\n atTab = chunk === -2;\n result.push(value);\n }\n return result.join('');\n}", "/**\n * @import {\n * Create,\n * FullNormalizedExtension,\n * InitialConstruct,\n * ParseContext,\n * ParseOptions\n * } from 'micromark-util-types'\n */\n\nimport { combineExtensions } from 'micromark-util-combine-extensions';\nimport { content } from './initialize/content.js';\nimport { document } from './initialize/document.js';\nimport { flow } from './initialize/flow.js';\nimport { string, text } from './initialize/text.js';\nimport * as defaultConstructs from './constructs.js';\nimport { createTokenizer } from './create-tokenizer.js';\n\n/**\n * @param {ParseOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ParseContext}\n * Parser.\n */\nexport function parse(options) {\n const settings = options || {};\n const constructs = /** @type {FullNormalizedExtension} */\n combineExtensions([defaultConstructs, ...(settings.extensions || [])]);\n\n /** @type {ParseContext} */\n const parser = {\n constructs,\n content: create(content),\n defined: [],\n document: create(document),\n flow: create(flow),\n lazy: {},\n string: create(string),\n text: create(text)\n };\n return parser;\n\n /**\n * @param {InitialConstruct} initial\n * Construct to start with.\n * @returns {Create}\n * Create a tokenizer.\n */\n function create(initial) {\n return creator;\n /** @type {Create} */\n function creator(from) {\n return createTokenizer(parser, initial, from);\n }\n }\n}", "/**\n * @import {Event} from 'micromark-util-types'\n */\n\nimport { subtokenize } from 'micromark-util-subtokenize';\n\n/**\n * @param {Array} events\n * Events.\n * @returns {Array}\n * Events.\n */\nexport function postprocess(events) {\n while (!subtokenize(events)) {\n // Empty\n }\n return events;\n}", "/**\n * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'\n */\n\n/**\n * @callback Preprocessor\n * Preprocess a value.\n * @param {Value} value\n * Value.\n * @param {Encoding | null | undefined} [encoding]\n * Encoding when `value` is a typed array (optional).\n * @param {boolean | null | undefined} [end=false]\n * Whether this is the last chunk (default: `false`).\n * @returns {Array}\n * Chunks.\n */\n\nconst search = /[\\0\\t\\n\\r]/g;\n\n/**\n * @returns {Preprocessor}\n * Preprocess a value.\n */\nexport function preprocess() {\n let column = 1;\n let buffer = '';\n /** @type {boolean | undefined} */\n let start = true;\n /** @type {boolean | undefined} */\n let atCarriageReturn;\n return preprocessor;\n\n /** @type {Preprocessor} */\n // eslint-disable-next-line complexity\n function preprocessor(value, encoding, end) {\n /** @type {Array} */\n const chunks = [];\n /** @type {RegExpMatchArray | null} */\n let match;\n /** @type {number} */\n let next;\n /** @type {number} */\n let startPosition;\n /** @type {number} */\n let endPosition;\n /** @type {Code} */\n let code;\n value = buffer + (typeof value === 'string' ? value.toString() : new TextDecoder(encoding || undefined).decode(value));\n startPosition = 0;\n buffer = '';\n if (start) {\n // To do: `markdown-rs` actually parses BOMs (byte order mark).\n if (value.charCodeAt(0) === 65279) {\n startPosition++;\n }\n start = undefined;\n }\n while (startPosition < value.length) {\n search.lastIndex = startPosition;\n match = search.exec(value);\n endPosition = match && match.index !== undefined ? match.index : value.length;\n code = value.charCodeAt(endPosition);\n if (!match) {\n buffer = value.slice(startPosition);\n break;\n }\n if (code === 10 && startPosition === endPosition && atCarriageReturn) {\n chunks.push(-3);\n atCarriageReturn = undefined;\n } else {\n if (atCarriageReturn) {\n chunks.push(-5);\n atCarriageReturn = undefined;\n }\n if (startPosition < endPosition) {\n chunks.push(value.slice(startPosition, endPosition));\n column += endPosition - startPosition;\n }\n switch (code) {\n case 0:\n {\n chunks.push(65533);\n column++;\n break;\n }\n case 9:\n {\n next = Math.ceil(column / 4) * 4;\n chunks.push(-2);\n while (column++ < next) chunks.push(-1);\n break;\n }\n case 10:\n {\n chunks.push(-4);\n column = 1;\n break;\n }\n default:\n {\n atCarriageReturn = true;\n column = 1;\n }\n }\n }\n startPosition = endPosition + 1;\n }\n if (end) {\n if (atCarriageReturn) chunks.push(-5);\n if (buffer) chunks.push(buffer);\n chunks.push(null);\n }\n return chunks;\n }\n}", "import { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nconst characterEscapeOrReference = /\\\\([!-/:-@[-`{-~])|&(#(?:\\d{1,7}|x[\\da-f]{1,6})|[\\da-z]{1,31});/gi;\n\n/**\n * Decode markdown strings (which occur in places such as fenced code info\n * strings, destinations, labels, and titles).\n *\n * The \u201Cstring\u201D content type allows character escapes and -references.\n * This decodes those.\n *\n * @param {string} value\n * Value to decode.\n * @returns {string}\n * Decoded value.\n */\nexport function decodeString(value) {\n return value.replace(characterEscapeOrReference, decode);\n}\n\n/**\n * @param {string} $0\n * Match.\n * @param {string} $1\n * Character escape.\n * @param {string} $2\n * Character reference.\n * @returns {string}\n * Decoded value\n */\nfunction decode($0, $1, $2) {\n if ($1) {\n // Escape.\n return $1;\n }\n\n // Reference.\n const head = $2.charCodeAt(0);\n if (head === 35) {\n const head = $2.charCodeAt(1);\n const hex = head === 120 || head === 88;\n return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);\n }\n return decodeNamedCharacterReference($2) || $0;\n}", "/**\n * @import {\n * Break,\n * Blockquote,\n * Code,\n * Definition,\n * Emphasis,\n * Heading,\n * Html,\n * Image,\n * InlineCode,\n * Link,\n * ListItem,\n * List,\n * Nodes,\n * Paragraph,\n * PhrasingContent,\n * ReferenceType,\n * Root,\n * Strong,\n * Text,\n * ThematicBreak\n * } from 'mdast'\n * @import {\n * Encoding,\n * Event,\n * Token,\n * Value\n * } from 'micromark-util-types'\n * @import {Point} from 'unist'\n * @import {\n * CompileContext,\n * CompileData,\n * Config,\n * Extension,\n * Handle,\n * OnEnterError,\n * Options\n * } from './types.js'\n */\n\nimport { toString } from 'mdast-util-to-string';\nimport { parse, postprocess, preprocess } from 'micromark';\nimport { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';\nimport { decodeString } from 'micromark-util-decode-string';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nimport { decodeNamedCharacterReference } from 'decode-named-character-reference';\nimport { stringifyPosition } from 'unist-util-stringify-position';\nconst own = {}.hasOwnProperty;\n\n/**\n * Turn markdown into a syntax tree.\n *\n * @overload\n * @param {Value} value\n * @param {Encoding | null | undefined} [encoding]\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @overload\n * @param {Value} value\n * @param {Options | null | undefined} [options]\n * @returns {Root}\n *\n * @param {Value} value\n * Markdown to parse.\n * @param {Encoding | Options | null | undefined} [encoding]\n * Character encoding for when `value` is `Buffer`.\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {Root}\n * mdast tree.\n */\nexport function fromMarkdown(value, encoding, options) {\n if (encoding && typeof encoding === 'object') {\n options = encoding;\n encoding = undefined;\n }\n return compiler(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));\n}\n\n/**\n * Note this compiler only understand complete buffering, not streaming.\n *\n * @param {Options | null | undefined} [options]\n */\nfunction compiler(options) {\n /** @type {Config} */\n const config = {\n transforms: [],\n canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],\n enter: {\n autolink: opener(link),\n autolinkProtocol: onenterdata,\n autolinkEmail: onenterdata,\n atxHeading: opener(heading),\n blockQuote: opener(blockQuote),\n characterEscape: onenterdata,\n characterReference: onenterdata,\n codeFenced: opener(codeFlow),\n codeFencedFenceInfo: buffer,\n codeFencedFenceMeta: buffer,\n codeIndented: opener(codeFlow, buffer),\n codeText: opener(codeText, buffer),\n codeTextData: onenterdata,\n data: onenterdata,\n codeFlowValue: onenterdata,\n definition: opener(definition),\n definitionDestinationString: buffer,\n definitionLabelString: buffer,\n definitionTitleString: buffer,\n emphasis: opener(emphasis),\n hardBreakEscape: opener(hardBreak),\n hardBreakTrailing: opener(hardBreak),\n htmlFlow: opener(html, buffer),\n htmlFlowData: onenterdata,\n htmlText: opener(html, buffer),\n htmlTextData: onenterdata,\n image: opener(image),\n label: buffer,\n link: opener(link),\n listItem: opener(listItem),\n listItemValue: onenterlistitemvalue,\n listOrdered: opener(list, onenterlistordered),\n listUnordered: opener(list),\n paragraph: opener(paragraph),\n reference: onenterreference,\n referenceString: buffer,\n resourceDestinationString: buffer,\n resourceTitleString: buffer,\n setextHeading: opener(heading),\n strong: opener(strong),\n thematicBreak: opener(thematicBreak)\n },\n exit: {\n atxHeading: closer(),\n atxHeadingSequence: onexitatxheadingsequence,\n autolink: closer(),\n autolinkEmail: onexitautolinkemail,\n autolinkProtocol: onexitautolinkprotocol,\n blockQuote: closer(),\n characterEscapeValue: onexitdata,\n characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,\n characterReferenceMarkerNumeric: onexitcharacterreferencemarker,\n characterReferenceValue: onexitcharacterreferencevalue,\n characterReference: onexitcharacterreference,\n codeFenced: closer(onexitcodefenced),\n codeFencedFence: onexitcodefencedfence,\n codeFencedFenceInfo: onexitcodefencedfenceinfo,\n codeFencedFenceMeta: onexitcodefencedfencemeta,\n codeFlowValue: onexitdata,\n codeIndented: closer(onexitcodeindented),\n codeText: closer(onexitcodetext),\n codeTextData: onexitdata,\n data: onexitdata,\n definition: closer(),\n definitionDestinationString: onexitdefinitiondestinationstring,\n definitionLabelString: onexitdefinitionlabelstring,\n definitionTitleString: onexitdefinitiontitlestring,\n emphasis: closer(),\n hardBreakEscape: closer(onexithardbreak),\n hardBreakTrailing: closer(onexithardbreak),\n htmlFlow: closer(onexithtmlflow),\n htmlFlowData: onexitdata,\n htmlText: closer(onexithtmltext),\n htmlTextData: onexitdata,\n image: closer(onexitimage),\n label: onexitlabel,\n labelText: onexitlabeltext,\n lineEnding: onexitlineending,\n link: closer(onexitlink),\n listItem: closer(),\n listOrdered: closer(),\n listUnordered: closer(),\n paragraph: closer(),\n referenceString: onexitreferencestring,\n resourceDestinationString: onexitresourcedestinationstring,\n resourceTitleString: onexitresourcetitlestring,\n resource: onexitresource,\n setextHeading: closer(onexitsetextheading),\n setextHeadingLineSequence: onexitsetextheadinglinesequence,\n setextHeadingText: onexitsetextheadingtext,\n strong: closer(),\n thematicBreak: closer()\n }\n };\n configure(config, (options || {}).mdastExtensions || []);\n\n /** @type {CompileData} */\n const data = {};\n return compile;\n\n /**\n * Turn micromark events into an mdast tree.\n *\n * @param {Array} events\n * Events.\n * @returns {Root}\n * mdast tree.\n */\n function compile(events) {\n /** @type {Root} */\n let tree = {\n type: 'root',\n children: []\n };\n /** @type {Omit} */\n const context = {\n stack: [tree],\n tokenStack: [],\n config,\n enter,\n exit,\n buffer,\n resume,\n data\n };\n /** @type {Array} */\n const listStack = [];\n let index = -1;\n while (++index < events.length) {\n // We preprocess lists to add `listItem` tokens, and to infer whether\n // items the list itself are spread out.\n if (events[index][1].type === \"listOrdered\" || events[index][1].type === \"listUnordered\") {\n if (events[index][0] === 'enter') {\n listStack.push(index);\n } else {\n const tail = listStack.pop();\n index = prepareList(events, tail, index);\n }\n }\n }\n index = -1;\n while (++index < events.length) {\n const handler = config[events[index][0]];\n if (own.call(handler, events[index][1].type)) {\n handler[events[index][1].type].call(Object.assign({\n sliceSerialize: events[index][2].sliceSerialize\n }, context), events[index][1]);\n }\n }\n\n // Handle tokens still being open.\n if (context.tokenStack.length > 0) {\n const tail = context.tokenStack[context.tokenStack.length - 1];\n const handler = tail[1] || defaultOnError;\n handler.call(context, undefined, tail[0]);\n }\n\n // Figure out `root` position.\n tree.position = {\n start: point(events.length > 0 ? events[0][1].start : {\n line: 1,\n column: 1,\n offset: 0\n }),\n end: point(events.length > 0 ? events[events.length - 2][1].end : {\n line: 1,\n column: 1,\n offset: 0\n })\n };\n\n // Call transforms.\n index = -1;\n while (++index < config.transforms.length) {\n tree = config.transforms[index](tree) || tree;\n }\n return tree;\n }\n\n /**\n * @param {Array} events\n * @param {number} start\n * @param {number} length\n * @returns {number}\n */\n function prepareList(events, start, length) {\n let index = start - 1;\n let containerBalance = -1;\n let listSpread = false;\n /** @type {Token | undefined} */\n let listItem;\n /** @type {number | undefined} */\n let lineIndex;\n /** @type {number | undefined} */\n let firstBlankLineIndex;\n /** @type {boolean | undefined} */\n let atMarker;\n while (++index <= length) {\n const event = events[index];\n switch (event[1].type) {\n case \"listUnordered\":\n case \"listOrdered\":\n case \"blockQuote\":\n {\n if (event[0] === 'enter') {\n containerBalance++;\n } else {\n containerBalance--;\n }\n atMarker = undefined;\n break;\n }\n case \"lineEndingBlank\":\n {\n if (event[0] === 'enter') {\n if (listItem && !atMarker && !containerBalance && !firstBlankLineIndex) {\n firstBlankLineIndex = index;\n }\n atMarker = undefined;\n }\n break;\n }\n case \"linePrefix\":\n case \"listItemValue\":\n case \"listItemMarker\":\n case \"listItemPrefix\":\n case \"listItemPrefixWhitespace\":\n {\n // Empty.\n\n break;\n }\n default:\n {\n atMarker = undefined;\n }\n }\n if (!containerBalance && event[0] === 'enter' && event[1].type === \"listItemPrefix\" || containerBalance === -1 && event[0] === 'exit' && (event[1].type === \"listUnordered\" || event[1].type === \"listOrdered\")) {\n if (listItem) {\n let tailIndex = index;\n lineIndex = undefined;\n while (tailIndex--) {\n const tailEvent = events[tailIndex];\n if (tailEvent[1].type === \"lineEnding\" || tailEvent[1].type === \"lineEndingBlank\") {\n if (tailEvent[0] === 'exit') continue;\n if (lineIndex) {\n events[lineIndex][1].type = \"lineEndingBlank\";\n listSpread = true;\n }\n tailEvent[1].type = \"lineEnding\";\n lineIndex = tailIndex;\n } else if (tailEvent[1].type === \"linePrefix\" || tailEvent[1].type === \"blockQuotePrefix\" || tailEvent[1].type === \"blockQuotePrefixWhitespace\" || tailEvent[1].type === \"blockQuoteMarker\" || tailEvent[1].type === \"listItemIndent\") {\n // Empty\n } else {\n break;\n }\n }\n if (firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex)) {\n listItem._spread = true;\n }\n\n // Fix position.\n listItem.end = Object.assign({}, lineIndex ? events[lineIndex][1].start : event[1].end);\n events.splice(lineIndex || index, 0, ['exit', listItem, event[2]]);\n index++;\n length++;\n }\n\n // Create a new list item.\n if (event[1].type === \"listItemPrefix\") {\n /** @type {Token} */\n const item = {\n type: 'listItem',\n _spread: false,\n start: Object.assign({}, event[1].start),\n // @ts-expect-error: we\u2019ll add `end` in a second.\n end: undefined\n };\n listItem = item;\n events.splice(index, 0, ['enter', item, event[2]]);\n index++;\n length++;\n firstBlankLineIndex = undefined;\n atMarker = true;\n }\n }\n }\n events[start][1]._spread = listSpread;\n return length;\n }\n\n /**\n * Create an opener handle.\n *\n * @param {(token: Token) => Nodes} create\n * Create a node.\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function opener(create, and) {\n return open;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function open(token) {\n enter.call(this, create(token), token);\n if (and) and.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['buffer']}\n */\n function buffer() {\n this.stack.push({\n type: 'fragment',\n children: []\n });\n }\n\n /**\n * @type {CompileContext['enter']}\n */\n function enter(node, token, errorHandler) {\n const parent = this.stack[this.stack.length - 1];\n /** @type {Array} */\n const siblings = parent.children;\n siblings.push(node);\n this.stack.push(node);\n this.tokenStack.push([token, errorHandler || undefined]);\n node.position = {\n start: point(token.start),\n // @ts-expect-error: `end` will be patched later.\n end: undefined\n };\n }\n\n /**\n * Create a closer handle.\n *\n * @param {Handle | undefined} [and]\n * Optional function to also run.\n * @returns {Handle}\n * Handle.\n */\n function closer(and) {\n return close;\n\n /**\n * @this {CompileContext}\n * @param {Token} token\n * @returns {undefined}\n */\n function close(token) {\n if (and) and.call(this, token);\n exit.call(this, token);\n }\n }\n\n /**\n * @type {CompileContext['exit']}\n */\n function exit(token, onExitError) {\n const node = this.stack.pop();\n const open = this.tokenStack.pop();\n if (!open) {\n throw new Error('Cannot close `' + token.type + '` (' + stringifyPosition({\n start: token.start,\n end: token.end\n }) + '): it\u2019s not open');\n } else if (open[0].type !== token.type) {\n if (onExitError) {\n onExitError.call(this, token, open[0]);\n } else {\n const handler = open[1] || defaultOnError;\n handler.call(this, token, open[0]);\n }\n }\n node.position.end = point(token.end);\n }\n\n /**\n * @type {CompileContext['resume']}\n */\n function resume() {\n return toString(this.stack.pop());\n }\n\n //\n // Handlers.\n //\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistordered() {\n this.data.expectingFirstListItemValue = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onenterlistitemvalue(token) {\n if (this.data.expectingFirstListItemValue) {\n const ancestor = this.stack[this.stack.length - 2];\n ancestor.start = Number.parseInt(this.sliceSerialize(token), 10);\n this.data.expectingFirstListItemValue = undefined;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfenceinfo() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.lang = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfencemeta() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.meta = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefencedfence() {\n // Exit if this is the closing fence.\n if (this.data.flowCodeInside) return;\n this.buffer();\n this.data.flowCodeInside = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodefenced() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/^(\\r?\\n|\\r)|(\\r?\\n|\\r)$/g, '');\n this.data.flowCodeInside = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcodeindented() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data.replace(/(\\r?\\n|\\r)$/g, '');\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitionlabelstring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.label = label;\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiontitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitdefinitiondestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitatxheadingsequence(token) {\n const node = this.stack[this.stack.length - 1];\n if (!node.depth) {\n const depth = this.sliceSerialize(token).length;\n node.depth = depth;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadingtext() {\n this.data.setextHeadingSlurpLineEnding = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheadinglinesequence(token) {\n const node = this.stack[this.stack.length - 1];\n node.depth = this.sliceSerialize(token).codePointAt(0) === 61 ? 1 : 2;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitsetextheading() {\n this.data.setextHeadingSlurpLineEnding = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterdata(token) {\n const node = this.stack[this.stack.length - 1];\n /** @type {Array} */\n const siblings = node.children;\n let tail = siblings[siblings.length - 1];\n if (!tail || tail.type !== 'text') {\n // Add a new text node.\n tail = text();\n tail.position = {\n start: point(token.start),\n // @ts-expect-error: we\u2019ll add `end` later.\n end: undefined\n };\n siblings.push(tail);\n }\n this.stack.push(tail);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitdata(token) {\n const tail = this.stack.pop();\n tail.value += this.sliceSerialize(token);\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlineending(token) {\n const context = this.stack[this.stack.length - 1];\n // If we\u2019re at a hard break, include the line ending in there.\n if (this.data.atHardBreak) {\n const tail = context.children[context.children.length - 1];\n tail.position.end = point(token.end);\n this.data.atHardBreak = undefined;\n return;\n }\n if (!this.data.setextHeadingSlurpLineEnding && config.canContainEols.includes(context.type)) {\n onenterdata.call(this, token);\n onexitdata.call(this, token);\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithardbreak() {\n this.data.atHardBreak = true;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmlflow() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexithtmltext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcodetext() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.value = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlink() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitimage() {\n const node = this.stack[this.stack.length - 1];\n // Note: there are also `identifier` and `label` fields on this link node!\n // These are used / cleaned here.\n\n // To do: clean.\n if (this.data.inReference) {\n /** @type {ReferenceType} */\n const referenceType = this.data.referenceType || 'shortcut';\n node.type += 'Reference';\n // @ts-expect-error: mutate.\n node.referenceType = referenceType;\n // @ts-expect-error: mutate.\n delete node.url;\n delete node.title;\n } else {\n // @ts-expect-error: mutate.\n delete node.identifier;\n // @ts-expect-error: mutate.\n delete node.label;\n }\n this.data.referenceType = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabeltext(token) {\n const string = this.sliceSerialize(token);\n const ancestor = this.stack[this.stack.length - 2];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n ancestor.label = decodeString(string);\n // @ts-expect-error: same as above.\n ancestor.identifier = normalizeIdentifier(string).toLowerCase();\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitlabel() {\n const fragment = this.stack[this.stack.length - 1];\n const value = this.resume();\n const node = this.stack[this.stack.length - 1];\n // Assume a reference.\n this.data.inReference = true;\n if (node.type === 'link') {\n /** @type {Array} */\n const children = fragment.children;\n node.children = children;\n } else {\n node.alt = value;\n }\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcedestinationstring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.url = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresourcetitlestring() {\n const data = this.resume();\n const node = this.stack[this.stack.length - 1];\n node.title = data;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitresource() {\n this.data.inReference = undefined;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onenterreference() {\n this.data.referenceType = 'collapsed';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitreferencestring(token) {\n const label = this.resume();\n const node = this.stack[this.stack.length - 1];\n // @ts-expect-error: stash this on the node, as it might become a reference\n // later.\n node.label = label;\n // @ts-expect-error: same as above.\n node.identifier = normalizeIdentifier(this.sliceSerialize(token)).toLowerCase();\n this.data.referenceType = 'full';\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n\n function onexitcharacterreferencemarker(token) {\n this.data.characterReferenceType = token.type;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreferencevalue(token) {\n const data = this.sliceSerialize(token);\n const type = this.data.characterReferenceType;\n /** @type {string} */\n let value;\n if (type) {\n value = decodeNumericCharacterReference(data, type === \"characterReferenceMarkerNumeric\" ? 10 : 16);\n this.data.characterReferenceType = undefined;\n } else {\n const result = decodeNamedCharacterReference(data);\n value = result;\n }\n const tail = this.stack[this.stack.length - 1];\n tail.value += value;\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitcharacterreference(token) {\n const tail = this.stack.pop();\n tail.position.end = point(token.end);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkprotocol(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = this.sliceSerialize(token);\n }\n\n /**\n * @this {CompileContext}\n * @type {Handle}\n */\n function onexitautolinkemail(token) {\n onexitdata.call(this, token);\n const node = this.stack[this.stack.length - 1];\n node.url = 'mailto:' + this.sliceSerialize(token);\n }\n\n //\n // Creaters.\n //\n\n /** @returns {Blockquote} */\n function blockQuote() {\n return {\n type: 'blockquote',\n children: []\n };\n }\n\n /** @returns {Code} */\n function codeFlow() {\n return {\n type: 'code',\n lang: null,\n meta: null,\n value: ''\n };\n }\n\n /** @returns {InlineCode} */\n function codeText() {\n return {\n type: 'inlineCode',\n value: ''\n };\n }\n\n /** @returns {Definition} */\n function definition() {\n return {\n type: 'definition',\n identifier: '',\n label: null,\n title: null,\n url: ''\n };\n }\n\n /** @returns {Emphasis} */\n function emphasis() {\n return {\n type: 'emphasis',\n children: []\n };\n }\n\n /** @returns {Heading} */\n function heading() {\n return {\n type: 'heading',\n // @ts-expect-error `depth` will be set later.\n depth: 0,\n children: []\n };\n }\n\n /** @returns {Break} */\n function hardBreak() {\n return {\n type: 'break'\n };\n }\n\n /** @returns {Html} */\n function html() {\n return {\n type: 'html',\n value: ''\n };\n }\n\n /** @returns {Image} */\n function image() {\n return {\n type: 'image',\n title: null,\n url: '',\n alt: null\n };\n }\n\n /** @returns {Link} */\n function link() {\n return {\n type: 'link',\n title: null,\n url: '',\n children: []\n };\n }\n\n /**\n * @param {Token} token\n * @returns {List}\n */\n function list(token) {\n return {\n type: 'list',\n ordered: token.type === 'listOrdered',\n start: null,\n spread: token._spread,\n children: []\n };\n }\n\n /**\n * @param {Token} token\n * @returns {ListItem}\n */\n function listItem(token) {\n return {\n type: 'listItem',\n spread: token._spread,\n checked: null,\n children: []\n };\n }\n\n /** @returns {Paragraph} */\n function paragraph() {\n return {\n type: 'paragraph',\n children: []\n };\n }\n\n /** @returns {Strong} */\n function strong() {\n return {\n type: 'strong',\n children: []\n };\n }\n\n /** @returns {Text} */\n function text() {\n return {\n type: 'text',\n value: ''\n };\n }\n\n /** @returns {ThematicBreak} */\n function thematicBreak() {\n return {\n type: 'thematicBreak'\n };\n }\n}\n\n/**\n * Copy a point-like value.\n *\n * @param {Point} d\n * Point-like value.\n * @returns {Point}\n * unist point.\n */\nfunction point(d) {\n return {\n line: d.line,\n column: d.column,\n offset: d.offset\n };\n}\n\n/**\n * @param {Config} combined\n * @param {Array | Extension>} extensions\n * @returns {undefined}\n */\nfunction configure(combined, extensions) {\n let index = -1;\n while (++index < extensions.length) {\n const value = extensions[index];\n if (Array.isArray(value)) {\n configure(combined, value);\n } else {\n extension(combined, value);\n }\n }\n}\n\n/**\n * @param {Config} combined\n * @param {Extension} extension\n * @returns {undefined}\n */\nfunction extension(combined, extension) {\n /** @type {keyof Extension} */\n let key;\n for (key in extension) {\n if (own.call(extension, key)) {\n switch (key) {\n case 'canContainEols':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'transforms':\n {\n const right = extension[key];\n if (right) {\n combined[key].push(...right);\n }\n break;\n }\n case 'enter':\n case 'exit':\n {\n const right = extension[key];\n if (right) {\n Object.assign(combined[key], right);\n }\n break;\n }\n // No default\n }\n }\n }\n}\n\n/** @type {OnEnterError} */\nfunction defaultOnError(left, right) {\n if (left) {\n throw new Error('Cannot close `' + left.type + '` (' + stringifyPosition({\n start: left.start,\n end: left.end\n }) + '): a different token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is open');\n } else {\n throw new Error('Cannot close document, a token (`' + right.type + '`, ' + stringifyPosition({\n start: right.start,\n end: right.end\n }) + ') is still open');\n }\n}", "/**\n * @typedef {import('mdast').Root} Root\n * @typedef {import('mdast-util-from-markdown').Options} FromMarkdownOptions\n * @typedef {import('unified').Parser} Parser\n * @typedef {import('unified').Processor} Processor\n */\n\n/**\n * @typedef {Omit} Options\n */\n\nimport {fromMarkdown} from 'mdast-util-from-markdown'\n\n/**\n * Aadd support for parsing from markdown.\n *\n * @param {Readonly | null | undefined} [options]\n * Configuration (optional).\n * @returns {undefined}\n * Nothing.\n */\nexport default function remarkParse(options) {\n /** @type {Processor} */\n // @ts-expect-error: TS in JSDoc generates wrong types if `this` is typed regularly.\n const self = this\n\n self.parser = parser\n\n /**\n * @type {Parser}\n */\n function parser(doc) {\n return fromMarkdown(doc, {\n ...self.data('settings'),\n ...options,\n // Note: these options are not in the readme.\n // The goal is for them to be set by plugins on `data` instead of being\n // passed by users.\n extensions: self.data('micromarkExtensions') || [],\n mdastExtensions: self.data('fromMarkdownExtensions') || []\n })\n }\n}\n", "export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it\u2019s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns\u2019 stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n", "/**\n * @import {Nodes, Parents, PhrasingContent, Root, Text} from 'mdast'\n * @import {BuildVisitor, Test, VisitorResult} from 'unist-util-visit-parents'\n */\n\n/**\n * @typedef RegExpMatchObject\n * Info on the match.\n * @property {number} index\n * The index of the search at which the result was found.\n * @property {string} input\n * A copy of the search string in the text node.\n * @property {[...Array, Text]} stack\n * All ancestors of the text node, where the last node is the text itself.\n *\n * @typedef {RegExp | string} Find\n * Pattern to find.\n *\n * Strings are escaped and then turned into global expressions.\n *\n * @typedef {Array} FindAndReplaceList\n * Several find and replaces, in array form.\n *\n * @typedef {[Find, Replace?]} FindAndReplaceTuple\n * Find and replace in tuple form.\n *\n * @typedef {ReplaceFunction | string | null | undefined} Replace\n * Thing to replace with.\n *\n * @callback ReplaceFunction\n * Callback called when a search matches.\n * @param {...any} parameters\n * The parameters are the result of corresponding search expression:\n *\n * * `value` (`string`) \u2014 whole match\n * * `...capture` (`Array`) \u2014 matches from regex capture groups\n * * `match` (`RegExpMatchObject`) \u2014 info on the match\n * @returns {Array | PhrasingContent | string | false | null | undefined}\n * Thing to replace with.\n *\n * * when `null`, `undefined`, `''`, remove the match\n * * \u2026or when `false`, do not replace at all\n * * \u2026or when `string`, replace with a text node of that value\n * * \u2026or when `Node` or `Array`, replace with those nodes\n *\n * @typedef {[RegExp, ReplaceFunction]} Pair\n * Normalized find and replace.\n *\n * @typedef {Array} Pairs\n * All find and replaced.\n *\n * @typedef Options\n * Configuration.\n * @property {Test | null | undefined} [ignore]\n * Test for which nodes to ignore (optional).\n */\n\nimport escape from 'escape-string-regexp'\nimport {visitParents} from 'unist-util-visit-parents'\nimport {convert} from 'unist-util-is'\n\n/**\n * Find patterns in a tree and replace them.\n *\n * The algorithm searches the tree in *preorder* for complete values in `Text`\n * nodes.\n * Partial matches are not supported.\n *\n * @param {Nodes} tree\n * Tree to change.\n * @param {FindAndReplaceList | FindAndReplaceTuple} list\n * Patterns to find.\n * @param {Options | null | undefined} [options]\n * Configuration (when `find` is not `Find`).\n * @returns {undefined}\n * Nothing.\n */\nexport function findAndReplace(tree, list, options) {\n const settings = options || {}\n const ignored = convert(settings.ignore || [])\n const pairs = toPairs(list)\n let pairIndex = -1\n\n while (++pairIndex < pairs.length) {\n visitParents(tree, 'text', visitor)\n }\n\n /** @type {BuildVisitor} */\n function visitor(node, parents) {\n let index = -1\n /** @type {Parents | undefined} */\n let grandparent\n\n while (++index < parents.length) {\n const parent = parents[index]\n /** @type {Array | undefined} */\n const siblings = grandparent ? grandparent.children : undefined\n\n if (\n ignored(\n parent,\n siblings ? siblings.indexOf(parent) : undefined,\n grandparent\n )\n ) {\n return\n }\n\n grandparent = parent\n }\n\n if (grandparent) {\n return handler(node, parents)\n }\n }\n\n /**\n * Handle a text node which is not in an ignored parent.\n *\n * @param {Text} node\n * Text node.\n * @param {Array} parents\n * Parents.\n * @returns {VisitorResult}\n * Result.\n */\n function handler(node, parents) {\n const parent = parents[parents.length - 1]\n const find = pairs[pairIndex][0]\n const replace = pairs[pairIndex][1]\n let start = 0\n /** @type {Array} */\n const siblings = parent.children\n const index = siblings.indexOf(node)\n let change = false\n /** @type {Array} */\n let nodes = []\n\n find.lastIndex = 0\n\n let match = find.exec(node.value)\n\n while (match) {\n const position = match.index\n /** @type {RegExpMatchObject} */\n const matchObject = {\n index: match.index,\n input: match.input,\n stack: [...parents, node]\n }\n let value = replace(...match, matchObject)\n\n if (typeof value === 'string') {\n value = value.length > 0 ? {type: 'text', value} : undefined\n }\n\n // It wasn\u2019t a match after all.\n if (value === false) {\n // False acts as if there was no match.\n // So we need to reset `lastIndex`, which currently being at the end of\n // the current match, to the beginning.\n find.lastIndex = position + 1\n } else {\n if (start !== position) {\n nodes.push({\n type: 'text',\n value: node.value.slice(start, position)\n })\n }\n\n if (Array.isArray(value)) {\n nodes.push(...value)\n } else if (value) {\n nodes.push(value)\n }\n\n start = position + match[0].length\n change = true\n }\n\n if (!find.global) {\n break\n }\n\n match = find.exec(node.value)\n }\n\n if (change) {\n if (start < node.value.length) {\n nodes.push({type: 'text', value: node.value.slice(start)})\n }\n\n parent.children.splice(index, 1, ...nodes)\n } else {\n nodes = [node]\n }\n\n return index + nodes.length\n }\n}\n\n/**\n * Turn a tuple or a list of tuples into pairs.\n *\n * @param {FindAndReplaceList | FindAndReplaceTuple} tupleOrList\n * Schema.\n * @returns {Pairs}\n * Clean pairs.\n */\nfunction toPairs(tupleOrList) {\n /** @type {Pairs} */\n const result = []\n\n if (!Array.isArray(tupleOrList)) {\n throw new TypeError('Expected find and replace tuple or list of tuples')\n }\n\n /** @type {FindAndReplaceList} */\n // @ts-expect-error: correct.\n const list =\n !tupleOrList[0] || Array.isArray(tupleOrList[0])\n ? tupleOrList\n : [tupleOrList]\n\n let index = -1\n\n while (++index < list.length) {\n const tuple = list[index]\n result.push([toExpression(tuple[0]), toFunction(tuple[1])])\n }\n\n return result\n}\n\n/**\n * Turn a find into an expression.\n *\n * @param {Find} find\n * Find.\n * @returns {RegExp}\n * Expression.\n */\nfunction toExpression(find) {\n return typeof find === 'string' ? new RegExp(escape(find), 'g') : find\n}\n\n/**\n * Turn a replace into a function.\n *\n * @param {Replace} replace\n * Replace.\n * @returns {ReplaceFunction}\n * Function.\n */\nfunction toFunction(replace) {\n return typeof replace === 'function'\n ? replace\n : function () {\n return replace\n }\n}\n", "/**\n * @import {RegExpMatchObject, ReplaceFunction} from 'mdast-util-find-and-replace'\n * @import {CompileContext, Extension as FromMarkdownExtension, Handle as FromMarkdownHandle, Transform as FromMarkdownTransform} from 'mdast-util-from-markdown'\n * @import {ConstructName, Options as ToMarkdownExtension} from 'mdast-util-to-markdown'\n * @import {Link, PhrasingContent} from 'mdast'\n */\n\nimport {ccount} from 'ccount'\nimport {ok as assert} from 'devlop'\nimport {unicodePunctuation, unicodeWhitespace} from 'micromark-util-character'\nimport {findAndReplace} from 'mdast-util-find-and-replace'\n\n/** @type {ConstructName} */\nconst inConstruct = 'phrasing'\n/** @type {Array} */\nconst notInConstruct = ['autolink', 'link', 'image', 'label']\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralFromMarkdown() {\n return {\n transforms: [transformGfmAutolinkLiterals],\n enter: {\n literalAutolink: enterLiteralAutolink,\n literalAutolinkEmail: enterLiteralAutolinkValue,\n literalAutolinkHttp: enterLiteralAutolinkValue,\n literalAutolinkWww: enterLiteralAutolinkValue\n },\n exit: {\n literalAutolink: exitLiteralAutolink,\n literalAutolinkEmail: exitLiteralAutolinkEmail,\n literalAutolinkHttp: exitLiteralAutolinkHttp,\n literalAutolinkWww: exitLiteralAutolinkWww\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM autolink\n * literals in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM autolink literals.\n */\nexport function gfmAutolinkLiteralToMarkdown() {\n return {\n unsafe: [\n {\n character: '@',\n before: '[+\\\\-.\\\\w]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: '.',\n before: '[Ww]',\n after: '[\\\\-.\\\\w]',\n inConstruct,\n notInConstruct\n },\n {\n character: ':',\n before: '[ps]',\n after: '\\\\/',\n inConstruct,\n notInConstruct\n }\n ]\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolink(token) {\n this.enter({type: 'link', title: null, url: '', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterLiteralAutolinkValue(token) {\n this.config.enter.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkHttp(token) {\n this.config.exit.autolinkProtocol.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkWww(token) {\n this.config.exit.data.call(this, token)\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'link')\n node.url = 'http://' + this.sliceSerialize(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolinkEmail(token) {\n this.config.exit.autolinkEmail.call(this, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitLiteralAutolink(token) {\n this.exit(token)\n}\n\n/** @type {FromMarkdownTransform} */\nfunction transformGfmAutolinkLiterals(tree) {\n findAndReplace(\n tree,\n [\n [/(https?:\\/\\/|www(?=\\.))([-.\\w]+)([^ \\t\\r\\n]*)/gi, findUrl],\n [/(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)/gu, findEmail]\n ],\n {ignore: ['link', 'linkReference']}\n )\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} protocol\n * @param {string} domain\n * @param {string} path\n * @param {RegExpMatchObject} match\n * @returns {Array | Link | false}\n */\n// eslint-disable-next-line max-params\nfunction findUrl(_, protocol, domain, path, match) {\n let prefix = ''\n\n // Not an expected previous character.\n if (!previous(match)) {\n return false\n }\n\n // Treat `www` as part of the domain.\n if (/^w/i.test(protocol)) {\n domain = protocol + domain\n protocol = ''\n prefix = 'http://'\n }\n\n if (!isCorrectDomain(domain)) {\n return false\n }\n\n const parts = splitUrl(domain + path)\n\n if (!parts[0]) return false\n\n /** @type {Link} */\n const result = {\n type: 'link',\n title: null,\n url: prefix + protocol + parts[0],\n children: [{type: 'text', value: protocol + parts[0]}]\n }\n\n if (parts[1]) {\n return [result, {type: 'text', value: parts[1]}]\n }\n\n return result\n}\n\n/**\n * @type {ReplaceFunction}\n * @param {string} _\n * @param {string} atext\n * @param {string} label\n * @param {RegExpMatchObject} match\n * @returns {Link | false}\n */\nfunction findEmail(_, atext, label, match) {\n if (\n // Not an expected previous character.\n !previous(match, true) ||\n // Label ends in not allowed character.\n /[-\\d_]$/.test(label)\n ) {\n return false\n }\n\n return {\n type: 'link',\n title: null,\n url: 'mailto:' + atext + '@' + label,\n children: [{type: 'text', value: atext + '@' + label}]\n }\n}\n\n/**\n * @param {string} domain\n * @returns {boolean}\n */\nfunction isCorrectDomain(domain) {\n const parts = domain.split('.')\n\n if (\n parts.length < 2 ||\n (parts[parts.length - 1] &&\n (/_/.test(parts[parts.length - 1]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 1]))) ||\n (parts[parts.length - 2] &&\n (/_/.test(parts[parts.length - 2]) ||\n !/[a-zA-Z\\d]/.test(parts[parts.length - 2])))\n ) {\n return false\n }\n\n return true\n}\n\n/**\n * @param {string} url\n * @returns {[string, string | undefined]}\n */\nfunction splitUrl(url) {\n const trailExec = /[!\"&'),.:;<>?\\]}]+$/.exec(url)\n\n if (!trailExec) {\n return [url, undefined]\n }\n\n url = url.slice(0, trailExec.index)\n\n let trail = trailExec[0]\n let closingParenIndex = trail.indexOf(')')\n const openingParens = ccount(url, '(')\n let closingParens = ccount(url, ')')\n\n while (closingParenIndex !== -1 && openingParens > closingParens) {\n url += trail.slice(0, closingParenIndex + 1)\n trail = trail.slice(closingParenIndex + 1)\n closingParenIndex = trail.indexOf(')')\n closingParens++\n }\n\n return [url, trail]\n}\n\n/**\n * @param {RegExpMatchObject} match\n * @param {boolean | null | undefined} [email=false]\n * @returns {boolean}\n */\nfunction previous(match, email) {\n const code = match.input.charCodeAt(match.index - 1)\n\n return (\n (match.index === 0 ||\n unicodeWhitespace(code) ||\n unicodePunctuation(code)) &&\n // If it\u2019s an email, the previous character should not be a slash.\n (!email || code !== 47)\n )\n}\n", "/**\n * @import {\n * CompileContext,\n * Extension as FromMarkdownExtension,\n * Handle as FromMarkdownHandle\n * } from 'mdast-util-from-markdown'\n * @import {ToMarkdownOptions} from 'mdast-util-gfm-footnote'\n * @import {\n * Handle as ToMarkdownHandle,\n * Map,\n * Options as ToMarkdownExtension\n * } from 'mdast-util-to-markdown'\n * @import {FootnoteDefinition, FootnoteReference} from 'mdast'\n */\n\nimport {ok as assert} from 'devlop'\nimport {normalizeIdentifier} from 'micromark-util-normalize-identifier'\n\nfootnoteReference.peek = footnoteReferencePeek\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCallString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteCall(token) {\n this.enter({type: 'footnoteReference', identifier: '', label: ''}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinitionLabelString() {\n this.buffer()\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterFootnoteDefinition(token) {\n this.enter(\n {type: 'footnoteDefinition', identifier: '', label: '', children: []},\n token\n )\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCallString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteReference')\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n node.label = label\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteCall(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinitionLabelString(token) {\n const label = this.resume()\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'footnoteDefinition')\n node.identifier = normalizeIdentifier(\n this.sliceSerialize(token)\n ).toLowerCase()\n node.label = label\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitFootnoteDefinition(token) {\n this.exit(token)\n}\n\n/** @type {ToMarkdownHandle} */\nfunction footnoteReferencePeek() {\n return '['\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {FootnoteReference} node\n */\nfunction footnoteReference(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteReference')\n const subexit = state.enter('reference')\n value += tracker.move(\n state.safe(state.associationId(node), {after: ']', before: value})\n )\n subexit()\n exit()\n value += tracker.move(']')\n return value\n}\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown`.\n */\nexport function gfmFootnoteFromMarkdown() {\n return {\n enter: {\n gfmFootnoteCallString: enterFootnoteCallString,\n gfmFootnoteCall: enterFootnoteCall,\n gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: enterFootnoteDefinition\n },\n exit: {\n gfmFootnoteCallString: exitFootnoteCallString,\n gfmFootnoteCall: exitFootnoteCall,\n gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,\n gfmFootnoteDefinition: exitFootnoteDefinition\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes\n * in markdown.\n *\n * @param {ToMarkdownOptions | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown`.\n */\nexport function gfmFootnoteToMarkdown(options) {\n // To do: next major: change default.\n let firstLineBlank = false\n\n if (options && options.firstLineBlank) {\n firstLineBlank = true\n }\n\n return {\n handlers: {footnoteDefinition, footnoteReference},\n // This is on by default already.\n unsafe: [{character: '[', inConstruct: ['label', 'phrasing', 'reference']}]\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {FootnoteDefinition} node\n */\n function footnoteDefinition(node, _, state, info) {\n const tracker = state.createTracker(info)\n let value = tracker.move('[^')\n const exit = state.enter('footnoteDefinition')\n const subexit = state.enter('label')\n value += tracker.move(\n state.safe(state.associationId(node), {before: value, after: ']'})\n )\n subexit()\n\n value += tracker.move(']:')\n\n if (node.children && node.children.length > 0) {\n tracker.shift(4)\n\n value += tracker.move(\n (firstLineBlank ? '\\n' : ' ') +\n state.indentLines(\n state.containerFlow(node, tracker.current()),\n firstLineBlank ? mapAll : mapExceptFirst\n )\n )\n }\n\n exit()\n\n return value\n }\n}\n\n/** @type {Map} */\nfunction mapExceptFirst(line, index, blank) {\n return index === 0 ? line : mapAll(line, index, blank)\n}\n\n/** @type {Map} */\nfunction mapAll(line, index, blank) {\n return (blank ? '' : ' ') + line\n}\n", "/**\n * @typedef {import('mdast').Delete} Delete\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n */\n\n/**\n * List of constructs that occur in phrasing (paragraphs, headings), but cannot\n * contain strikethrough.\n * So they sort of cancel each other out.\n * Note: could use a better name.\n *\n * Note: keep in sync with: \n *\n * @type {Array}\n */\nconst constructsWithoutStrikethrough = [\n 'autolink',\n 'destinationLiteral',\n 'destinationRaw',\n 'reference',\n 'titleQuote',\n 'titleApostrophe'\n]\n\nhandleDelete.peek = peekDelete\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughFromMarkdown() {\n return {\n canContainEols: ['delete'],\n enter: {strikethrough: enterStrikethrough},\n exit: {strikethrough: exitStrikethrough}\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM\n * strikethrough in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM strikethrough.\n */\nexport function gfmStrikethroughToMarkdown() {\n return {\n unsafe: [\n {\n character: '~',\n inConstruct: 'phrasing',\n notInConstruct: constructsWithoutStrikethrough\n }\n ],\n handlers: {delete: handleDelete}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterStrikethrough(token) {\n this.enter({type: 'delete', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitStrikethrough(token) {\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {Delete} node\n */\nfunction handleDelete(node, _, state, info) {\n const tracker = state.createTracker(info)\n const exit = state.enter('strikethrough')\n let value = tracker.move('~~')\n value += state.containerPhrasing(node, {\n ...tracker.current(),\n before: value,\n after: '~'\n })\n value += tracker.move('~~')\n exit()\n return value\n}\n\n/** @type {ToMarkdownHandle} */\nfunction peekDelete() {\n return '~'\n}\n", "// To do: next major: remove.\n/**\n * @typedef {Options} MarkdownTableOptions\n * Configuration.\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [alignDelimiters=true]\n * Whether to align the delimiters (default: `true`);\n * they are aligned by default:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * Pass `false` to make them staggered:\n *\n * ```markdown\n * | Alpha | B |\n * | - | - |\n * | C | Delta |\n * ```\n * @property {ReadonlyArray | string | null | undefined} [align]\n * How to align columns (default: `''`);\n * one style for all columns or styles for their respective columns;\n * each style is either `'l'` (left), `'r'` (right), or `'c'` (center);\n * other values are treated as `''`, which doesn\u2019t place the colon in the\n * alignment row but does align left;\n * *only the lowercased first character is used, so `Right` is fine.*\n * @property {boolean | null | undefined} [delimiterEnd=true]\n * Whether to end each row with the delimiter (default: `true`).\n *\n * > \uD83D\uDC49 **Note**: please don\u2019t use this: it could create fragile structures\n * > that aren\u2019t understandable to some markdown parsers.\n *\n * When `true`, there are ending delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no ending delimiters:\n *\n * ```markdown\n * | Alpha | B\n * | ----- | -----\n * | C | Delta\n * ```\n * @property {boolean | null | undefined} [delimiterStart=true]\n * Whether to begin each row with the delimiter (default: `true`).\n *\n * > \uD83D\uDC49 **Note**: please don\u2019t use this: it could create fragile structures\n * > that aren\u2019t understandable to some markdown parsers.\n *\n * When `true`, there are starting delimiters:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there are no starting delimiters:\n *\n * ```markdown\n * Alpha | B |\n * ----- | ----- |\n * C | Delta |\n * ```\n * @property {boolean | null | undefined} [padding=true]\n * Whether to add a space of padding between delimiters and cells\n * (default: `true`).\n *\n * When `true`, there is padding:\n *\n * ```markdown\n * | Alpha | B |\n * | ----- | ----- |\n * | C | Delta |\n * ```\n *\n * When `false`, there is no padding:\n *\n * ```markdown\n * |Alpha|B |\n * |-----|-----|\n * |C |Delta|\n * ```\n * @property {((value: string) => number) | null | undefined} [stringLength]\n * Function to detect the length of table cell content (optional);\n * this is used when aligning the delimiters (`|`) between table cells;\n * full-width characters and emoji mess up delimiter alignment when viewing\n * the markdown source;\n * to fix this, you can pass this function,\n * which receives the cell content and returns its \u201Cvisible\u201D size;\n * note that what is and isn\u2019t visible depends on where the text is displayed.\n *\n * Without such a function, the following:\n *\n * ```js\n * markdownTable([\n * ['Alpha', 'Bravo'],\n * ['\u4E2D\u6587', 'Charlie'],\n * ['\uD83D\uDC69\u200D\u2764\uFE0F\u200D\uD83D\uDC69', 'Delta']\n * ])\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | - | - |\n * | \u4E2D\u6587 | Charlie |\n * | \uD83D\uDC69\u200D\u2764\uFE0F\u200D\uD83D\uDC69 | Delta |\n * ```\n *\n * With [`string-width`](https://github.com/sindresorhus/string-width):\n *\n * ```js\n * import stringWidth from 'string-width'\n *\n * markdownTable(\n * [\n * ['Alpha', 'Bravo'],\n * ['\u4E2D\u6587', 'Charlie'],\n * ['\uD83D\uDC69\u200D\u2764\uFE0F\u200D\uD83D\uDC69', 'Delta']\n * ],\n * {stringLength: stringWidth}\n * )\n * ```\n *\n * Yields:\n *\n * ```markdown\n * | Alpha | Bravo |\n * | ----- | ------- |\n * | \u4E2D\u6587 | Charlie |\n * | \uD83D\uDC69\u200D\u2764\uFE0F\u200D\uD83D\uDC69 | Delta |\n * ```\n */\n\n/**\n * @param {string} value\n * Cell value.\n * @returns {number}\n * Cell size.\n */\nfunction defaultStringLength(value) {\n return value.length\n}\n\n/**\n * Generate a markdown\n * ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables))\n * table.\n *\n * @param {ReadonlyArray>} table\n * Table data (matrix of strings).\n * @param {Readonly | null | undefined} [options]\n * Configuration (optional).\n * @returns {string}\n * Result.\n */\nexport function markdownTable(table, options) {\n const settings = options || {}\n // To do: next major: change to spread.\n const align = (settings.align || []).concat()\n const stringLength = settings.stringLength || defaultStringLength\n /** @type {Array} Character codes as symbols for alignment per column. */\n const alignments = []\n /** @type {Array>} Cells per row. */\n const cellMatrix = []\n /** @type {Array>} Sizes of each cell per row. */\n const sizeMatrix = []\n /** @type {Array} */\n const longestCellByColumn = []\n let mostCellsPerRow = 0\n let rowIndex = -1\n\n // This is a superfluous loop if we don\u2019t align delimiters, but otherwise we\u2019d\n // do superfluous work when aligning, so optimize for aligning.\n while (++rowIndex < table.length) {\n /** @type {Array} */\n const row = []\n /** @type {Array} */\n const sizes = []\n let columnIndex = -1\n\n if (table[rowIndex].length > mostCellsPerRow) {\n mostCellsPerRow = table[rowIndex].length\n }\n\n while (++columnIndex < table[rowIndex].length) {\n const cell = serialize(table[rowIndex][columnIndex])\n\n if (settings.alignDelimiters !== false) {\n const size = stringLength(cell)\n sizes[columnIndex] = size\n\n if (\n longestCellByColumn[columnIndex] === undefined ||\n size > longestCellByColumn[columnIndex]\n ) {\n longestCellByColumn[columnIndex] = size\n }\n }\n\n row.push(cell)\n }\n\n cellMatrix[rowIndex] = row\n sizeMatrix[rowIndex] = sizes\n }\n\n // Figure out which alignments to use.\n let columnIndex = -1\n\n if (typeof align === 'object' && 'length' in align) {\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = toAlignment(align[columnIndex])\n }\n } else {\n const code = toAlignment(align)\n\n while (++columnIndex < mostCellsPerRow) {\n alignments[columnIndex] = code\n }\n }\n\n // Inject the alignment row.\n columnIndex = -1\n /** @type {Array} */\n const row = []\n /** @type {Array} */\n const sizes = []\n\n while (++columnIndex < mostCellsPerRow) {\n const code = alignments[columnIndex]\n let before = ''\n let after = ''\n\n if (code === 99 /* `c` */) {\n before = ':'\n after = ':'\n } else if (code === 108 /* `l` */) {\n before = ':'\n } else if (code === 114 /* `r` */) {\n after = ':'\n }\n\n // There *must* be at least one hyphen-minus in each alignment cell.\n let size =\n settings.alignDelimiters === false\n ? 1\n : Math.max(\n 1,\n longestCellByColumn[columnIndex] - before.length - after.length\n )\n\n const cell = before + '-'.repeat(size) + after\n\n if (settings.alignDelimiters !== false) {\n size = before.length + size + after.length\n\n if (size > longestCellByColumn[columnIndex]) {\n longestCellByColumn[columnIndex] = size\n }\n\n sizes[columnIndex] = size\n }\n\n row[columnIndex] = cell\n }\n\n // Inject the alignment row.\n cellMatrix.splice(1, 0, row)\n sizeMatrix.splice(1, 0, sizes)\n\n rowIndex = -1\n /** @type {Array} */\n const lines = []\n\n while (++rowIndex < cellMatrix.length) {\n const row = cellMatrix[rowIndex]\n const sizes = sizeMatrix[rowIndex]\n columnIndex = -1\n /** @type {Array} */\n const line = []\n\n while (++columnIndex < mostCellsPerRow) {\n const cell = row[columnIndex] || ''\n let before = ''\n let after = ''\n\n if (settings.alignDelimiters !== false) {\n const size =\n longestCellByColumn[columnIndex] - (sizes[columnIndex] || 0)\n const code = alignments[columnIndex]\n\n if (code === 114 /* `r` */) {\n before = ' '.repeat(size)\n } else if (code === 99 /* `c` */) {\n if (size % 2) {\n before = ' '.repeat(size / 2 + 0.5)\n after = ' '.repeat(size / 2 - 0.5)\n } else {\n before = ' '.repeat(size / 2)\n after = before\n }\n } else {\n after = ' '.repeat(size)\n }\n }\n\n if (settings.delimiterStart !== false && !columnIndex) {\n line.push('|')\n }\n\n if (\n settings.padding !== false &&\n // Don\u2019t add the opening space if we\u2019re not aligning and the cell is\n // empty: there will be a closing space.\n !(settings.alignDelimiters === false && cell === '') &&\n (settings.delimiterStart !== false || columnIndex)\n ) {\n line.push(' ')\n }\n\n if (settings.alignDelimiters !== false) {\n line.push(before)\n }\n\n line.push(cell)\n\n if (settings.alignDelimiters !== false) {\n line.push(after)\n }\n\n if (settings.padding !== false) {\n line.push(' ')\n }\n\n if (\n settings.delimiterEnd !== false ||\n columnIndex !== mostCellsPerRow - 1\n ) {\n line.push('|')\n }\n }\n\n lines.push(\n settings.delimiterEnd === false\n ? line.join('').replace(/ +$/, '')\n : line.join('')\n )\n }\n\n return lines.join('\\n')\n}\n\n/**\n * @param {string | null | undefined} [value]\n * Value to serialize.\n * @returns {string}\n * Result.\n */\nfunction serialize(value) {\n return value === null || value === undefined ? '' : String(value)\n}\n\n/**\n * @param {string | null | undefined} value\n * Value.\n * @returns {number}\n * Alignment.\n */\nfunction toAlignment(value) {\n const code = typeof value === 'string' ? value.codePointAt(0) : 0\n\n return code === 67 /* `C` */ || code === 99 /* `c` */\n ? 99 /* `c` */\n : code === 76 /* `L` */ || code === 108 /* `l` */\n ? 108 /* `l` */\n : code === 82 /* `R` */ || code === 114 /* `r` */\n ? 114 /* `r` */\n : 0\n}\n", "/**\n * @import {Blockquote, Parents} from 'mdast'\n * @import {Info, Map, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {Blockquote} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function blockquote(node, _, state, info) {\n const exit = state.enter('blockquote')\n const tracker = state.createTracker(info)\n tracker.move('> ')\n tracker.shift(2)\n const value = state.indentLines(\n state.containerFlow(node, tracker.current()),\n map\n )\n exit()\n return value\n}\n\n/** @type {Map} */\nfunction map(line, _, blank) {\n return '>' + (blank ? '' : ' ') + line\n}\n", "/**\n * @import {ConstructName, Unsafe} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {Array} stack\n * @param {Unsafe} pattern\n * @returns {boolean}\n */\nexport function patternInScope(stack, pattern) {\n return (\n listInScope(stack, pattern.inConstruct, true) &&\n !listInScope(stack, pattern.notInConstruct, false)\n )\n}\n\n/**\n * @param {Array} stack\n * @param {Unsafe['inConstruct']} list\n * @param {boolean} none\n * @returns {boolean}\n */\nfunction listInScope(stack, list, none) {\n if (typeof list === 'string') {\n list = [list]\n }\n\n if (!list || list.length === 0) {\n return none\n }\n\n let index = -1\n\n while (++index < list.length) {\n if (stack.includes(list[index])) {\n return true\n }\n }\n\n return false\n}\n", "/**\n * @import {Break, Parents} from 'mdast'\n * @import {Info, State} from 'mdast-util-to-markdown'\n */\n\nimport {patternInScope} from '../util/pattern-in-scope.js'\n\n/**\n * @param {Break} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function hardBreak(_, _1, state, info) {\n let index = -1\n\n while (++index < state.unsafe.length) {\n // If we can\u2019t put eols in this construct (setext headings, tables), use a\n // space instead.\n if (\n state.unsafe[index].character === '\\n' &&\n patternInScope(state.stack, state.unsafe[index])\n ) {\n return /[ \\t]/.test(info.before) ? '' : ' '\n }\n }\n\n return '\\\\\\n'\n}\n", "/**\n * Get the count of the longest repeating streak of `substring` in `value`.\n *\n * @param {string} value\n * Content to search in.\n * @param {string} substring\n * Substring to look for, typically one character.\n * @returns {number}\n * Count of most frequent adjacent `substring`s in `value`.\n */\nexport function longestStreak(value, substring) {\n const source = String(value)\n let index = source.indexOf(substring)\n let expected = index\n let count = 0\n let max = 0\n\n if (typeof substring !== 'string') {\n throw new TypeError('Expected substring')\n }\n\n while (index !== -1) {\n if (index === expected) {\n if (++count > max) {\n max = count\n }\n } else {\n count = 1\n }\n\n expected = index + substring.length\n index = source.indexOf(substring, expected)\n }\n\n return max\n}\n", "/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {Code} from 'mdast'\n */\n\n/**\n * @param {Code} node\n * @param {State} state\n * @returns {boolean}\n */\nexport function formatCodeAsIndented(node, state) {\n return Boolean(\n state.options.fences === false &&\n node.value &&\n // If there\u2019s no info\u2026\n !node.lang &&\n // And there\u2019s a non-whitespace character\u2026\n /[^ \\r\\n]/.test(node.value) &&\n // And the value doesn\u2019t start or end in a blank\u2026\n !/^[\\t ]*(?:[\\r\\n]|$)|(?:^|[\\r\\n])[\\t ]*$/.test(node.value)\n )\n}\n", "/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkFence(state) {\n const marker = state.options.fence || '`'\n\n if (marker !== '`' && marker !== '~') {\n throw new Error(\n 'Cannot serialize code with `' +\n marker +\n '` for `options.fence`, expected `` ` `` or `~`'\n )\n }\n\n return marker\n}\n", "/**\n * @import {Info, Map, State} from 'mdast-util-to-markdown'\n * @import {Code, Parents} from 'mdast'\n */\n\nimport {longestStreak} from 'longest-streak'\nimport {formatCodeAsIndented} from '../util/format-code-as-indented.js'\nimport {checkFence} from '../util/check-fence.js'\n\n/**\n * @param {Code} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function code(node, _, state, info) {\n const marker = checkFence(state)\n const raw = node.value || ''\n const suffix = marker === '`' ? 'GraveAccent' : 'Tilde'\n\n if (formatCodeAsIndented(node, state)) {\n const exit = state.enter('codeIndented')\n const value = state.indentLines(raw, map)\n exit()\n return value\n }\n\n const tracker = state.createTracker(info)\n const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3))\n const exit = state.enter('codeFenced')\n let value = tracker.move(sequence)\n\n if (node.lang) {\n const subexit = state.enter(`codeFencedLang${suffix}`)\n value += tracker.move(\n state.safe(node.lang, {\n before: value,\n after: ' ',\n encode: ['`'],\n ...tracker.current()\n })\n )\n subexit()\n }\n\n if (node.lang && node.meta) {\n const subexit = state.enter(`codeFencedMeta${suffix}`)\n value += tracker.move(' ')\n value += tracker.move(\n state.safe(node.meta, {\n before: value,\n after: '\\n',\n encode: ['`'],\n ...tracker.current()\n })\n )\n subexit()\n }\n\n value += tracker.move('\\n')\n\n if (raw) {\n value += tracker.move(raw + '\\n')\n }\n\n value += tracker.move(sequence)\n exit()\n return value\n}\n\n/** @type {Map} */\nfunction map(line, _, blank) {\n return (blank ? '' : ' ') + line\n}\n", "/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkQuote(state) {\n const marker = state.options.quote || '\"'\n\n if (marker !== '\"' && marker !== \"'\") {\n throw new Error(\n 'Cannot serialize title with `' +\n marker +\n '` for `options.quote`, expected `\"`, or `\\'`'\n )\n }\n\n return marker\n}\n", "/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Definition, Parents} from 'mdast'\n */\n\nimport {checkQuote} from '../util/check-quote.js'\n\n/**\n * @param {Definition} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function definition(node, _, state, info) {\n const quote = checkQuote(state)\n const suffix = quote === '\"' ? 'Quote' : 'Apostrophe'\n const exit = state.enter('definition')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('[')\n value += tracker.move(\n state.safe(state.associationId(node), {\n before: value,\n after: ']',\n ...tracker.current()\n })\n )\n value += tracker.move(']: ')\n\n subexit()\n\n if (\n // If there\u2019s no url, or\u2026\n !node.url ||\n // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node.url)\n ) {\n subexit = state.enter('destinationLiteral')\n value += tracker.move('<')\n value += tracker.move(\n state.safe(node.url, {before: value, after: '>', ...tracker.current()})\n )\n value += tracker.move('>')\n } else {\n // No whitespace, raw is prettier.\n subexit = state.enter('destinationRaw')\n value += tracker.move(\n state.safe(node.url, {\n before: value,\n after: node.title ? ' ' : '\\n',\n ...tracker.current()\n })\n )\n }\n\n subexit()\n\n if (node.title) {\n subexit = state.enter(`title${suffix}`)\n value += tracker.move(' ' + quote)\n value += tracker.move(\n state.safe(node.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n )\n value += tracker.move(quote)\n subexit()\n }\n\n exit()\n\n return value\n}\n", "/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkEmphasis(state) {\n const marker = state.options.emphasis || '*'\n\n if (marker !== '*' && marker !== '_') {\n throw new Error(\n 'Cannot serialize emphasis with `' +\n marker +\n '` for `options.emphasis`, expected `*`, or `_`'\n )\n }\n\n return marker\n}\n", "/**\n * Encode a code point as a character reference.\n *\n * @param {number} code\n * Code point to encode.\n * @returns {string}\n * Encoded character reference.\n */\nexport function encodeCharacterReference(code) {\n return '&#x' + code.toString(16).toUpperCase() + ';'\n}\n", "/**\n * @import {EncodeSides} from '../types.js'\n */\n\nimport {classifyCharacter} from 'micromark-util-classify-character'\n\n/**\n * Check whether to encode (as a character reference) the characters\n * surrounding an attention run.\n *\n * Which characters are around an attention run influence whether it works or\n * not.\n *\n * See for more info.\n * See this markdown in a particular renderer to see what works:\n *\n * ```markdown\n * | | A (letter inside) | B (punctuation inside) | C (whitespace inside) | D (nothing inside) |\n * | ----------------------- | ----------------- | ---------------------- | --------------------- | ------------------ |\n * | 1 (letter outside) | x*y*z | x*.*z | x* *z | x**z |\n * | 2 (punctuation outside) | .*y*. | .*.*. | .* *. | .**. |\n * | 3 (whitespace outside) | x *y* z | x *.* z | x * * z | x ** z |\n * | 4 (nothing outside) | *x* | *.* | * * | ** |\n * ```\n *\n * @param {number} outside\n * Code point on the outer side of the run.\n * @param {number} inside\n * Code point on the inner side of the run.\n * @param {'*' | '_'} marker\n * Marker of the run.\n * Underscores are handled more strictly (they form less often) than\n * asterisks.\n * @returns {EncodeSides}\n * Whether to encode characters.\n */\n// Important: punctuation must never be encoded.\n// Punctuation is solely used by markdown constructs.\n// And by encoding itself.\n// Encoding them will break constructs or double encode things.\nexport function encodeInfo(outside, inside, marker) {\n const outsideKind = classifyCharacter(outside)\n const insideKind = classifyCharacter(inside)\n\n // Letter outside:\n if (outsideKind === undefined) {\n return insideKind === undefined\n ? // Letter inside:\n // we have to encode *both* letters for `_` as it is looser.\n // it already forms for `*` (and GFMs `~`).\n marker === '_'\n ? {inside: true, outside: true}\n : {inside: false, outside: false}\n : insideKind === 1\n ? // Whitespace inside: encode both (letter, whitespace).\n {inside: true, outside: true}\n : // Punctuation inside: encode outer (letter)\n {inside: false, outside: true}\n }\n\n // Whitespace outside:\n if (outsideKind === 1) {\n return insideKind === undefined\n ? // Letter inside: already forms.\n {inside: false, outside: false}\n : insideKind === 1\n ? // Whitespace inside: encode both (whitespace).\n {inside: true, outside: true}\n : // Punctuation inside: already forms.\n {inside: false, outside: false}\n }\n\n // Punctuation outside:\n return insideKind === undefined\n ? // Letter inside: already forms.\n {inside: false, outside: false}\n : insideKind === 1\n ? // Whitespace inside: encode inner (whitespace).\n {inside: true, outside: false}\n : // Punctuation inside: already forms.\n {inside: false, outside: false}\n}\n", "/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Emphasis, Parents} from 'mdast'\n */\n\nimport {checkEmphasis} from '../util/check-emphasis.js'\nimport {encodeCharacterReference} from '../util/encode-character-reference.js'\nimport {encodeInfo} from '../util/encode-info.js'\n\nemphasis.peek = emphasisPeek\n\n/**\n * @param {Emphasis} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function emphasis(node, _, state, info) {\n const marker = checkEmphasis(state)\n const exit = state.enter('emphasis')\n const tracker = state.createTracker(info)\n const before = tracker.move(marker)\n\n let between = tracker.move(\n state.containerPhrasing(node, {\n after: marker,\n before,\n ...tracker.current()\n })\n )\n const betweenHead = between.charCodeAt(0)\n const open = encodeInfo(\n info.before.charCodeAt(info.before.length - 1),\n betweenHead,\n marker\n )\n\n if (open.inside) {\n between = encodeCharacterReference(betweenHead) + between.slice(1)\n }\n\n const betweenTail = between.charCodeAt(between.length - 1)\n const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker)\n\n if (close.inside) {\n between = between.slice(0, -1) + encodeCharacterReference(betweenTail)\n }\n\n const after = tracker.move(marker)\n\n exit()\n\n state.attentionEncodeSurroundingInfo = {\n after: close.outside,\n before: open.outside\n }\n return before + between + after\n}\n\n/**\n * @param {Emphasis} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @returns {string}\n */\nfunction emphasisPeek(_, _1, state) {\n return state.options.emphasis || '*'\n}\n", "/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {Heading} from 'mdast'\n */\n\nimport {EXIT, visit} from 'unist-util-visit'\nimport {toString} from 'mdast-util-to-string'\n\n/**\n * @param {Heading} node\n * @param {State} state\n * @returns {boolean}\n */\nexport function formatHeadingAsSetext(node, state) {\n let literalWithBreak = false\n\n // Look for literals with a line break.\n // Note that this also\n visit(node, function (node) {\n if (\n ('value' in node && /\\r?\\n|\\r/.test(node.value)) ||\n node.type === 'break'\n ) {\n literalWithBreak = true\n return EXIT\n }\n })\n\n return Boolean(\n (!node.depth || node.depth < 3) &&\n toString(node) &&\n (state.options.setext || literalWithBreak)\n )\n}\n", "/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Heading, Parents} from 'mdast'\n */\n\nimport {encodeCharacterReference} from '../util/encode-character-reference.js'\nimport {formatHeadingAsSetext} from '../util/format-heading-as-setext.js'\n\n/**\n * @param {Heading} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function heading(node, _, state, info) {\n const rank = Math.max(Math.min(6, node.depth || 1), 1)\n const tracker = state.createTracker(info)\n\n if (formatHeadingAsSetext(node, state)) {\n const exit = state.enter('headingSetext')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, {\n ...tracker.current(),\n before: '\\n',\n after: '\\n'\n })\n subexit()\n exit()\n\n return (\n value +\n '\\n' +\n (rank === 1 ? '=' : '-').repeat(\n // The whole size\u2026\n value.length -\n // Minus the position of the character after the last EOL (or\n // 0 if there is none)\u2026\n (Math.max(value.lastIndexOf('\\r'), value.lastIndexOf('\\n')) + 1)\n )\n )\n }\n\n const sequence = '#'.repeat(rank)\n const exit = state.enter('headingAtx')\n const subexit = state.enter('phrasing')\n\n // Note: for proper tracking, we should reset the output positions when there\n // is no content returned, because then the space is not output.\n // Practically, in that case, there is no content, so it doesn\u2019t matter that\n // we\u2019ve tracked one too many characters.\n tracker.move(sequence + ' ')\n\n let value = state.containerPhrasing(node, {\n before: '# ',\n after: '\\n',\n ...tracker.current()\n })\n\n if (/^[\\t ]/.test(value)) {\n // To do: what effect has the character reference on tracking?\n value = encodeCharacterReference(value.charCodeAt(0)) + value.slice(1)\n }\n\n value = value ? sequence + ' ' + value : sequence\n\n if (state.options.closeAtx) {\n value += ' ' + sequence\n }\n\n subexit()\n exit()\n\n return value\n}\n", "/**\n * @import {Html} from 'mdast'\n */\n\nhtml.peek = htmlPeek\n\n/**\n * @param {Html} node\n * @returns {string}\n */\nexport function html(node) {\n return node.value || ''\n}\n\n/**\n * @returns {string}\n */\nfunction htmlPeek() {\n return '<'\n}\n", "/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Image, Parents} from 'mdast'\n */\n\nimport {checkQuote} from '../util/check-quote.js'\n\nimage.peek = imagePeek\n\n/**\n * @param {Image} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function image(node, _, state, info) {\n const quote = checkQuote(state)\n const suffix = quote === '\"' ? 'Quote' : 'Apostrophe'\n const exit = state.enter('image')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('![')\n value += tracker.move(\n state.safe(node.alt, {before: value, after: ']', ...tracker.current()})\n )\n value += tracker.move('](')\n\n subexit()\n\n if (\n // If there\u2019s no url but there is a title\u2026\n (!node.url && node.title) ||\n // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node.url)\n ) {\n subexit = state.enter('destinationLiteral')\n value += tracker.move('<')\n value += tracker.move(\n state.safe(node.url, {before: value, after: '>', ...tracker.current()})\n )\n value += tracker.move('>')\n } else {\n // No whitespace, raw is prettier.\n subexit = state.enter('destinationRaw')\n value += tracker.move(\n state.safe(node.url, {\n before: value,\n after: node.title ? ' ' : ')',\n ...tracker.current()\n })\n )\n }\n\n subexit()\n\n if (node.title) {\n subexit = state.enter(`title${suffix}`)\n value += tracker.move(' ' + quote)\n value += tracker.move(\n state.safe(node.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n )\n value += tracker.move(quote)\n subexit()\n }\n\n value += tracker.move(')')\n exit()\n\n return value\n}\n\n/**\n * @returns {string}\n */\nfunction imagePeek() {\n return '!'\n}\n", "/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {ImageReference, Parents} from 'mdast'\n */\n\nimageReference.peek = imageReferencePeek\n\n/**\n * @param {ImageReference} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function imageReference(node, _, state, info) {\n const type = node.referenceType\n const exit = state.enter('imageReference')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('![')\n const alt = state.safe(node.alt, {\n before: value,\n after: ']',\n ...tracker.current()\n })\n value += tracker.move(alt + '][')\n\n subexit()\n // Hide the fact that we\u2019re in phrasing, because escapes don\u2019t work.\n const stack = state.stack\n state.stack = []\n subexit = state.enter('reference')\n // Note: for proper tracking, we should reset the output positions when we end\n // up making a `shortcut` reference, because then there is no brace output.\n // Practically, in that case, there is no content, so it doesn\u2019t matter that\n // we\u2019ve tracked one too many characters.\n const reference = state.safe(state.associationId(node), {\n before: value,\n after: ']',\n ...tracker.current()\n })\n subexit()\n state.stack = stack\n exit()\n\n if (type === 'full' || !alt || alt !== reference) {\n value += tracker.move(reference + ']')\n } else if (type === 'shortcut') {\n // Remove the unwanted `[`.\n value = value.slice(0, -1)\n } else {\n value += tracker.move(']')\n }\n\n return value\n}\n\n/**\n * @returns {string}\n */\nfunction imageReferencePeek() {\n return '!'\n}\n", "/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {InlineCode, Parents} from 'mdast'\n */\n\ninlineCode.peek = inlineCodePeek\n\n/**\n * @param {InlineCode} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @returns {string}\n */\nexport function inlineCode(node, _, state) {\n let value = node.value || ''\n let sequence = '`'\n let index = -1\n\n // If there is a single grave accent on its own in the code, use a fence of\n // two.\n // If there are two in a row, use one.\n while (new RegExp('(^|[^`])' + sequence + '([^`]|$)').test(value)) {\n sequence += '`'\n }\n\n // If this is not just spaces or eols (tabs don\u2019t count), and either the\n // first or last character are a space, eol, or tick, then pad with spaces.\n if (\n /[^ \\r\\n]/.test(value) &&\n ((/^[ \\r\\n]/.test(value) && /[ \\r\\n]$/.test(value)) || /^`|`$/.test(value))\n ) {\n value = ' ' + value + ' '\n }\n\n // We have a potential problem: certain characters after eols could result in\n // blocks being seen.\n // For example, if someone injected the string `'\\n# b'`, then that would\n // result in an ATX heading.\n // We can\u2019t escape characters in `inlineCode`, but because eols are\n // transformed to spaces when going from markdown to HTML anyway, we can swap\n // them out.\n while (++index < state.unsafe.length) {\n const pattern = state.unsafe[index]\n const expression = state.compilePattern(pattern)\n /** @type {RegExpExecArray | null} */\n let match\n\n // Only look for `atBreak`s.\n // Btw: note that `atBreak` patterns will always start the regex at LF or\n // CR.\n if (!pattern.atBreak) continue\n\n while ((match = expression.exec(value))) {\n let position = match.index\n\n // Support CRLF (patterns only look for one of the characters).\n if (\n value.charCodeAt(position) === 10 /* `\\n` */ &&\n value.charCodeAt(position - 1) === 13 /* `\\r` */\n ) {\n position--\n }\n\n value = value.slice(0, position) + ' ' + value.slice(match.index + 1)\n }\n }\n\n return sequence + value + sequence\n}\n\n/**\n * @returns {string}\n */\nfunction inlineCodePeek() {\n return '`'\n}\n", "/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {Link} from 'mdast'\n */\n\nimport {toString} from 'mdast-util-to-string'\n\n/**\n * @param {Link} node\n * @param {State} state\n * @returns {boolean}\n */\nexport function formatLinkAsAutolink(node, state) {\n const raw = toString(node)\n\n return Boolean(\n !state.options.resourceLink &&\n // If there\u2019s a url\u2026\n node.url &&\n // And there\u2019s a no title\u2026\n !node.title &&\n // And the content of `node` is a single text node\u2026\n node.children &&\n node.children.length === 1 &&\n node.children[0].type === 'text' &&\n // And if the url is the same as the content\u2026\n (raw === node.url || 'mailto:' + raw === node.url) &&\n // And that starts w/ a protocol\u2026\n /^[a-z][a-z+.-]+:/i.test(node.url) &&\n // And that doesn\u2019t contain ASCII control codes (character escapes and\n // references don\u2019t work), space, or angle brackets\u2026\n !/[\\0- <>\\u007F]/.test(node.url)\n )\n}\n", "/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Link, Parents} from 'mdast'\n * @import {Exit} from '../types.js'\n */\n\nimport {checkQuote} from '../util/check-quote.js'\nimport {formatLinkAsAutolink} from '../util/format-link-as-autolink.js'\n\nlink.peek = linkPeek\n\n/**\n * @param {Link} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function link(node, _, state, info) {\n const quote = checkQuote(state)\n const suffix = quote === '\"' ? 'Quote' : 'Apostrophe'\n const tracker = state.createTracker(info)\n /** @type {Exit} */\n let exit\n /** @type {Exit} */\n let subexit\n\n if (formatLinkAsAutolink(node, state)) {\n // Hide the fact that we\u2019re in phrasing, because escapes don\u2019t work.\n const stack = state.stack\n state.stack = []\n exit = state.enter('autolink')\n let value = tracker.move('<')\n value += tracker.move(\n state.containerPhrasing(node, {\n before: value,\n after: '>',\n ...tracker.current()\n })\n )\n value += tracker.move('>')\n exit()\n state.stack = stack\n return value\n }\n\n exit = state.enter('link')\n subexit = state.enter('label')\n let value = tracker.move('[')\n value += tracker.move(\n state.containerPhrasing(node, {\n before: value,\n after: '](',\n ...tracker.current()\n })\n )\n value += tracker.move('](')\n subexit()\n\n if (\n // If there\u2019s no url but there is a title\u2026\n (!node.url && node.title) ||\n // If there are control characters or whitespace.\n /[\\0- \\u007F]/.test(node.url)\n ) {\n subexit = state.enter('destinationLiteral')\n value += tracker.move('<')\n value += tracker.move(\n state.safe(node.url, {before: value, after: '>', ...tracker.current()})\n )\n value += tracker.move('>')\n } else {\n // No whitespace, raw is prettier.\n subexit = state.enter('destinationRaw')\n value += tracker.move(\n state.safe(node.url, {\n before: value,\n after: node.title ? ' ' : ')',\n ...tracker.current()\n })\n )\n }\n\n subexit()\n\n if (node.title) {\n subexit = state.enter(`title${suffix}`)\n value += tracker.move(' ' + quote)\n value += tracker.move(\n state.safe(node.title, {\n before: value,\n after: quote,\n ...tracker.current()\n })\n )\n value += tracker.move(quote)\n subexit()\n }\n\n value += tracker.move(')')\n\n exit()\n return value\n}\n\n/**\n * @param {Link} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @returns {string}\n */\nfunction linkPeek(node, _, state) {\n return formatLinkAsAutolink(node, state) ? '<' : '['\n}\n", "/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {LinkReference, Parents} from 'mdast'\n */\n\nlinkReference.peek = linkReferencePeek\n\n/**\n * @param {LinkReference} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function linkReference(node, _, state, info) {\n const type = node.referenceType\n const exit = state.enter('linkReference')\n let subexit = state.enter('label')\n const tracker = state.createTracker(info)\n let value = tracker.move('[')\n const text = state.containerPhrasing(node, {\n before: value,\n after: ']',\n ...tracker.current()\n })\n value += tracker.move(text + '][')\n\n subexit()\n // Hide the fact that we\u2019re in phrasing, because escapes don\u2019t work.\n const stack = state.stack\n state.stack = []\n subexit = state.enter('reference')\n // Note: for proper tracking, we should reset the output positions when we end\n // up making a `shortcut` reference, because then there is no brace output.\n // Practically, in that case, there is no content, so it doesn\u2019t matter that\n // we\u2019ve tracked one too many characters.\n const reference = state.safe(state.associationId(node), {\n before: value,\n after: ']',\n ...tracker.current()\n })\n subexit()\n state.stack = stack\n exit()\n\n if (type === 'full' || !text || text !== reference) {\n value += tracker.move(reference + ']')\n } else if (type === 'shortcut') {\n // Remove the unwanted `[`.\n value = value.slice(0, -1)\n } else {\n value += tracker.move(']')\n }\n\n return value\n}\n\n/**\n * @returns {string}\n */\nfunction linkReferencePeek() {\n return '['\n}\n", "/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkBullet(state) {\n const marker = state.options.bullet || '*'\n\n if (marker !== '*' && marker !== '+' && marker !== '-') {\n throw new Error(\n 'Cannot serialize items with `' +\n marker +\n '` for `options.bullet`, expected `*`, `+`, or `-`'\n )\n }\n\n return marker\n}\n", "/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\nimport {checkBullet} from './check-bullet.js'\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkBulletOther(state) {\n const bullet = checkBullet(state)\n const bulletOther = state.options.bulletOther\n\n if (!bulletOther) {\n return bullet === '*' ? '-' : '*'\n }\n\n if (bulletOther !== '*' && bulletOther !== '+' && bulletOther !== '-') {\n throw new Error(\n 'Cannot serialize items with `' +\n bulletOther +\n '` for `options.bulletOther`, expected `*`, `+`, or `-`'\n )\n }\n\n if (bulletOther === bullet) {\n throw new Error(\n 'Expected `bullet` (`' +\n bullet +\n '`) and `bulletOther` (`' +\n bulletOther +\n '`) to be different'\n )\n }\n\n return bulletOther\n}\n", "/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkBulletOrdered(state) {\n const marker = state.options.bulletOrdered || '.'\n\n if (marker !== '.' && marker !== ')') {\n throw new Error(\n 'Cannot serialize items with `' +\n marker +\n '` for `options.bulletOrdered`, expected `.` or `)`'\n )\n }\n\n return marker\n}\n", "/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkRule(state) {\n const marker = state.options.rule || '*'\n\n if (marker !== '*' && marker !== '-' && marker !== '_') {\n throw new Error(\n 'Cannot serialize rules with `' +\n marker +\n '` for `options.rule`, expected `*`, `-`, or `_`'\n )\n }\n\n return marker\n}\n", "/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {List, Parents} from 'mdast'\n */\n\nimport {checkBullet} from '../util/check-bullet.js'\nimport {checkBulletOther} from '../util/check-bullet-other.js'\nimport {checkBulletOrdered} from '../util/check-bullet-ordered.js'\nimport {checkRule} from '../util/check-rule.js'\n\n/**\n * @param {List} node\n * @param {Parents | undefined} parent\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function list(node, parent, state, info) {\n const exit = state.enter('list')\n const bulletCurrent = state.bulletCurrent\n /** @type {string} */\n let bullet = node.ordered ? checkBulletOrdered(state) : checkBullet(state)\n /** @type {string} */\n const bulletOther = node.ordered\n ? bullet === '.'\n ? ')'\n : '.'\n : checkBulletOther(state)\n let useDifferentMarker =\n parent && state.bulletLastUsed ? bullet === state.bulletLastUsed : false\n\n if (!node.ordered) {\n const firstListItem = node.children ? node.children[0] : undefined\n\n // If there\u2019s an empty first list item directly in two list items,\n // we have to use a different bullet:\n //\n // ```markdown\n // * - *\n // ```\n //\n // \u2026because otherwise it would become one big thematic break.\n if (\n // Bullet could be used as a thematic break marker:\n (bullet === '*' || bullet === '-') &&\n // Empty first list item:\n firstListItem &&\n (!firstListItem.children || !firstListItem.children[0]) &&\n // Directly in two other list items:\n state.stack[state.stack.length - 1] === 'list' &&\n state.stack[state.stack.length - 2] === 'listItem' &&\n state.stack[state.stack.length - 3] === 'list' &&\n state.stack[state.stack.length - 4] === 'listItem' &&\n // That are each the first child.\n state.indexStack[state.indexStack.length - 1] === 0 &&\n state.indexStack[state.indexStack.length - 2] === 0 &&\n state.indexStack[state.indexStack.length - 3] === 0\n ) {\n useDifferentMarker = true\n }\n\n // If there\u2019s a thematic break at the start of the first list item,\n // we have to use a different bullet:\n //\n // ```markdown\n // * ---\n // ```\n //\n // \u2026because otherwise it would become one big thematic break.\n if (checkRule(state) === bullet && firstListItem) {\n let index = -1\n\n while (++index < node.children.length) {\n const item = node.children[index]\n\n if (\n item &&\n item.type === 'listItem' &&\n item.children &&\n item.children[0] &&\n item.children[0].type === 'thematicBreak'\n ) {\n useDifferentMarker = true\n break\n }\n }\n }\n }\n\n if (useDifferentMarker) {\n bullet = bulletOther\n }\n\n state.bulletCurrent = bullet\n const value = state.containerFlow(node, info)\n state.bulletLastUsed = bullet\n state.bulletCurrent = bulletCurrent\n exit()\n return value\n}\n", "/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkListItemIndent(state) {\n const style = state.options.listItemIndent || 'one'\n\n if (style !== 'tab' && style !== 'one' && style !== 'mixed') {\n throw new Error(\n 'Cannot serialize items with `' +\n style +\n '` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`'\n )\n }\n\n return style\n}\n", "/**\n * @import {Info, Map, State} from 'mdast-util-to-markdown'\n * @import {ListItem, Parents} from 'mdast'\n */\n\nimport {checkBullet} from '../util/check-bullet.js'\nimport {checkListItemIndent} from '../util/check-list-item-indent.js'\n\n/**\n * @param {ListItem} node\n * @param {Parents | undefined} parent\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function listItem(node, parent, state, info) {\n const listItemIndent = checkListItemIndent(state)\n let bullet = state.bulletCurrent || checkBullet(state)\n\n // Add the marker value for ordered lists.\n if (parent && parent.type === 'list' && parent.ordered) {\n bullet =\n (typeof parent.start === 'number' && parent.start > -1\n ? parent.start\n : 1) +\n (state.options.incrementListMarker === false\n ? 0\n : parent.children.indexOf(node)) +\n bullet\n }\n\n let size = bullet.length + 1\n\n if (\n listItemIndent === 'tab' ||\n (listItemIndent === 'mixed' &&\n ((parent && parent.type === 'list' && parent.spread) || node.spread))\n ) {\n size = Math.ceil(size / 4) * 4\n }\n\n const tracker = state.createTracker(info)\n tracker.move(bullet + ' '.repeat(size - bullet.length))\n tracker.shift(size)\n const exit = state.enter('listItem')\n const value = state.indentLines(\n state.containerFlow(node, tracker.current()),\n map\n )\n exit()\n\n return value\n\n /** @type {Map} */\n function map(line, index, blank) {\n if (index) {\n return (blank ? '' : ' '.repeat(size)) + line\n }\n\n return (blank ? bullet : bullet + ' '.repeat(size - bullet.length)) + line\n }\n}\n", "/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Paragraph, Parents} from 'mdast'\n */\n\n/**\n * @param {Paragraph} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function paragraph(node, _, state, info) {\n const exit = state.enter('paragraph')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, info)\n subexit()\n exit()\n return value\n}\n", "/**\n * @typedef {import('mdast').Html} Html\n * @typedef {import('mdast').PhrasingContent} PhrasingContent\n */\n\nimport {convert} from 'unist-util-is'\n\n/**\n * Check if the given value is *phrasing content*.\n *\n * > \uD83D\uDC49 **Note**: Excludes `html`, which can be both phrasing or flow.\n *\n * @param node\n * Thing to check, typically `Node`.\n * @returns\n * Whether `value` is phrasing content.\n */\n\nexport const phrasing =\n /** @type {(node?: unknown) => node is Exclude} */\n (\n convert([\n 'break',\n 'delete',\n 'emphasis',\n // To do: next major: removed since footnotes were added to GFM.\n 'footnote',\n 'footnoteReference',\n 'image',\n 'imageReference',\n 'inlineCode',\n // Enabled by `mdast-util-math`:\n 'inlineMath',\n 'link',\n 'linkReference',\n // Enabled by `mdast-util-mdx`:\n 'mdxJsxTextElement',\n // Enabled by `mdast-util-mdx`:\n 'mdxTextExpression',\n 'strong',\n 'text',\n // Enabled by `mdast-util-directive`:\n 'textDirective'\n ])\n )\n", "/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Parents, Root} from 'mdast'\n */\n\nimport {phrasing} from 'mdast-util-phrasing'\n\n/**\n * @param {Root} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function root(node, _, state, info) {\n // Note: `html` nodes are ambiguous.\n const hasPhrasing = node.children.some(function (d) {\n return phrasing(d)\n })\n\n const container = hasPhrasing ? state.containerPhrasing : state.containerFlow\n return container.call(state, node, info)\n}\n", "/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkStrong(state) {\n const marker = state.options.strong || '*'\n\n if (marker !== '*' && marker !== '_') {\n throw new Error(\n 'Cannot serialize strong with `' +\n marker +\n '` for `options.strong`, expected `*`, or `_`'\n )\n }\n\n return marker\n}\n", "/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Parents, Strong} from 'mdast'\n */\n\nimport {checkStrong} from '../util/check-strong.js'\nimport {encodeCharacterReference} from '../util/encode-character-reference.js'\nimport {encodeInfo} from '../util/encode-info.js'\n\nstrong.peek = strongPeek\n\n/**\n * @param {Strong} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function strong(node, _, state, info) {\n const marker = checkStrong(state)\n const exit = state.enter('strong')\n const tracker = state.createTracker(info)\n const before = tracker.move(marker + marker)\n\n let between = tracker.move(\n state.containerPhrasing(node, {\n after: marker,\n before,\n ...tracker.current()\n })\n )\n const betweenHead = between.charCodeAt(0)\n const open = encodeInfo(\n info.before.charCodeAt(info.before.length - 1),\n betweenHead,\n marker\n )\n\n if (open.inside) {\n between = encodeCharacterReference(betweenHead) + between.slice(1)\n }\n\n const betweenTail = between.charCodeAt(between.length - 1)\n const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker)\n\n if (close.inside) {\n between = between.slice(0, -1) + encodeCharacterReference(betweenTail)\n }\n\n const after = tracker.move(marker + marker)\n\n exit()\n\n state.attentionEncodeSurroundingInfo = {\n after: close.outside,\n before: open.outside\n }\n return before + between + after\n}\n\n/**\n * @param {Strong} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @returns {string}\n */\nfunction strongPeek(_, _1, state) {\n return state.options.strong || '*'\n}\n", "/**\n * @import {Info, State} from 'mdast-util-to-markdown'\n * @import {Parents, Text} from 'mdast'\n */\n\n/**\n * @param {Text} node\n * @param {Parents | undefined} _\n * @param {State} state\n * @param {Info} info\n * @returns {string}\n */\nexport function text(node, _, state, info) {\n return state.safe(node.value, info)\n}\n", "/**\n * @import {Options, State} from 'mdast-util-to-markdown'\n */\n\n/**\n * @param {State} state\n * @returns {Exclude}\n */\nexport function checkRuleRepetition(state) {\n const repetition = state.options.ruleRepetition || 3\n\n if (repetition < 3) {\n throw new Error(\n 'Cannot serialize rules with repetition `' +\n repetition +\n '` for `options.ruleRepetition`, expected `3` or more'\n )\n }\n\n return repetition\n}\n", "/**\n * @import {State} from 'mdast-util-to-markdown'\n * @import {Parents, ThematicBreak} from 'mdast'\n */\n\nimport {checkRuleRepetition} from '../util/check-rule-repetition.js'\nimport {checkRule} from '../util/check-rule.js'\n\n/**\n * @param {ThematicBreak} _\n * @param {Parents | undefined} _1\n * @param {State} state\n * @returns {string}\n */\nexport function thematicBreak(_, _1, state) {\n const value = (\n checkRule(state) + (state.options.ruleSpaces ? ' ' : '')\n ).repeat(checkRuleRepetition(state))\n\n return state.options.ruleSpaces ? value.slice(0, -1) : value\n}\n", "import {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {definition} from './definition.js'\nimport {emphasis} from './emphasis.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {image} from './image.js'\nimport {imageReference} from './image-reference.js'\nimport {inlineCode} from './inline-code.js'\nimport {link} from './link.js'\nimport {linkReference} from './link-reference.js'\nimport {list} from './list.js'\nimport {listItem} from './list-item.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default (CommonMark) handlers.\n */\nexport const handle = {\n blockquote,\n break: hardBreak,\n code,\n definition,\n emphasis,\n hardBreak,\n heading,\n html,\n image,\n imageReference,\n inlineCode,\n link,\n linkReference,\n list,\n listItem,\n paragraph,\n root,\n strong,\n text,\n thematicBreak\n}\n", "/**\n * @typedef {import('mdast').InlineCode} InlineCode\n * @typedef {import('mdast').Table} Table\n * @typedef {import('mdast').TableCell} TableCell\n * @typedef {import('mdast').TableRow} TableRow\n *\n * @typedef {import('markdown-table').Options} MarkdownTableOptions\n *\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n *\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').State} State\n * @typedef {import('mdast-util-to-markdown').Info} Info\n */\n\n/**\n * @typedef Options\n * Configuration.\n * @property {boolean | null | undefined} [tableCellPadding=true]\n * Whether to add a space of padding between delimiters and cells (default:\n * `true`).\n * @property {boolean | null | undefined} [tablePipeAlign=true]\n * Whether to align the delimiters (default: `true`).\n * @property {MarkdownTableOptions['stringLength'] | null | undefined} [stringLength]\n * Function to detect the length of table cell content, used when aligning\n * the delimiters between cells (optional).\n */\n\nimport {ok as assert} from 'devlop'\nimport {markdownTable} from 'markdown-table'\nimport {defaultHandlers} from 'mdast-util-to-markdown'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM tables in\n * markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM tables.\n */\nexport function gfmTableFromMarkdown() {\n return {\n enter: {\n table: enterTable,\n tableData: enterCell,\n tableHeader: enterCell,\n tableRow: enterRow\n },\n exit: {\n codeText: exitCodeText,\n table: exitTable,\n tableData: exit,\n tableHeader: exit,\n tableRow: exit\n }\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterTable(token) {\n const align = token._align\n assert(align, 'expected `_align` on table')\n this.enter(\n {\n type: 'table',\n align: align.map(function (d) {\n return d === 'none' ? null : d\n }),\n children: []\n },\n token\n )\n this.data.inTable = true\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitTable(token) {\n this.exit(token)\n this.data.inTable = undefined\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterRow(token) {\n this.enter({type: 'tableRow', children: []}, token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exit(token) {\n this.exit(token)\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction enterCell(token) {\n this.enter({type: 'tableCell', children: []}, token)\n}\n\n// Overwrite the default code text data handler to unescape escaped pipes when\n// they are in tables.\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCodeText(token) {\n let value = this.resume()\n\n if (this.data.inTable) {\n value = value.replace(/\\\\([\\\\|])/g, replace)\n }\n\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'inlineCode')\n node.value = value\n this.exit(token)\n}\n\n/**\n * @param {string} $0\n * @param {string} $1\n * @returns {string}\n */\nfunction replace($0, $1) {\n // Pipes work, backslashes don\u2019t (but can\u2019t escape pipes).\n return $1 === '|' ? $1 : $0\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM tables in\n * markdown.\n *\n * @param {Options | null | undefined} [options]\n * Configuration.\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM tables.\n */\nexport function gfmTableToMarkdown(options) {\n const settings = options || {}\n const padding = settings.tableCellPadding\n const alignDelimiters = settings.tablePipeAlign\n const stringLength = settings.stringLength\n const around = padding ? ' ' : '|'\n\n return {\n unsafe: [\n {character: '\\r', inConstruct: 'tableCell'},\n {character: '\\n', inConstruct: 'tableCell'},\n // A pipe, when followed by a tab or space (padding), or a dash or colon\n // (unpadded delimiter row), could result in a table.\n {atBreak: true, character: '|', after: '[\\t :-]'},\n // A pipe in a cell must be encoded.\n {character: '|', inConstruct: 'tableCell'},\n // A colon must be followed by a dash, in which case it could start a\n // delimiter row.\n {atBreak: true, character: ':', after: '-'},\n // A delimiter row can also start with a dash, when followed by more\n // dashes, a colon, or a pipe.\n // This is a stricter version than the built in check for lists, thematic\n // breaks, and setex heading underlines though:\n // \n {atBreak: true, character: '-', after: '[:|-]'}\n ],\n handlers: {\n inlineCode: inlineCodeWithTable,\n table: handleTable,\n tableCell: handleTableCell,\n tableRow: handleTableRow\n }\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {Table} node\n */\n function handleTable(node, _, state, info) {\n return serializeData(handleTableAsData(node, state, info), node.align)\n }\n\n /**\n * This function isn\u2019t really used normally, because we handle rows at the\n * table level.\n * But, if someone passes in a table row, this ensures we make somewhat sense.\n *\n * @type {ToMarkdownHandle}\n * @param {TableRow} node\n */\n function handleTableRow(node, _, state, info) {\n const row = handleTableRowAsData(node, state, info)\n const value = serializeData([row])\n // `markdown-table` will always add an align row\n return value.slice(0, value.indexOf('\\n'))\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {TableCell} node\n */\n function handleTableCell(node, _, state, info) {\n const exit = state.enter('tableCell')\n const subexit = state.enter('phrasing')\n const value = state.containerPhrasing(node, {\n ...info,\n before: around,\n after: around\n })\n subexit()\n exit()\n return value\n }\n\n /**\n * @param {Array>} matrix\n * @param {Array | null | undefined} [align]\n */\n function serializeData(matrix, align) {\n return markdownTable(matrix, {\n align,\n // @ts-expect-error: `markdown-table` types should support `null`.\n alignDelimiters,\n // @ts-expect-error: `markdown-table` types should support `null`.\n padding,\n // @ts-expect-error: `markdown-table` types should support `null`.\n stringLength\n })\n }\n\n /**\n * @param {Table} node\n * @param {State} state\n * @param {Info} info\n */\n function handleTableAsData(node, state, info) {\n const children = node.children\n let index = -1\n /** @type {Array>} */\n const result = []\n const subexit = state.enter('table')\n\n while (++index < children.length) {\n result[index] = handleTableRowAsData(children[index], state, info)\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @param {TableRow} node\n * @param {State} state\n * @param {Info} info\n */\n function handleTableRowAsData(node, state, info) {\n const children = node.children\n let index = -1\n /** @type {Array} */\n const result = []\n const subexit = state.enter('tableRow')\n\n while (++index < children.length) {\n // Note: the positional info as used here is incorrect.\n // Making it correct would be impossible due to aligning cells?\n // And it would need copy/pasting `markdown-table` into this project.\n result[index] = handleTableCell(children[index], node, state, info)\n }\n\n subexit()\n\n return result\n }\n\n /**\n * @type {ToMarkdownHandle}\n * @param {InlineCode} node\n */\n function inlineCodeWithTable(node, parent, state) {\n let value = defaultHandlers.inlineCode(node, parent, state)\n\n if (state.stack.includes('tableCell')) {\n value = value.replace(/\\|/g, '\\\\$&')\n }\n\n return value\n }\n}\n", "/**\n * @typedef {import('mdast').ListItem} ListItem\n * @typedef {import('mdast').Paragraph} Paragraph\n * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext\n * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension\n * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle\n * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension\n * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle\n */\n\nimport {ok as assert} from 'devlop'\nimport {defaultHandlers} from 'mdast-util-to-markdown'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM task\n * list items in markdown.\n *\n * @returns {FromMarkdownExtension}\n * Extension for `mdast-util-from-markdown` to enable GFM task list items.\n */\nexport function gfmTaskListItemFromMarkdown() {\n return {\n exit: {\n taskListCheckValueChecked: exitCheck,\n taskListCheckValueUnchecked: exitCheck,\n paragraph: exitParagraphWithTaskListItem\n }\n }\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM task list\n * items in markdown.\n *\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM task list items.\n */\nexport function gfmTaskListItemToMarkdown() {\n return {\n unsafe: [{atBreak: true, character: '-', after: '[:|-]'}],\n handlers: {listItem: listItemWithTaskListItem}\n }\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitCheck(token) {\n // We\u2019re always in a paragraph, in a list item.\n const node = this.stack[this.stack.length - 2]\n assert(node.type === 'listItem')\n node.checked = token.type === 'taskListCheckValueChecked'\n}\n\n/**\n * @this {CompileContext}\n * @type {FromMarkdownHandle}\n */\nfunction exitParagraphWithTaskListItem(token) {\n const parent = this.stack[this.stack.length - 2]\n\n if (\n parent &&\n parent.type === 'listItem' &&\n typeof parent.checked === 'boolean'\n ) {\n const node = this.stack[this.stack.length - 1]\n assert(node.type === 'paragraph')\n const head = node.children[0]\n\n if (head && head.type === 'text') {\n const siblings = parent.children\n let index = -1\n /** @type {Paragraph | undefined} */\n let firstParaghraph\n\n while (++index < siblings.length) {\n const sibling = siblings[index]\n if (sibling.type === 'paragraph') {\n firstParaghraph = sibling\n break\n }\n }\n\n if (firstParaghraph === node) {\n // Must start with a space or a tab.\n head.value = head.value.slice(1)\n\n if (head.value.length === 0) {\n node.children.shift()\n } else if (\n node.position &&\n head.position &&\n typeof head.position.start.offset === 'number'\n ) {\n head.position.start.column++\n head.position.start.offset++\n node.position.start = Object.assign({}, head.position.start)\n }\n }\n }\n }\n\n this.exit(token)\n}\n\n/**\n * @type {ToMarkdownHandle}\n * @param {ListItem} node\n */\nfunction listItemWithTaskListItem(node, parent, state, info) {\n const head = node.children[0]\n const checkable =\n typeof node.checked === 'boolean' && head && head.type === 'paragraph'\n const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '\n const tracker = state.createTracker(info)\n\n if (checkable) {\n tracker.move(checkbox)\n }\n\n let value = defaultHandlers.listItem(node, parent, state, {\n ...info,\n ...tracker.current()\n })\n\n if (checkable) {\n value = value.replace(/^(?:[*+-]|\\d+\\.)([\\r\\n]| {1,3})/, check)\n }\n\n return value\n\n /**\n * @param {string} $0\n * @returns {string}\n */\n function check($0) {\n return $0 + checkbox\n }\n}\n", "/**\n * @import {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown'\n * @import {Options} from 'mdast-util-gfm'\n * @import {Options as ToMarkdownExtension} from 'mdast-util-to-markdown'\n */\n\nimport {\n gfmAutolinkLiteralFromMarkdown,\n gfmAutolinkLiteralToMarkdown\n} from 'mdast-util-gfm-autolink-literal'\nimport {\n gfmFootnoteFromMarkdown,\n gfmFootnoteToMarkdown\n} from 'mdast-util-gfm-footnote'\nimport {\n gfmStrikethroughFromMarkdown,\n gfmStrikethroughToMarkdown\n} from 'mdast-util-gfm-strikethrough'\nimport {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'\nimport {\n gfmTaskListItemFromMarkdown,\n gfmTaskListItemToMarkdown\n} from 'mdast-util-gfm-task-list-item'\n\n/**\n * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @returns {Array}\n * Extension for `mdast-util-from-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmFromMarkdown() {\n return [\n gfmAutolinkLiteralFromMarkdown(),\n gfmFootnoteFromMarkdown(),\n gfmStrikethroughFromMarkdown(),\n gfmTableFromMarkdown(),\n gfmTaskListItemFromMarkdown()\n ]\n}\n\n/**\n * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink\n * literals, footnotes, strikethrough, tables, tasklists).\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {ToMarkdownExtension}\n * Extension for `mdast-util-to-markdown` to enable GFM (autolink literals,\n * footnotes, strikethrough, tables, tasklists).\n */\nexport function gfmToMarkdown(options) {\n return {\n extensions: [\n gfmAutolinkLiteralToMarkdown(),\n gfmFootnoteToMarkdown(options),\n gfmStrikethroughToMarkdown(),\n gfmTableToMarkdown(options),\n gfmTaskListItemToMarkdown()\n ]\n }\n}\n", "/**\n * @import {Code, ConstructRecord, Event, Extension, Previous, State, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { asciiAlpha, asciiAlphanumeric, asciiControl, markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';\nconst wwwPrefix = {\n tokenize: tokenizeWwwPrefix,\n partial: true\n};\nconst domain = {\n tokenize: tokenizeDomain,\n partial: true\n};\nconst path = {\n tokenize: tokenizePath,\n partial: true\n};\nconst trail = {\n tokenize: tokenizeTrail,\n partial: true\n};\nconst emailDomainDotTrail = {\n tokenize: tokenizeEmailDomainDotTrail,\n partial: true\n};\nconst wwwAutolink = {\n name: 'wwwAutolink',\n tokenize: tokenizeWwwAutolink,\n previous: previousWww\n};\nconst protocolAutolink = {\n name: 'protocolAutolink',\n tokenize: tokenizeProtocolAutolink,\n previous: previousProtocol\n};\nconst emailAutolink = {\n name: 'emailAutolink',\n tokenize: tokenizeEmailAutolink,\n previous: previousEmail\n};\n\n/** @type {ConstructRecord} */\nconst text = {};\n\n/**\n * Create an extension for `micromark` to support GitHub autolink literal\n * syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * autolink literal syntax.\n */\nexport function gfmAutolinkLiteral() {\n return {\n text\n };\n}\n\n/** @type {Code} */\nlet code = 48;\n\n// Add alphanumerics.\nwhile (code < 123) {\n text[code] = emailAutolink;\n code++;\n if (code === 58) code = 65;else if (code === 91) code = 97;\n}\ntext[43] = emailAutolink;\ntext[45] = emailAutolink;\ntext[46] = emailAutolink;\ntext[95] = emailAutolink;\ntext[72] = [emailAutolink, protocolAutolink];\ntext[104] = [emailAutolink, protocolAutolink];\ntext[87] = [emailAutolink, wwwAutolink];\ntext[119] = [emailAutolink, wwwAutolink];\n\n// To do: perform email autolink literals on events, afterwards.\n// That\u2019s where `markdown-rs` and `cmark-gfm` perform it.\n// It should look for `@`, then for atext backwards, and then for a label\n// forwards.\n// To do: `mailto:`, `xmpp:` protocol as prefix.\n\n/**\n * Email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailAutolink(effects, ok, nok) {\n const self = this;\n /** @type {boolean | undefined} */\n let dot;\n /** @type {boolean} */\n let data;\n return start;\n\n /**\n * Start of email autolink literal.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n if (!gfmAtext(code) || !previousEmail.call(self, self.previous) || previousUnbalanced(self.events)) {\n return nok(code);\n }\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkEmail');\n return atext(code);\n }\n\n /**\n * In email atext.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function atext(code) {\n if (gfmAtext(code)) {\n effects.consume(code);\n return atext;\n }\n if (code === 64) {\n effects.consume(code);\n return emailDomain;\n }\n return nok(code);\n }\n\n /**\n * In email domain.\n *\n * The reference code is a bit overly complex as it handles the `@`, of which\n * there may be just one.\n * Source: \n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomain(code) {\n // Dot followed by alphanumerical (not `-` or `_`).\n if (code === 46) {\n return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code);\n }\n\n // Alphanumerical, `-`, and `_`.\n if (code === 45 || code === 95 || asciiAlphanumeric(code)) {\n data = true;\n effects.consume(code);\n return emailDomain;\n }\n\n // To do: `/` if xmpp.\n\n // Note: normally we\u2019d truncate trailing punctuation from the link.\n // However, email autolink literals cannot contain any of those markers,\n // except for `.`, but that can only occur if it isn\u2019t trailing.\n // So we can ignore truncating!\n return emailDomainAfter(code);\n }\n\n /**\n * In email domain, on dot that is not a trail.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainDot(code) {\n effects.consume(code);\n dot = true;\n return emailDomain;\n }\n\n /**\n * After email domain.\n *\n * ```markdown\n * > | a contact@example.org b\n * ^\n * ```\n *\n * @type {State}\n */\n function emailDomainAfter(code) {\n // Domain must not be empty, must include a dot, and must end in alphabetical.\n // Source: .\n if (data && dot && asciiAlpha(self.previous)) {\n effects.exit('literalAutolinkEmail');\n effects.exit('literalAutolink');\n return ok(code);\n }\n return nok(code);\n }\n}\n\n/**\n * `www` autolink literal.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwAutolink(effects, ok, nok) {\n const self = this;\n return wwwStart;\n\n /**\n * Start of www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwStart(code) {\n if (code !== 87 && code !== 119 || !previousWww.call(self, self.previous) || previousUnbalanced(self.events)) {\n return nok(code);\n }\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkWww');\n // Note: we *check*, so we can discard the `www.` we parsed.\n // If it worked, we consider it as a part of the domain.\n return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path, wwwAfter), nok), nok)(code);\n }\n\n /**\n * After a www autolink literal.\n *\n * ```markdown\n * > | www.example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwAfter(code) {\n effects.exit('literalAutolinkWww');\n effects.exit('literalAutolink');\n return ok(code);\n }\n}\n\n/**\n * Protocol autolink literal.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeProtocolAutolink(effects, ok, nok) {\n const self = this;\n let buffer = '';\n let seen = false;\n return protocolStart;\n\n /**\n * Start of protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolStart(code) {\n if ((code === 72 || code === 104) && previousProtocol.call(self, self.previous) && !previousUnbalanced(self.events)) {\n effects.enter('literalAutolink');\n effects.enter('literalAutolinkHttp');\n buffer += String.fromCodePoint(code);\n effects.consume(code);\n return protocolPrefixInside;\n }\n return nok(code);\n }\n\n /**\n * In protocol.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^^^^\n * ```\n *\n * @type {State}\n */\n function protocolPrefixInside(code) {\n // `5` is size of `https`\n if (asciiAlpha(code) && buffer.length < 5) {\n // @ts-expect-error: definitely number.\n buffer += String.fromCodePoint(code);\n effects.consume(code);\n return protocolPrefixInside;\n }\n if (code === 58) {\n const protocol = buffer.toLowerCase();\n if (protocol === 'http' || protocol === 'https') {\n effects.consume(code);\n return protocolSlashesInside;\n }\n }\n return nok(code);\n }\n\n /**\n * In slashes.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^^\n * ```\n *\n * @type {State}\n */\n function protocolSlashesInside(code) {\n if (code === 47) {\n effects.consume(code);\n if (seen) {\n return afterProtocol;\n }\n seen = true;\n return protocolSlashesInside;\n }\n return nok(code);\n }\n\n /**\n * After protocol, before domain.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function afterProtocol(code) {\n // To do: this is different from `markdown-rs`:\n // https://github.com/wooorm/markdown-rs/blob/b3a921c761309ae00a51fe348d8a43adbc54b518/src/construct/gfm_autolink_literal.rs#L172-L182\n return code === null || asciiControl(code) || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || unicodePunctuation(code) ? nok(code) : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code);\n }\n\n /**\n * After a protocol autolink literal.\n *\n * ```markdown\n * > | https://example.com/a?b#c\n * ^\n * ```\n *\n * @type {State}\n */\n function protocolAfter(code) {\n effects.exit('literalAutolinkHttp');\n effects.exit('literalAutolink');\n return ok(code);\n }\n}\n\n/**\n * `www` prefix.\n *\n * ```markdown\n * > | a www.example.org b\n * ^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeWwwPrefix(effects, ok, nok) {\n let size = 0;\n return wwwPrefixInside;\n\n /**\n * In www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^^^^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixInside(code) {\n if ((code === 87 || code === 119) && size < 3) {\n size++;\n effects.consume(code);\n return wwwPrefixInside;\n }\n if (code === 46 && size === 3) {\n effects.consume(code);\n return wwwPrefixAfter;\n }\n return nok(code);\n }\n\n /**\n * After www prefix.\n *\n * ```markdown\n * > | www.example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function wwwPrefixAfter(code) {\n // If there is *anything*, we can link.\n return code === null ? nok(code) : ok(code);\n }\n}\n\n/**\n * Domain.\n *\n * ```markdown\n * > | a https://example.org b\n * ^^^^^^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDomain(effects, ok, nok) {\n /** @type {boolean | undefined} */\n let underscoreInLastSegment;\n /** @type {boolean | undefined} */\n let underscoreInLastLastSegment;\n /** @type {boolean | undefined} */\n let seen;\n return domainInside;\n\n /**\n * In domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^^^^^^^^^^\n * ```\n *\n * @type {State}\n */\n function domainInside(code) {\n // Check whether this marker, which is a trailing punctuation\n // marker, optionally followed by more trailing markers, and then\n // followed by an end.\n if (code === 46 || code === 95) {\n return effects.check(trail, domainAfter, domainAtPunctuation)(code);\n }\n\n // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can\n // occur, which sounds like ASCII only, but they also support `www.\u9EDE\u770B.com`,\n // so that\u2019s Unicode.\n // Instead of some new production for Unicode alphanumerics, markdown\n // already has that for Unicode punctuation and whitespace, so use those.\n // Source: .\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || code !== 45 && unicodePunctuation(code)) {\n return domainAfter(code);\n }\n seen = true;\n effects.consume(code);\n return domainInside;\n }\n\n /**\n * In domain, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com\n * ^\n * ```\n *\n * @type {State}\n */\n function domainAtPunctuation(code) {\n // There is an underscore in the last segment of the domain\n if (code === 95) {\n underscoreInLastSegment = true;\n }\n // Otherwise, it\u2019s a `.`: save the last segment underscore in the\n // penultimate segment slot.\n else {\n underscoreInLastLastSegment = underscoreInLastSegment;\n underscoreInLastSegment = undefined;\n }\n effects.consume(code);\n return domainInside;\n }\n\n /**\n * After domain.\n *\n * ```markdown\n * > | https://example.com/a\n * ^\n * ```\n *\n * @type {State} */\n function domainAfter(code) {\n // Note: that\u2019s GH says a dot is needed, but it\u2019s not true:\n // \n if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {\n return nok(code);\n }\n return ok(code);\n }\n}\n\n/**\n * Path.\n *\n * ```markdown\n * > | a https://example.org/stuff b\n * ^^^^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePath(effects, ok) {\n let sizeOpen = 0;\n let sizeClose = 0;\n return pathInside;\n\n /**\n * In path.\n *\n * ```markdown\n * > | https://example.com/a\n * ^^\n * ```\n *\n * @type {State}\n */\n function pathInside(code) {\n if (code === 40) {\n sizeOpen++;\n effects.consume(code);\n return pathInside;\n }\n\n // To do: `markdown-rs` also needs this.\n // If this is a paren, and there are less closings than openings,\n // we don\u2019t check for a trail.\n if (code === 41 && sizeClose < sizeOpen) {\n return pathAtPunctuation(code);\n }\n\n // Check whether this trailing punctuation marker is optionally\n // followed by more trailing markers, and then followed\n // by an end.\n if (code === 33 || code === 34 || code === 38 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 60 || code === 63 || code === 93 || code === 95 || code === 126) {\n return effects.check(trail, ok, pathAtPunctuation)(code);\n }\n if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n effects.consume(code);\n return pathInside;\n }\n\n /**\n * In path, at potential trailing punctuation, that was not trailing.\n *\n * ```markdown\n * > | https://example.com/a\"b\n * ^\n * ```\n *\n * @type {State}\n */\n function pathAtPunctuation(code) {\n // Count closing parens.\n if (code === 41) {\n sizeClose++;\n }\n effects.consume(code);\n return pathInside;\n }\n}\n\n/**\n * Trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the entire trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | https://example.com\").\n * ^^^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTrail(effects, ok, nok) {\n return trail;\n\n /**\n * In trail of domain or path.\n *\n * ```markdown\n * > | https://example.com\").\n * ^\n * ```\n *\n * @type {State}\n */\n function trail(code) {\n // Regular trailing punctuation.\n if (code === 33 || code === 34 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 63 || code === 95 || code === 126) {\n effects.consume(code);\n return trail;\n }\n\n // `&` followed by one or more alphabeticals and then a `;`, is\n // as a whole considered as trailing punctuation.\n // In all other cases, it is considered as continuation of the URL.\n if (code === 38) {\n effects.consume(code);\n return trailCharacterReferenceStart;\n }\n\n // Needed because we allow literals after `[`, as we fix:\n // .\n // Check that it is not followed by `(` or `[`.\n if (code === 93) {\n effects.consume(code);\n return trailBracketAfter;\n }\n if (\n // `<` is an end.\n code === 60 ||\n // So is whitespace.\n code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n return nok(code);\n }\n\n /**\n * In trail, after `]`.\n *\n * > \uD83D\uDC49 **Note**: this deviates from `cmark-gfm` to fix a bug.\n * > See end of for more.\n *\n * ```markdown\n * > | https://example.com](\n * ^\n * ```\n *\n * @type {State}\n */\n function trailBracketAfter(code) {\n // Whitespace or something that could start a resource or reference is the end.\n // Switch back to trail otherwise.\n if (code === null || code === 40 || code === 91 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {\n return ok(code);\n }\n return trail(code);\n }\n\n /**\n * In character-reference like trail, after `&`.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharacterReferenceStart(code) {\n // When non-alpha, it\u2019s not a trail.\n return asciiAlpha(code) ? trailCharacterReferenceInside(code) : nok(code);\n }\n\n /**\n * In character-reference like trail.\n *\n * ```markdown\n * > | https://example.com&).\n * ^\n * ```\n *\n * @type {State}\n */\n function trailCharacterReferenceInside(code) {\n // Switch back to trail if this is well-formed.\n if (code === 59) {\n effects.consume(code);\n return trail;\n }\n if (asciiAlpha(code)) {\n effects.consume(code);\n return trailCharacterReferenceInside;\n }\n\n // It\u2019s not a trail.\n return nok(code);\n }\n}\n\n/**\n * Dot in email domain trail.\n *\n * This calls `ok` if this *is* the trail, followed by an end, which means\n * the trail is not part of the link.\n * It calls `nok` if this *is* part of the link.\n *\n * ```markdown\n * > | contact@example.org.\n * ^\n * ```\n *\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeEmailDomainDotTrail(effects, ok, nok) {\n return start;\n\n /**\n * Dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n // Must be dot.\n effects.consume(code);\n return after;\n }\n\n /**\n * After dot.\n *\n * ```markdown\n * > | contact@example.org.\n * ^ ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // Not a trail if alphanumeric.\n return asciiAlphanumeric(code) ? nok(code) : ok(code);\n }\n}\n\n/**\n * See:\n * .\n *\n * @type {Previous}\n */\nfunction previousWww(code) {\n return code === null || code === 40 || code === 42 || code === 95 || code === 91 || code === 93 || code === 126 || markdownLineEndingOrSpace(code);\n}\n\n/**\n * See:\n * .\n *\n * @type {Previous}\n */\nfunction previousProtocol(code) {\n return !asciiAlpha(code);\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Previous}\n */\nfunction previousEmail(code) {\n // Do not allow a slash \u201Cinside\u201D atext.\n // The reference code is a bit weird, but that\u2019s what it results in.\n // Source: .\n // Other than slash, every preceding character is allowed.\n return !(code === 47 || gfmAtext(code));\n}\n\n/**\n * @param {Code} code\n * @returns {boolean}\n */\nfunction gfmAtext(code) {\n return code === 43 || code === 45 || code === 46 || code === 95 || asciiAlphanumeric(code);\n}\n\n/**\n * @param {Array} events\n * @returns {boolean}\n */\nfunction previousUnbalanced(events) {\n let index = events.length;\n let result = false;\n while (index--) {\n const token = events[index][1];\n if ((token.type === 'labelLink' || token.type === 'labelImage') && !token._balanced) {\n result = true;\n break;\n }\n\n // If we\u2019ve seen this token, and it was marked as not having any unbalanced\n // bracket before it, we can exit.\n if (token._gfmAutolinkLiteralWalkedInto) {\n result = false;\n break;\n }\n }\n if (events.length > 0 && !result) {\n // Mark the last token as \u201Cwalked into\u201D w/o finding\n // anything.\n events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true;\n }\n return result;\n}", "/**\n * @import {Event, Exiter, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { blankLine } from 'micromark-core-commonmark';\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEndingOrSpace } from 'micromark-util-character';\nimport { normalizeIdentifier } from 'micromark-util-normalize-identifier';\nconst indent = {\n tokenize: tokenizeIndent,\n partial: true\n};\n\n// To do: micromark should support a `_hiddenGfmFootnoteSupport`, which only\n// affects label start (image).\n// That will let us drop `tokenizePotentialGfmFootnote*`.\n// It currently has a `_hiddenFootnoteSupport`, which affects that and more.\n// That can be removed when `micromark-extension-footnote` is archived.\n\n/**\n * Create an extension for `micromark` to enable GFM footnote syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to\n * enable GFM footnote syntax.\n */\nexport function gfmFootnote() {\n /** @type {Extension} */\n return {\n document: {\n [91]: {\n name: 'gfmFootnoteDefinition',\n tokenize: tokenizeDefinitionStart,\n continuation: {\n tokenize: tokenizeDefinitionContinuation\n },\n exit: gfmFootnoteDefinitionEnd\n }\n },\n text: {\n [91]: {\n name: 'gfmFootnoteCall',\n tokenize: tokenizeGfmFootnoteCall\n },\n [93]: {\n name: 'gfmPotentialFootnoteCall',\n add: 'after',\n tokenize: tokenizePotentialGfmFootnoteCall,\n resolveTo: resolveToPotentialGfmFootnoteCall\n }\n }\n };\n}\n\n// To do: remove after micromark update.\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizePotentialGfmFootnoteCall(effects, ok, nok) {\n const self = this;\n let index = self.events.length;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n /** @type {Token} */\n let labelStart;\n\n // Find an opening.\n while (index--) {\n const token = self.events[index][1];\n if (token.type === \"labelImage\") {\n labelStart = token;\n break;\n }\n\n // Exit if we\u2019ve walked far enough.\n if (token.type === 'gfmFootnoteCall' || token.type === \"labelLink\" || token.type === \"label\" || token.type === \"image\" || token.type === \"link\") {\n break;\n }\n }\n return start;\n\n /**\n * @type {State}\n */\n function start(code) {\n if (!labelStart || !labelStart._balanced) {\n return nok(code);\n }\n const id = normalizeIdentifier(self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n }));\n if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {\n return nok(code);\n }\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n return ok(code);\n }\n}\n\n// To do: remove after micromark update.\n/** @type {Resolver} */\nfunction resolveToPotentialGfmFootnoteCall(events, context) {\n let index = events.length;\n /** @type {Token | undefined} */\n let labelStart;\n\n // Find an opening.\n while (index--) {\n if (events[index][1].type === \"labelImage\" && events[index][0] === 'enter') {\n labelStart = events[index][1];\n break;\n }\n }\n // Change the `labelImageMarker` to a `data`.\n events[index + 1][1].type = \"data\";\n events[index + 3][1].type = 'gfmFootnoteCallLabelMarker';\n\n // The whole (without `!`):\n /** @type {Token} */\n const call = {\n type: 'gfmFootnoteCall',\n start: Object.assign({}, events[index + 3][1].start),\n end: Object.assign({}, events[events.length - 1][1].end)\n };\n // The `^` marker\n /** @type {Token} */\n const marker = {\n type: 'gfmFootnoteCallMarker',\n start: Object.assign({}, events[index + 3][1].end),\n end: Object.assign({}, events[index + 3][1].end)\n };\n // Increment the end 1 character.\n marker.end.column++;\n marker.end.offset++;\n marker.end._bufferIndex++;\n /** @type {Token} */\n const string = {\n type: 'gfmFootnoteCallString',\n start: Object.assign({}, marker.end),\n end: Object.assign({}, events[events.length - 1][1].start)\n };\n /** @type {Token} */\n const chunk = {\n type: \"chunkString\",\n contentType: 'string',\n start: Object.assign({}, string.start),\n end: Object.assign({}, string.end)\n };\n\n /** @type {Array} */\n const replacement = [\n // Take the `labelImageMarker` (now `data`, the `!`)\n events[index + 1], events[index + 2], ['enter', call, context],\n // The `[`\n events[index + 3], events[index + 4],\n // The `^`.\n ['enter', marker, context], ['exit', marker, context],\n // Everything in between.\n ['enter', string, context], ['enter', chunk, context], ['exit', chunk, context], ['exit', string, context],\n // The ending (`]`, properly parsed and labelled).\n events[events.length - 2], events[events.length - 1], ['exit', call, context]];\n events.splice(index, events.length - index + 1, ...replacement);\n return events;\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeGfmFootnoteCall(effects, ok, nok) {\n const self = this;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n let size = 0;\n /** @type {boolean} */\n let data;\n\n // Note: the implementation of `markdown-rs` is different, because it houses\n // core *and* extensions in one project.\n // Therefore, it can include footnote logic inside `label-end`.\n // We can\u2019t do that, but luckily, we can parse footnotes in a simpler way than\n // needed for labels.\n return start;\n\n /**\n * Start of footnote label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteCall');\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n return callStart;\n }\n\n /**\n * After `[`, at `^`.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callStart(code) {\n if (code !== 94) return nok(code);\n effects.enter('gfmFootnoteCallMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallMarker');\n effects.enter('gfmFootnoteCallString');\n effects.enter('chunkString').contentType = 'string';\n return callData;\n }\n\n /**\n * In label.\n *\n * ```markdown\n * > | a [^b] c\n * ^\n * ```\n *\n * @type {State}\n */\n function callData(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n code === 93 && !data ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null || code === 91 || markdownLineEndingOrSpace(code)) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit('chunkString');\n const token = effects.exit('gfmFootnoteCallString');\n if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {\n return nok(code);\n }\n effects.enter('gfmFootnoteCallLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteCallLabelMarker');\n effects.exit('gfmFootnoteCall');\n return ok;\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true;\n }\n size++;\n effects.consume(code);\n return code === 92 ? callEscape : callData;\n }\n\n /**\n * On character after escape.\n *\n * ```markdown\n * > | a [^b\\c] d\n * ^\n * ```\n *\n * @type {State}\n */\n function callEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return callData;\n }\n return callData(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionStart(effects, ok, nok) {\n const self = this;\n const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);\n /** @type {string} */\n let identifier;\n let size = 0;\n /** @type {boolean | undefined} */\n let data;\n return start;\n\n /**\n * Start of GFM footnote definition.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function start(code) {\n effects.enter('gfmFootnoteDefinition')._container = true;\n effects.enter('gfmFootnoteDefinitionLabel');\n effects.enter('gfmFootnoteDefinitionLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionLabelMarker');\n return labelAtMarker;\n }\n\n /**\n * In label, at caret.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAtMarker(code) {\n if (code === 94) {\n effects.enter('gfmFootnoteDefinitionMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionMarker');\n effects.enter('gfmFootnoteDefinitionLabelString');\n effects.enter('chunkString').contentType = 'string';\n return labelInside;\n }\n return nok(code);\n }\n\n /**\n * In label.\n *\n * > \uD83D\uDC49 **Note**: `cmark-gfm` prevents whitespace from occurring in footnote\n * > definition labels.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelInside(code) {\n if (\n // Too long.\n size > 999 ||\n // Closing brace with nothing.\n code === 93 && !data ||\n // Space or tab is not supported by GFM for some reason.\n // `\\n` and `[` not being supported makes sense.\n code === null || code === 91 || markdownLineEndingOrSpace(code)) {\n return nok(code);\n }\n if (code === 93) {\n effects.exit('chunkString');\n const token = effects.exit('gfmFootnoteDefinitionLabelString');\n identifier = normalizeIdentifier(self.sliceSerialize(token));\n effects.enter('gfmFootnoteDefinitionLabelMarker');\n effects.consume(code);\n effects.exit('gfmFootnoteDefinitionLabelMarker');\n effects.exit('gfmFootnoteDefinitionLabel');\n return labelAfter;\n }\n if (!markdownLineEndingOrSpace(code)) {\n data = true;\n }\n size++;\n effects.consume(code);\n return code === 92 ? labelEscape : labelInside;\n }\n\n /**\n * After `\\`, at a special character.\n *\n * > \uD83D\uDC49 **Note**: `cmark-gfm` currently does not support escaped brackets:\n * > \n *\n * ```markdown\n * > | [^a\\*b]: c\n * ^\n * ```\n *\n * @type {State}\n */\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code);\n size++;\n return labelInside;\n }\n return labelInside(code);\n }\n\n /**\n * After definition label.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function labelAfter(code) {\n if (code === 58) {\n effects.enter('definitionMarker');\n effects.consume(code);\n effects.exit('definitionMarker');\n if (!defined.includes(identifier)) {\n defined.push(identifier);\n }\n\n // Any whitespace after the marker is eaten, forming indented code\n // is not possible.\n // No space is also fine, just like a block quote marker.\n return factorySpace(effects, whitespaceAfter, 'gfmFootnoteDefinitionWhitespace');\n }\n return nok(code);\n }\n\n /**\n * After definition prefix.\n *\n * ```markdown\n * > | [^a]: b\n * ^\n * ```\n *\n * @type {State}\n */\n function whitespaceAfter(code) {\n // `markdown-rs` has a wrapping token for the prefix that is closed here.\n return ok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeDefinitionContinuation(effects, ok, nok) {\n /// Start of footnote definition continuation.\n ///\n /// ```markdown\n /// | [^a]: b\n /// > | c\n /// ^\n /// ```\n //\n // Either a blank line, which is okay, or an indented thing.\n return effects.check(blankLine, ok, effects.attempt(indent, ok, nok));\n}\n\n/** @type {Exiter} */\nfunction gfmFootnoteDefinitionEnd(effects) {\n effects.exit('gfmFootnoteDefinition');\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeIndent(effects, ok, nok) {\n const self = this;\n return factorySpace(effects, afterPrefix, 'gfmFootnoteDefinitionIndent', 4 + 1);\n\n /**\n * @type {State}\n */\n function afterPrefix(code) {\n const tail = self.events[self.events.length - 1];\n return tail && tail[1].type === 'gfmFootnoteDefinitionIndent' && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok(code) : nok(code);\n }\n}", "/**\n * @import {Options} from 'micromark-extension-gfm-strikethrough'\n * @import {Event, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { splice } from 'micromark-util-chunked';\nimport { classifyCharacter } from 'micromark-util-classify-character';\nimport { resolveAll } from 'micromark-util-resolve-all';\n/**\n * Create an extension for `micromark` to enable GFM strikethrough syntax.\n *\n * @param {Options | null | undefined} [options={}]\n * Configuration.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions`, to\n * enable GFM strikethrough syntax.\n */\nexport function gfmStrikethrough(options) {\n const options_ = options || {};\n let single = options_.singleTilde;\n const tokenizer = {\n name: 'strikethrough',\n tokenize: tokenizeStrikethrough,\n resolveAll: resolveAllStrikethrough\n };\n if (single === null || single === undefined) {\n single = true;\n }\n return {\n text: {\n [126]: tokenizer\n },\n insideSpan: {\n null: [tokenizer]\n },\n attentionMarkers: {\n null: [126]\n }\n };\n\n /**\n * Take events and resolve strikethrough.\n *\n * @type {Resolver}\n */\n function resolveAllStrikethrough(events, context) {\n let index = -1;\n\n // Walk through all events.\n while (++index < events.length) {\n // Find a token that can close.\n if (events[index][0] === 'enter' && events[index][1].type === 'strikethroughSequenceTemporary' && events[index][1]._close) {\n let open = index;\n\n // Now walk back to find an opener.\n while (open--) {\n // Find a token that can open the closer.\n if (events[open][0] === 'exit' && events[open][1].type === 'strikethroughSequenceTemporary' && events[open][1]._open &&\n // If the sizes are the same:\n events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) {\n events[index][1].type = 'strikethroughSequence';\n events[open][1].type = 'strikethroughSequence';\n\n /** @type {Token} */\n const strikethrough = {\n type: 'strikethrough',\n start: Object.assign({}, events[open][1].start),\n end: Object.assign({}, events[index][1].end)\n };\n\n /** @type {Token} */\n const text = {\n type: 'strikethroughText',\n start: Object.assign({}, events[open][1].end),\n end: Object.assign({}, events[index][1].start)\n };\n\n // Opening.\n /** @type {Array} */\n const nextEvents = [['enter', strikethrough, context], ['enter', events[open][1], context], ['exit', events[open][1], context], ['enter', text, context]];\n const insideSpan = context.parser.constructs.insideSpan.null;\n if (insideSpan) {\n // Between.\n splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan, events.slice(open + 1, index), context));\n }\n\n // Closing.\n splice(nextEvents, nextEvents.length, 0, [['exit', text, context], ['enter', events[index][1], context], ['exit', events[index][1], context], ['exit', strikethrough, context]]);\n splice(events, open - 1, index - open + 3, nextEvents);\n index = open + nextEvents.length - 2;\n break;\n }\n }\n }\n }\n index = -1;\n while (++index < events.length) {\n if (events[index][1].type === 'strikethroughSequenceTemporary') {\n events[index][1].type = \"data\";\n }\n }\n return events;\n }\n\n /**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\n function tokenizeStrikethrough(effects, ok, nok) {\n const previous = this.previous;\n const events = this.events;\n let size = 0;\n return start;\n\n /** @type {State} */\n function start(code) {\n if (previous === 126 && events[events.length - 1][1].type !== \"characterEscape\") {\n return nok(code);\n }\n effects.enter('strikethroughSequenceTemporary');\n return more(code);\n }\n\n /** @type {State} */\n function more(code) {\n const before = classifyCharacter(previous);\n if (code === 126) {\n // If this is the third marker, exit.\n if (size > 1) return nok(code);\n effects.consume(code);\n size++;\n return more;\n }\n if (size < 2 && !single) return nok(code);\n const token = effects.exit('strikethroughSequenceTemporary');\n const after = classifyCharacter(code);\n token._open = !after || after === 2 && Boolean(before);\n token._close = !before || before === 2 && Boolean(after);\n return ok(code);\n }\n }\n}", "/**\n * @import {Event} from 'micromark-util-types'\n */\n\n// Port of `edit_map.rs` from `markdown-rs`.\n// This should move to `markdown-js` later.\n\n// Deal with several changes in events, batching them together.\n//\n// Preferably, changes should be kept to a minimum.\n// Sometimes, it\u2019s needed to change the list of events, because parsing can be\n// messy, and it helps to expose a cleaner interface of events to the compiler\n// and other users.\n// It can also help to merge many adjacent similar events.\n// And, in other cases, it\u2019s needed to parse subcontent: pass some events\n// through another tokenizer and inject the result.\n\n/**\n * @typedef {[number, number, Array]} Change\n * @typedef {[number, number, number]} Jump\n */\n\n/**\n * Tracks a bunch of edits.\n */\nexport class EditMap {\n /**\n * Create a new edit map.\n */\n constructor() {\n /**\n * Record of changes.\n *\n * @type {Array}\n */\n this.map = [];\n }\n\n /**\n * Create an edit: a remove and/or add at a certain place.\n *\n * @param {number} index\n * @param {number} remove\n * @param {Array} add\n * @returns {undefined}\n */\n add(index, remove, add) {\n addImplementation(this, index, remove, add);\n }\n\n // To do: add this when moving to `micromark`.\n // /**\n // * Create an edit: but insert `add` before existing additions.\n // *\n // * @param {number} index\n // * @param {number} remove\n // * @param {Array} add\n // * @returns {undefined}\n // */\n // addBefore(index, remove, add) {\n // addImplementation(this, index, remove, add, true)\n // }\n\n /**\n * Done, change the events.\n *\n * @param {Array} events\n * @returns {undefined}\n */\n consume(events) {\n this.map.sort(function (a, b) {\n return a[0] - b[0];\n });\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (this.map.length === 0) {\n return;\n }\n\n // To do: if links are added in events, like they are in `markdown-rs`,\n // this is needed.\n // // Calculate jumps: where items in the current list move to.\n // /** @type {Array} */\n // const jumps = []\n // let index = 0\n // let addAcc = 0\n // let removeAcc = 0\n // while (index < this.map.length) {\n // const [at, remove, add] = this.map[index]\n // removeAcc += remove\n // addAcc += add.length\n // jumps.push([at, removeAcc, addAcc])\n // index += 1\n // }\n //\n // . shiftLinks(events, jumps)\n\n let index = this.map.length;\n /** @type {Array>} */\n const vecs = [];\n while (index > 0) {\n index -= 1;\n vecs.push(events.slice(this.map[index][0] + this.map[index][1]), this.map[index][2]);\n\n // Truncate rest.\n events.length = this.map[index][0];\n }\n vecs.push(events.slice());\n events.length = 0;\n let slice = vecs.pop();\n while (slice) {\n for (const element of slice) {\n events.push(element);\n }\n slice = vecs.pop();\n }\n\n // Truncate everything.\n this.map.length = 0;\n }\n}\n\n/**\n * Create an edit.\n *\n * @param {EditMap} editMap\n * @param {number} at\n * @param {number} remove\n * @param {Array} add\n * @returns {undefined}\n */\nfunction addImplementation(editMap, at, remove, add) {\n let index = 0;\n\n /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */\n if (remove === 0 && add.length === 0) {\n return;\n }\n while (index < editMap.map.length) {\n if (editMap.map[index][0] === at) {\n editMap.map[index][1] += remove;\n\n // To do: before not used by tables, use when moving to micromark.\n // if (before) {\n // add.push(...editMap.map[index][2])\n // editMap.map[index][2] = add\n // } else {\n editMap.map[index][2].push(...add);\n // }\n\n return;\n }\n index += 1;\n }\n editMap.map.push([at, remove, add]);\n}\n\n// /**\n// * Shift `previous` and `next` links according to `jumps`.\n// *\n// * This fixes links in case there are events removed or added between them.\n// *\n// * @param {Array} events\n// * @param {Array} jumps\n// */\n// function shiftLinks(events, jumps) {\n// let jumpIndex = 0\n// let index = 0\n// let add = 0\n// let rm = 0\n\n// while (index < events.length) {\n// const rmCurr = rm\n\n// while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {\n// add = jumps[jumpIndex][2]\n// rm = jumps[jumpIndex][1]\n// jumpIndex += 1\n// }\n\n// // Ignore items that will be removed.\n// if (rm > rmCurr) {\n// index += rm - rmCurr\n// } else {\n// // ?\n// // if let Some(link) = &events[index].link {\n// // if let Some(next) = link.next {\n// // events[next].link.as_mut().unwrap().previous = Some(index + add - rm);\n// // while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {\n// // add = jumps[jumpIndex].2;\n// // rm = jumps[jumpIndex].1;\n// // jumpIndex += 1;\n// // }\n// // events[index].link.as_mut().unwrap().next = Some(next + add - rm);\n// // index = next;\n// // continue;\n// // }\n// // }\n// index += 1\n// }\n// }\n// }", "/**\n * @import {Event} from 'micromark-util-types'\n */\n\n/**\n * @typedef {'center' | 'left' | 'none' | 'right'} Align\n */\n\n/**\n * Figure out the alignment of a GFM table.\n *\n * @param {Readonly>} events\n * List of events.\n * @param {number} index\n * Table enter event.\n * @returns {Array}\n * List of aligns.\n */\nexport function gfmTableAlign(events, index) {\n let inDelimiterRow = false;\n /** @type {Array} */\n const align = [];\n while (index < events.length) {\n const event = events[index];\n if (inDelimiterRow) {\n if (event[0] === 'enter') {\n // Start of alignment value: set a new column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n if (event[1].type === 'tableContent') {\n align.push(events[index + 1][1].type === 'tableDelimiterMarker' ? 'left' : 'none');\n }\n }\n // Exits:\n // End of alignment value: change the column.\n // To do: `markdown-rs` uses `tableDelimiterCellValue`.\n else if (event[1].type === 'tableContent') {\n if (events[index - 1][1].type === 'tableDelimiterMarker') {\n const alignIndex = align.length - 1;\n align[alignIndex] = align[alignIndex] === 'left' ? 'center' : 'right';\n }\n }\n // Done!\n else if (event[1].type === 'tableDelimiterRow') {\n break;\n }\n } else if (event[0] === 'enter' && event[1].type === 'tableDelimiterRow') {\n inDelimiterRow = true;\n }\n index += 1;\n }\n return align;\n}", "/**\n * @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\n/**\n * @typedef {[number, number, number, number]} Range\n * Cell info.\n *\n * @typedef {0 | 1 | 2 | 3} RowKind\n * Where we are: `1` for head row, `2` for delimiter row, `3` for body row.\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nimport { EditMap } from './edit-map.js';\nimport { gfmTableAlign } from './infer.js';\n\n/**\n * Create an HTML extension for `micromark` to support GitHub tables syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * table syntax.\n */\nexport function gfmTable() {\n return {\n flow: {\n null: {\n name: 'table',\n tokenize: tokenizeTable,\n resolveAll: resolveTable\n }\n }\n };\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTable(effects, ok, nok) {\n const self = this;\n let size = 0;\n let sizeB = 0;\n /** @type {boolean | undefined} */\n let seen;\n return start;\n\n /**\n * Start of a GFM table.\n *\n * If there is a valid table row or table head before, then we try to parse\n * another row.\n * Otherwise, we try to parse a head.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * > | | b |\n * ^\n * ```\n * @type {State}\n */\n function start(code) {\n let index = self.events.length - 1;\n while (index > -1) {\n const type = self.events[index][1].type;\n if (type === \"lineEnding\" ||\n // Note: markdown-rs uses `whitespace` instead of `linePrefix`\n type === \"linePrefix\") index--;else break;\n }\n const tail = index > -1 ? self.events[index][1].type : null;\n const next = tail === 'tableHead' || tail === 'tableRow' ? bodyRowStart : headRowBefore;\n\n // Don\u2019t allow lazy body rows.\n if (next === bodyRowStart && self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n return next(code);\n }\n\n /**\n * Before table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBefore(code) {\n effects.enter('tableHead');\n effects.enter('tableRow');\n return headRowStart(code);\n }\n\n /**\n * Before table head row, after whitespace.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowStart(code) {\n if (code === 124) {\n return headRowBreak(code);\n }\n\n // To do: micromark-js should let us parse our own whitespace in extensions,\n // like `markdown-rs`:\n //\n // ```js\n // // 4+ spaces.\n // if (markdownSpace(code)) {\n // return nok(code)\n // }\n // ```\n\n seen = true;\n // Count the first character, that isn\u2019t a pipe, double.\n sizeB += 1;\n return headRowBreak(code);\n }\n\n /**\n * At break in table head row.\n *\n * ```markdown\n * > | | a |\n * ^\n * ^\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowBreak(code) {\n if (code === null) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don\u2018t.\n return nok(code);\n }\n if (markdownLineEnding(code)) {\n // If anything other than one pipe (ignoring whitespace) was used, it\u2019s fine.\n if (sizeB > 1) {\n sizeB = 0;\n // To do: check if this works.\n // Feel free to interrupt:\n self.interrupt = true;\n effects.exit('tableRow');\n effects.enter(\"lineEnding\");\n effects.consume(code);\n effects.exit(\"lineEnding\");\n return headDelimiterStart;\n }\n\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don\u2018t.\n return nok(code);\n }\n if (markdownSpace(code)) {\n // To do: check if this is fine.\n // effects.attempt(State::Next(StateName::GfmTableHeadRowBreak), State::Nok)\n // State::Retry(space_or_tab(tokenizer))\n return factorySpace(effects, headRowBreak, \"whitespace\")(code);\n }\n sizeB += 1;\n if (seen) {\n seen = false;\n // Header cell count.\n size += 1;\n }\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n // Whether a delimiter was seen.\n seen = true;\n return headRowBreak;\n }\n\n // Anything else is cell data.\n effects.enter(\"data\");\n return headRowData(code);\n }\n\n /**\n * In table head row data.\n *\n * ```markdown\n * > | | a |\n * ^\n * | | - |\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return headRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? headRowEscape : headRowData;\n }\n\n /**\n * In table head row escape.\n *\n * ```markdown\n * > | | a\\-b |\n * ^\n * | | ---- |\n * | | c |\n * ```\n *\n * @type {State}\n */\n function headRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return headRowData;\n }\n return headRowData(code);\n }\n\n /**\n * Before delimiter row.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterStart(code) {\n // Reset `interrupt`.\n self.interrupt = false;\n\n // Note: in `markdown-rs`, we need to handle piercing here too.\n if (self.parser.lazy[self.now().line]) {\n return nok(code);\n }\n effects.enter('tableDelimiterRow');\n // Track if we\u2019ve seen a `:` or `|`.\n seen = false;\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterBefore, \"linePrefix\", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);\n }\n return headDelimiterBefore(code);\n }\n\n /**\n * Before delimiter row, after optional whitespace.\n *\n * Reused when a `|` is found later, to parse another cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * | | b |\n * ```\n *\n * @type {State}\n */\n function headDelimiterBefore(code) {\n if (code === 45 || code === 58) {\n return headDelimiterValueBefore(code);\n }\n if (code === 124) {\n seen = true;\n // If we start with a pipe, we open a cell marker.\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return headDelimiterCellBefore;\n }\n\n // More whitespace / empty row not allowed at start.\n return headDelimiterNok(code);\n }\n\n /**\n * After `|`, before delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellBefore(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterValueBefore, \"whitespace\")(code);\n }\n return headDelimiterValueBefore(code);\n }\n\n /**\n * Before delimiter cell value.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterValueBefore(code) {\n // Align: left.\n if (code === 58) {\n sizeB += 1;\n seen = true;\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterLeftAlignmentAfter;\n }\n\n // Align: none.\n if (code === 45) {\n sizeB += 1;\n // To do: seems weird that this *isn\u2019t* left aligned, but that state is used?\n return headDelimiterLeftAlignmentAfter(code);\n }\n if (code === null || markdownLineEnding(code)) {\n return headDelimiterCellAfter(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * After delimiter cell left alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | :- |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterLeftAlignmentAfter(code) {\n if (code === 45) {\n effects.enter('tableDelimiterFiller');\n return headDelimiterFiller(code);\n }\n\n // Anything else is not ok after the left-align colon.\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter cell filler.\n *\n * ```markdown\n * | | a |\n * > | | - |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterFiller(code) {\n if (code === 45) {\n effects.consume(code);\n return headDelimiterFiller;\n }\n\n // Align is `center` if it was `left`, `right` otherwise.\n if (code === 58) {\n seen = true;\n effects.exit('tableDelimiterFiller');\n effects.enter('tableDelimiterMarker');\n effects.consume(code);\n effects.exit('tableDelimiterMarker');\n return headDelimiterRightAlignmentAfter;\n }\n effects.exit('tableDelimiterFiller');\n return headDelimiterRightAlignmentAfter(code);\n }\n\n /**\n * After delimiter cell right alignment marker.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterRightAlignmentAfter(code) {\n if (markdownSpace(code)) {\n return factorySpace(effects, headDelimiterCellAfter, \"whitespace\")(code);\n }\n return headDelimiterCellAfter(code);\n }\n\n /**\n * After delimiter cell.\n *\n * ```markdown\n * | | a |\n * > | | -: |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterCellAfter(code) {\n if (code === 124) {\n return headDelimiterBefore(code);\n }\n if (code === null || markdownLineEnding(code)) {\n // Exit when:\n // * there was no `:` or `|` at all (it\u2019s a thematic break or setext\n // underline instead)\n // * the header cell count is not the delimiter cell count\n if (!seen || size !== sizeB) {\n return headDelimiterNok(code);\n }\n\n // Note: in markdown-rs`, a reset is needed here.\n effects.exit('tableDelimiterRow');\n effects.exit('tableHead');\n // To do: in `markdown-rs`, resolvers need to be registered manually.\n // effects.register_resolver(ResolveName::GfmTable)\n return ok(code);\n }\n return headDelimiterNok(code);\n }\n\n /**\n * In delimiter row, at a disallowed byte.\n *\n * ```markdown\n * | | a |\n * > | | x |\n * ^\n * ```\n *\n * @type {State}\n */\n function headDelimiterNok(code) {\n // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don\u2018t.\n return nok(code);\n }\n\n /**\n * Before table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowStart(code) {\n // Note: in `markdown-rs` we need to manually take care of a prefix,\n // but in `micromark-js` that is done for us, so if we\u2019re here, we\u2019re\n // never at whitespace.\n effects.enter('tableRow');\n return bodyRowBreak(code);\n }\n\n /**\n * At break in table body row.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ^\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowBreak(code) {\n if (code === 124) {\n effects.enter('tableCellDivider');\n effects.consume(code);\n effects.exit('tableCellDivider');\n return bodyRowBreak;\n }\n if (code === null || markdownLineEnding(code)) {\n effects.exit('tableRow');\n return ok(code);\n }\n if (markdownSpace(code)) {\n return factorySpace(effects, bodyRowBreak, \"whitespace\")(code);\n }\n\n // Anything else is cell content.\n effects.enter(\"data\");\n return bodyRowData(code);\n }\n\n /**\n * In table body row data.\n *\n * ```markdown\n * | | a |\n * | | - |\n * > | | b |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowData(code) {\n if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {\n effects.exit(\"data\");\n return bodyRowBreak(code);\n }\n effects.consume(code);\n return code === 92 ? bodyRowEscape : bodyRowData;\n }\n\n /**\n * In table body row escape.\n *\n * ```markdown\n * | | a |\n * | | ---- |\n * > | | b\\-c |\n * ^\n * ```\n *\n * @type {State}\n */\n function bodyRowEscape(code) {\n if (code === 92 || code === 124) {\n effects.consume(code);\n return bodyRowData;\n }\n return bodyRowData(code);\n }\n}\n\n/** @type {Resolver} */\n\nfunction resolveTable(events, context) {\n let index = -1;\n let inFirstCellAwaitingPipe = true;\n /** @type {RowKind} */\n let rowKind = 0;\n /** @type {Range} */\n let lastCell = [0, 0, 0, 0];\n /** @type {Range} */\n let cell = [0, 0, 0, 0];\n let afterHeadAwaitingFirstBodyRow = false;\n let lastTableEnd = 0;\n /** @type {Token | undefined} */\n let currentTable;\n /** @type {Token | undefined} */\n let currentBody;\n /** @type {Token | undefined} */\n let currentCell;\n const map = new EditMap();\n while (++index < events.length) {\n const event = events[index];\n const token = event[1];\n if (event[0] === 'enter') {\n // Start of head.\n if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = false;\n\n // Inject previous (body end and) table end.\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n currentBody = undefined;\n lastTableEnd = 0;\n }\n\n // Inject table start.\n currentTable = {\n type: 'table',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentTable, context]]);\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n inFirstCellAwaitingPipe = true;\n currentCell = undefined;\n lastCell = [0, 0, 0, 0];\n cell = [0, index + 1, 0, 0];\n\n // Inject table body start.\n if (afterHeadAwaitingFirstBodyRow) {\n afterHeadAwaitingFirstBodyRow = false;\n currentBody = {\n type: 'tableBody',\n start: Object.assign({}, token.start),\n // Note: correct end is set later.\n end: Object.assign({}, token.end)\n };\n map.add(index, 0, [['enter', currentBody, context]]);\n }\n rowKind = token.type === 'tableDelimiterRow' ? 2 : currentBody ? 3 : 1;\n }\n // Cell data.\n else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n inFirstCellAwaitingPipe = false;\n\n // First value in cell.\n if (cell[2] === 0) {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n lastCell = [0, 0, 0, 0];\n }\n cell[2] = index;\n }\n } else if (token.type === 'tableCellDivider') {\n if (inFirstCellAwaitingPipe) {\n inFirstCellAwaitingPipe = false;\n } else {\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);\n }\n lastCell = cell;\n cell = [lastCell[1], index, 0, 0];\n }\n }\n }\n // Exit events.\n else if (token.type === 'tableHead') {\n afterHeadAwaitingFirstBodyRow = true;\n lastTableEnd = index;\n } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {\n lastTableEnd = index;\n if (lastCell[1] !== 0) {\n cell[0] = cell[1];\n currentCell = flushCell(map, context, lastCell, rowKind, index, currentCell);\n } else if (cell[1] !== 0) {\n currentCell = flushCell(map, context, cell, rowKind, index, currentCell);\n }\n rowKind = 0;\n } else if (rowKind && (token.type === \"data\" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {\n cell[3] = index;\n }\n }\n if (lastTableEnd !== 0) {\n flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);\n }\n map.consume(context.events);\n\n // To do: move this into `html`, when events are exposed there.\n // That\u2019s what `markdown-rs` does.\n // That needs updates to `mdast-util-gfm-table`.\n index = -1;\n while (++index < context.events.length) {\n const event = context.events[index];\n if (event[0] === 'enter' && event[1].type === 'table') {\n event[1]._align = gfmTableAlign(context.events, index);\n }\n }\n return events;\n}\n\n/**\n * Generate a cell.\n *\n * @param {EditMap} map\n * @param {Readonly} context\n * @param {Readonly} range\n * @param {RowKind} rowKind\n * @param {number | undefined} rowEnd\n * @param {Token | undefined} previousCell\n * @returns {Token | undefined}\n */\n// eslint-disable-next-line max-params\nfunction flushCell(map, context, range, rowKind, rowEnd, previousCell) {\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCell' : 'tableCell'\n const groupName = rowKind === 1 ? 'tableHeader' : rowKind === 2 ? 'tableDelimiter' : 'tableData';\n // `markdown-rs` uses:\n // rowKind === 2 ? 'tableDelimiterCellValue' : 'tableCellText'\n const valueName = 'tableContent';\n\n // Insert an exit for the previous cell, if there is one.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[0] !== 0) {\n previousCell.end = Object.assign({}, getPoint(context.events, range[0]));\n map.add(range[0], 0, [['exit', previousCell, context]]);\n }\n\n // Insert enter of this cell.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^^^^-- this cell\n // ```\n const now = getPoint(context.events, range[1]);\n previousCell = {\n type: groupName,\n start: Object.assign({}, now),\n // Note: correct end is set later.\n end: Object.assign({}, now)\n };\n map.add(range[1], 0, [['enter', previousCell, context]]);\n\n // Insert text start at first data start and end at last data end, and\n // remove events between.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- enter\n // ^-- exit\n // ^^^^-- this cell\n // ```\n if (range[2] !== 0) {\n const relatedStart = getPoint(context.events, range[2]);\n const relatedEnd = getPoint(context.events, range[3]);\n /** @type {Token} */\n const valueToken = {\n type: valueName,\n start: Object.assign({}, relatedStart),\n end: Object.assign({}, relatedEnd)\n };\n map.add(range[2], 0, [['enter', valueToken, context]]);\n if (rowKind !== 2) {\n // Fix positional info on remaining events\n const start = context.events[range[2]];\n const end = context.events[range[3]];\n start[1].end = Object.assign({}, end[1].end);\n start[1].type = \"chunkText\";\n start[1].contentType = \"text\";\n\n // Remove if needed.\n if (range[3] > range[2] + 1) {\n const a = range[2] + 1;\n const b = range[3] - range[2] - 1;\n map.add(a, b, []);\n }\n }\n map.add(range[3] + 1, 0, [['exit', valueToken, context]]);\n }\n\n // Insert an exit for the last cell, if at the row end.\n //\n // ```markdown\n // > | | aa | bb | cc |\n // ^-- exit\n // ^^^^^^-- this cell (the last one contains two \u201Cbetween\u201D parts)\n // ```\n if (rowEnd !== undefined) {\n previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));\n map.add(rowEnd, 0, [['exit', previousCell, context]]);\n previousCell = undefined;\n }\n return previousCell;\n}\n\n/**\n * Generate table end (and table body end).\n *\n * @param {Readonly} map\n * @param {Readonly} context\n * @param {number} index\n * @param {Token} table\n * @param {Token | undefined} tableBody\n */\n// eslint-disable-next-line max-params\nfunction flushTableEnd(map, context, index, table, tableBody) {\n /** @type {Array} */\n const exits = [];\n const related = getPoint(context.events, index);\n if (tableBody) {\n tableBody.end = Object.assign({}, related);\n exits.push(['exit', tableBody, context]);\n }\n table.end = Object.assign({}, related);\n exits.push(['exit', table, context]);\n map.add(index + 1, 0, exits);\n}\n\n/**\n * @param {Readonly>} events\n * @param {number} index\n * @returns {Readonly}\n */\nfunction getPoint(events, index) {\n const event = events[index];\n const side = event[0] === 'enter' ? 'start' : 'end';\n return event[1][side];\n}", "/**\n * @import {Extension, State, TokenizeContext, Tokenizer} from 'micromark-util-types'\n */\n\nimport { factorySpace } from 'micromark-factory-space';\nimport { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';\nconst tasklistCheck = {\n name: 'tasklistCheck',\n tokenize: tokenizeTasklistCheck\n};\n\n/**\n * Create an HTML extension for `micromark` to support GFM task list items\n * syntax.\n *\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `htmlExtensions` to\n * support GFM task list items when serializing to HTML.\n */\nexport function gfmTaskListItem() {\n return {\n text: {\n [91]: tasklistCheck\n }\n };\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction tokenizeTasklistCheck(effects, ok, nok) {\n const self = this;\n return open;\n\n /**\n * At start of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function open(code) {\n if (\n // Exit if there\u2019s stuff before.\n self.previous !== null ||\n // Exit if not in the first content that is the first child of a list\n // item.\n !self._gfmTasklistFirstContentOfListItem) {\n return nok(code);\n }\n effects.enter('taskListCheck');\n effects.enter('taskListCheckMarker');\n effects.consume(code);\n effects.exit('taskListCheckMarker');\n return inside;\n }\n\n /**\n * In task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function inside(code) {\n // Currently we match how GH works in files.\n // To match how GH works in comments, use `markdownSpace` (`[\\t ]`) instead\n // of `markdownLineEndingOrSpace` (`[\\t\\n\\r ]`).\n if (markdownLineEndingOrSpace(code)) {\n effects.enter('taskListCheckValueUnchecked');\n effects.consume(code);\n effects.exit('taskListCheckValueUnchecked');\n return close;\n }\n if (code === 88 || code === 120) {\n effects.enter('taskListCheckValueChecked');\n effects.consume(code);\n effects.exit('taskListCheckValueChecked');\n return close;\n }\n return nok(code);\n }\n\n /**\n * At close of task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function close(code) {\n if (code === 93) {\n effects.enter('taskListCheckMarker');\n effects.consume(code);\n effects.exit('taskListCheckMarker');\n effects.exit('taskListCheck');\n return after;\n }\n return nok(code);\n }\n\n /**\n * @type {State}\n */\n function after(code) {\n // EOL in paragraph means there must be something else after it.\n if (markdownLineEnding(code)) {\n return ok(code);\n }\n\n // Space or tab?\n // Check what comes after.\n if (markdownSpace(code)) {\n return effects.check({\n tokenize: spaceThenNonSpace\n }, ok, nok)(code);\n }\n\n // EOF, or non-whitespace, both wrong.\n return nok(code);\n }\n}\n\n/**\n * @this {TokenizeContext}\n * @type {Tokenizer}\n */\nfunction spaceThenNonSpace(effects, ok, nok) {\n return factorySpace(effects, after, \"whitespace\");\n\n /**\n * After whitespace, after task list item check.\n *\n * ```markdown\n * > | * [x] y.\n * ^\n * ```\n *\n * @type {State}\n */\n function after(code) {\n // EOF means there was nothing, so bad.\n // EOL means there\u2019s content after it, so good.\n // Impossible to have more spaces.\n // Anything else is good.\n return code === null ? nok(code) : ok(code);\n }\n}", "/**\n * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions\n * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options\n * @typedef {import('micromark-util-types').Extension} Extension\n * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension\n */\n\nimport {\n combineExtensions,\n combineHtmlExtensions\n} from 'micromark-util-combine-extensions'\nimport {\n gfmAutolinkLiteral,\n gfmAutolinkLiteralHtml\n} from 'micromark-extension-gfm-autolink-literal'\nimport {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote'\nimport {\n gfmStrikethrough,\n gfmStrikethroughHtml\n} from 'micromark-extension-gfm-strikethrough'\nimport {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'\nimport {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'\nimport {\n gfmTaskListItem,\n gfmTaskListItemHtml\n} from 'micromark-extension-gfm-task-list-item'\n\n/**\n * Create an extension for `micromark` to enable GFM syntax.\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n *\n * Passed to `micromark-extens-gfm-strikethrough`.\n * @returns {Extension}\n * Extension for `micromark` that can be passed in `extensions` to enable GFM\n * syntax.\n */\nexport function gfm(options) {\n return combineExtensions([\n gfmAutolinkLiteral(),\n gfmFootnote(),\n gfmStrikethrough(options),\n gfmTable(),\n gfmTaskListItem()\n ])\n}\n\n/**\n * Create an extension for `micromark` to support GFM when serializing to HTML.\n *\n * @param {HtmlOptions | null | undefined} [options]\n * Configuration (optional).\n *\n * Passed to `micromark-extens-gfm-footnote`.\n * @returns {HtmlExtension}\n * Extension for `micromark` that can be passed in `htmlExtensions` to\n * support GFM when serializing to HTML.\n */\nexport function gfmHtml(options) {\n return combineHtmlExtensions([\n gfmAutolinkLiteralHtml(),\n gfmFootnoteHtml(options),\n gfmStrikethroughHtml(),\n gfmTableHtml(),\n gfmTagfilterHtml(),\n gfmTaskListItemHtml()\n ])\n}\n", "/**\n * @import {Root} from 'mdast'\n * @import {Options} from 'remark-gfm'\n * @import {} from 'remark-parse'\n * @import {} from 'remark-stringify'\n * @import {Processor} from 'unified'\n */\n\nimport {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm'\nimport {gfm} from 'micromark-extension-gfm'\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Add support GFM (autolink literals, footnotes, strikethrough, tables,\n * tasklists).\n *\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {undefined}\n * Nothing.\n */\nexport default function remarkGfm(options) {\n // @ts-expect-error: TS is wrong about `this`.\n // eslint-disable-next-line unicorn/no-this-assignment\n const self = /** @type {Processor} */ (this)\n const settings = options || emptyOptions\n const data = self.data()\n\n const micromarkExtensions =\n data.micromarkExtensions || (data.micromarkExtensions = [])\n const fromMarkdownExtensions =\n data.fromMarkdownExtensions || (data.fromMarkdownExtensions = [])\n const toMarkdownExtensions =\n data.toMarkdownExtensions || (data.toMarkdownExtensions = [])\n\n micromarkExtensions.push(gfm(settings))\n fromMarkdownExtensions.push(gfmFromMarkdown())\n toMarkdownExtensions.push(gfmToMarkdown(settings))\n}\n", "/**\n * @import {Element} from 'hast'\n * @import {Blockquote} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `blockquote` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Blockquote} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function blockquote(state, node) {\n /** @type {Element} */\n const result = {\n type: 'element',\n tagName: 'blockquote',\n properties: {},\n children: state.wrap(state.all(node), true)\n }\n state.patch(node, result)\n return state.applyData(node, result)\n}\n", "/**\n * @import {Element, Text} from 'hast'\n * @import {Break} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `break` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Break} node\n * mdast node.\n * @returns {Array}\n * hast element content.\n */\nexport function hardBreak(state, node) {\n /** @type {Element} */\n const result = {type: 'element', tagName: 'br', properties: {}, children: []}\n state.patch(node, result)\n return [state.applyData(node, result), {type: 'text', value: '\\n'}]\n}\n", "/**\n * @import {Element, Properties} from 'hast'\n * @import {Code} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `code` node into hast.\n *\n * @param {State} state\n * Info passed around.\n * @param {Code} node\n * mdast node.\n * @returns {Element}\n * hast node.\n */\nexport function code(state, node) {\n const value = node.value ? node.value + '\\n' : ''\n /** @type {Properties} */\n const properties = {}\n // Someone can write `js python ruby`.\n const language = node.lang ? node.lang.split(/\\s+/) : []\n\n // GH/CM still drop the non-first languages.\n if (language.length > 0) {\n properties.className = ['language-' + language[0]]\n }\n\n // Create ``.\n /** @type {Element} */\n let result = {\n type: 'element',\n tagName: 'code',\n properties,\n children: [{type: 'text', value}]\n }\n\n if (node.meta) {\n result.data = {meta: node.meta}\n }\n\n state.patch(node, result)\n result = state.applyData(node, result)\n\n // Create `
`.\n  result = {type: 'element', tagName: 'pre', properties: {}, children: [result]}\n  state.patch(node, result)\n  return result\n}\n", "/**\n * @import {Element} from 'hast'\n * @import {Delete} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `delete` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Delete} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strikethrough(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'del',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Element} from 'hast'\n * @import {Emphasis} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `emphasis` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Emphasis} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function emphasis(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'em',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Element} from 'hast'\n * @import {FootnoteReference} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `footnoteReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {FootnoteReference} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function footnoteReference(state, node) {\n  const clobberPrefix =\n    typeof state.options.clobberPrefix === 'string'\n      ? state.options.clobberPrefix\n      : 'user-content-'\n  const id = String(node.identifier).toUpperCase()\n  const safeId = normalizeUri(id.toLowerCase())\n  const index = state.footnoteOrder.indexOf(id)\n  /** @type {number} */\n  let counter\n\n  let reuseCounter = state.footnoteCounts.get(id)\n\n  if (reuseCounter === undefined) {\n    reuseCounter = 0\n    state.footnoteOrder.push(id)\n    counter = state.footnoteOrder.length\n  } else {\n    counter = index + 1\n  }\n\n  reuseCounter += 1\n  state.footnoteCounts.set(id, reuseCounter)\n\n  /** @type {Element} */\n  const link = {\n    type: 'element',\n    tagName: 'a',\n    properties: {\n      href: '#' + clobberPrefix + 'fn-' + safeId,\n      id:\n        clobberPrefix +\n        'fnref-' +\n        safeId +\n        (reuseCounter > 1 ? '-' + reuseCounter : ''),\n      dataFootnoteRef: true,\n      ariaDescribedBy: ['footnote-label']\n    },\n    children: [{type: 'text', value: String(counter)}]\n  }\n  state.patch(node, link)\n\n  /** @type {Element} */\n  const sup = {\n    type: 'element',\n    tagName: 'sup',\n    properties: {},\n    children: [link]\n  }\n  state.patch(node, sup)\n  return state.applyData(node, sup)\n}\n", "/**\n * @import {Element} from 'hast'\n * @import {Heading} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `heading` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Heading} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function heading(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'h' + node.depth,\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Element} from 'hast'\n * @import {Html} from 'mdast'\n * @import {State} from '../state.js'\n * @import {Raw} from '../../index.js'\n */\n\n/**\n * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise\n * nothing).\n *\n * @param {State} state\n *   Info passed around.\n * @param {Html} node\n *   mdast node.\n * @returns {Element | Raw | undefined}\n *   hast node.\n */\nexport function html(state, node) {\n  if (state.options.allowDangerousHtml) {\n    /** @type {Raw} */\n    const result = {type: 'raw', value: node.value}\n    state.patch(node, result)\n    return state.applyData(node, result)\n  }\n\n  return undefined\n}\n", "/**\n * @import {ElementContent} from 'hast'\n * @import {Reference, Nodes} from 'mdast'\n * @import {State} from './state.js'\n */\n\n/**\n * Return the content of a reference without definition as plain text.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Extract} node\n *   Reference node (image, link).\n * @returns {Array}\n *   hast content.\n */\nexport function revert(state, node) {\n  const subtype = node.referenceType\n  let suffix = ']'\n\n  if (subtype === 'collapsed') {\n    suffix += '[]'\n  } else if (subtype === 'full') {\n    suffix += '[' + (node.label || node.identifier) + ']'\n  }\n\n  if (node.type === 'imageReference') {\n    return [{type: 'text', value: '![' + node.alt + suffix}]\n  }\n\n  const contents = state.all(node)\n  const head = contents[0]\n\n  if (head && head.type === 'text') {\n    head.value = '[' + head.value\n  } else {\n    contents.unshift({type: 'text', value: '['})\n  }\n\n  const tail = contents[contents.length - 1]\n\n  if (tail && tail.type === 'text') {\n    tail.value += suffix\n  } else {\n    contents.push({type: 'text', value: suffix})\n  }\n\n  return contents\n}\n", "/**\n * @import {ElementContent, Element, Properties} from 'hast'\n * @import {ImageReference} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `imageReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ImageReference} node\n *   mdast node.\n * @returns {Array | ElementContent}\n *   hast node.\n */\nexport function imageReference(state, node) {\n  const id = String(node.identifier).toUpperCase()\n  const definition = state.definitionById.get(id)\n\n  if (!definition) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(definition.url || ''), alt: node.alt}\n\n  if (definition.title !== null && definition.title !== undefined) {\n    properties.title = definition.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Element, Properties} from 'hast'\n * @import {Image} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `image` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Image} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function image(state, node) {\n  /** @type {Properties} */\n  const properties = {src: normalizeUri(node.url)}\n\n  if (node.alt !== null && node.alt !== undefined) {\n    properties.alt = node.alt\n  }\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'img', properties, children: []}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Element, Text} from 'hast'\n * @import {InlineCode} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `inlineCode` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {InlineCode} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function inlineCode(state, node) {\n  /** @type {Text} */\n  const text = {type: 'text', value: node.value.replace(/\\r?\\n|\\r/g, ' ')}\n  state.patch(node, text)\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'code',\n    properties: {},\n    children: [text]\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {ElementContent, Element, Properties} from 'hast'\n * @import {LinkReference} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\nimport {revert} from '../revert.js'\n\n/**\n * Turn an mdast `linkReference` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {LinkReference} node\n *   mdast node.\n * @returns {Array | ElementContent}\n *   hast node.\n */\nexport function linkReference(state, node) {\n  const id = String(node.identifier).toUpperCase()\n  const definition = state.definitionById.get(id)\n\n  if (!definition) {\n    return revert(state, node)\n  }\n\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(definition.url || '')}\n\n  if (definition.title !== null && definition.title !== undefined) {\n    properties.title = definition.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Element, Properties} from 'hast'\n * @import {Link} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Turn an mdast `link` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Link} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function link(state, node) {\n  /** @type {Properties} */\n  const properties = {href: normalizeUri(node.url)}\n\n  if (node.title !== null && node.title !== undefined) {\n    properties.title = node.title\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'a',\n    properties,\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {ElementContent, Element, Properties} from 'hast'\n * @import {ListItem, Parents} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `listItem` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ListItem} node\n *   mdast node.\n * @param {Parents | undefined} parent\n *   Parent of `node`.\n * @returns {Element}\n *   hast node.\n */\nexport function listItem(state, node, parent) {\n  const results = state.all(node)\n  const loose = parent ? listLoose(parent) : listItemLoose(node)\n  /** @type {Properties} */\n  const properties = {}\n  /** @type {Array} */\n  const children = []\n\n  if (typeof node.checked === 'boolean') {\n    const head = results[0]\n    /** @type {Element} */\n    let paragraph\n\n    if (head && head.type === 'element' && head.tagName === 'p') {\n      paragraph = head\n    } else {\n      paragraph = {type: 'element', tagName: 'p', properties: {}, children: []}\n      results.unshift(paragraph)\n    }\n\n    if (paragraph.children.length > 0) {\n      paragraph.children.unshift({type: 'text', value: ' '})\n    }\n\n    paragraph.children.unshift({\n      type: 'element',\n      tagName: 'input',\n      properties: {type: 'checkbox', checked: node.checked, disabled: true},\n      children: []\n    })\n\n    // According to github-markdown-css, this class hides bullet.\n    // See: .\n    properties.className = ['task-list-item']\n  }\n\n  let index = -1\n\n  while (++index < results.length) {\n    const child = results[index]\n\n    // Add eols before nodes, except if this is a loose, first paragraph.\n    if (\n      loose ||\n      index !== 0 ||\n      child.type !== 'element' ||\n      child.tagName !== 'p'\n    ) {\n      children.push({type: 'text', value: '\\n'})\n    }\n\n    if (child.type === 'element' && child.tagName === 'p' && !loose) {\n      children.push(...child.children)\n    } else {\n      children.push(child)\n    }\n  }\n\n  const tail = results[results.length - 1]\n\n  // Add a final eol.\n  if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) {\n    children.push({type: 'text', value: '\\n'})\n  }\n\n  /** @type {Element} */\n  const result = {type: 'element', tagName: 'li', properties, children}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n\n/**\n * @param {Parents} node\n * @return {Boolean}\n */\nfunction listLoose(node) {\n  let loose = false\n  if (node.type === 'list') {\n    loose = node.spread || false\n    const children = node.children\n    let index = -1\n\n    while (!loose && ++index < children.length) {\n      loose = listItemLoose(children[index])\n    }\n  }\n\n  return loose\n}\n\n/**\n * @param {ListItem} node\n * @return {Boolean}\n */\nfunction listItemLoose(node) {\n  const spread = node.spread\n\n  return spread === null || spread === undefined\n    ? node.children.length > 1\n    : spread\n}\n", "/**\n * @import {Element, Properties} from 'hast'\n * @import {List} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `list` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {List} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function list(state, node) {\n  /** @type {Properties} */\n  const properties = {}\n  const results = state.all(node)\n  let index = -1\n\n  if (typeof node.start === 'number' && node.start !== 1) {\n    properties.start = node.start\n  }\n\n  // Like GitHub, add a class for custom styling.\n  while (++index < results.length) {\n    const child = results[index]\n\n    if (\n      child.type === 'element' &&\n      child.tagName === 'li' &&\n      child.properties &&\n      Array.isArray(child.properties.className) &&\n      child.properties.className.includes('task-list-item')\n    ) {\n      properties.className = ['contains-task-list']\n      break\n    }\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: node.ordered ? 'ol' : 'ul',\n    properties,\n    children: state.wrap(results, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Element} from 'hast'\n * @import {Paragraph} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `paragraph` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Paragraph} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function paragraph(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'p',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Parents as HastParents, Root as HastRoot} from 'hast'\n * @import {Root as MdastRoot} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `root` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastRoot} node\n *   mdast node.\n * @returns {HastParents}\n *   hast node.\n */\nexport function root(state, node) {\n  /** @type {HastRoot} */\n  const result = {type: 'root', children: state.wrap(state.all(node))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Element} from 'hast'\n * @import {Strong} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `strong` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Strong} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function strong(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'strong',\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Table} from 'mdast'\n * @import {Element} from 'hast'\n * @import {State} from '../state.js'\n */\n\nimport {pointEnd, pointStart} from 'unist-util-position'\n\n/**\n * Turn an mdast `table` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {Table} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function table(state, node) {\n  const rows = state.all(node)\n  const firstRow = rows.shift()\n  /** @type {Array} */\n  const tableContent = []\n\n  if (firstRow) {\n    /** @type {Element} */\n    const head = {\n      type: 'element',\n      tagName: 'thead',\n      properties: {},\n      children: state.wrap([firstRow], true)\n    }\n    state.patch(node.children[0], head)\n    tableContent.push(head)\n  }\n\n  if (rows.length > 0) {\n    /** @type {Element} */\n    const body = {\n      type: 'element',\n      tagName: 'tbody',\n      properties: {},\n      children: state.wrap(rows, true)\n    }\n\n    const start = pointStart(node.children[1])\n    const end = pointEnd(node.children[node.children.length - 1])\n    if (start && end) body.position = {start, end}\n    tableContent.push(body)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'table',\n    properties: {},\n    children: state.wrap(tableContent, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Element, ElementContent, Properties} from 'hast'\n * @import {Parents, TableRow} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `tableRow` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableRow} node\n *   mdast node.\n * @param {Parents | undefined} parent\n *   Parent of `node`.\n * @returns {Element}\n *   hast node.\n */\nexport function tableRow(state, node, parent) {\n  const siblings = parent ? parent.children : undefined\n  // Generate a body row when without parent.\n  const rowIndex = siblings ? siblings.indexOf(node) : 1\n  const tagName = rowIndex === 0 ? 'th' : 'td'\n  // To do: option to use `style`?\n  const align = parent && parent.type === 'table' ? parent.align : undefined\n  const length = align ? align.length : node.children.length\n  let cellIndex = -1\n  /** @type {Array} */\n  const cells = []\n\n  while (++cellIndex < length) {\n    // Note: can also be undefined.\n    const cell = node.children[cellIndex]\n    /** @type {Properties} */\n    const properties = {}\n    const alignValue = align ? align[cellIndex] : undefined\n\n    if (alignValue) {\n      properties.align = alignValue\n    }\n\n    /** @type {Element} */\n    let result = {type: 'element', tagName, properties, children: []}\n\n    if (cell) {\n      result.children = state.all(cell)\n      state.patch(cell, result)\n      result = state.applyData(cell, result)\n    }\n\n    cells.push(result)\n  }\n\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'tr',\n    properties: {},\n    children: state.wrap(cells, true)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Element} from 'hast'\n * @import {TableCell} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `tableCell` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {TableCell} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function tableCell(state, node) {\n  // Note: this function is normally not called: see `table-row` for how rows\n  // and their cells are compiled.\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'td', // Assume body cell.\n    properties: {},\n    children: state.all(node)\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "const tab = 9 /* `\\t` */\nconst space = 32 /* ` ` */\n\n/**\n * Remove initial and final spaces and tabs at the line breaks in `value`.\n * Does not trim initial and final spaces and tabs of the value itself.\n *\n * @param {string} value\n *   Value to trim.\n * @returns {string}\n *   Trimmed value.\n */\nexport function trimLines(value) {\n  const source = String(value)\n  const search = /\\r?\\n|\\r/g\n  let match = search.exec(source)\n  let last = 0\n  /** @type {Array} */\n  const lines = []\n\n  while (match) {\n    lines.push(\n      trimLine(source.slice(last, match.index), last > 0, true),\n      match[0]\n    )\n\n    last = match.index + match[0].length\n    match = search.exec(source)\n  }\n\n  lines.push(trimLine(source.slice(last), last > 0, false))\n\n  return lines.join('')\n}\n\n/**\n * @param {string} value\n *   Line to trim.\n * @param {boolean} start\n *   Whether to trim the start of the line.\n * @param {boolean} end\n *   Whether to trim the end of the line.\n * @returns {string}\n *   Trimmed line.\n */\nfunction trimLine(value, start, end) {\n  let startIndex = 0\n  let endIndex = value.length\n\n  if (start) {\n    let code = value.codePointAt(startIndex)\n\n    while (code === tab || code === space) {\n      startIndex++\n      code = value.codePointAt(startIndex)\n    }\n  }\n\n  if (end) {\n    let code = value.codePointAt(endIndex - 1)\n\n    while (code === tab || code === space) {\n      endIndex--\n      code = value.codePointAt(endIndex - 1)\n    }\n  }\n\n  return endIndex > startIndex ? value.slice(startIndex, endIndex) : ''\n}\n", "/**\n * @import {Element as HastElement, Text as HastText} from 'hast'\n * @import {Text as MdastText} from 'mdast'\n * @import {State} from '../state.js'\n */\n\nimport {trimLines} from 'trim-lines'\n\n/**\n * Turn an mdast `text` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {MdastText} node\n *   mdast node.\n * @returns {HastElement | HastText}\n *   hast node.\n */\nexport function text(state, node) {\n  /** @type {HastText} */\n  const result = {type: 'text', value: trimLines(String(node.value))}\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Element} from 'hast'\n * @import {ThematicBreak} from 'mdast'\n * @import {State} from '../state.js'\n */\n\n/**\n * Turn an mdast `thematicBreak` node into hast.\n *\n * @param {State} state\n *   Info passed around.\n * @param {ThematicBreak} node\n *   mdast node.\n * @returns {Element}\n *   hast node.\n */\nexport function thematicBreak(state, node) {\n  /** @type {Element} */\n  const result = {\n    type: 'element',\n    tagName: 'hr',\n    properties: {},\n    children: []\n  }\n  state.patch(node, result)\n  return state.applyData(node, result)\n}\n", "/**\n * @import {Handlers} from '../state.js'\n */\n\nimport {blockquote} from './blockquote.js'\nimport {hardBreak} from './break.js'\nimport {code} from './code.js'\nimport {strikethrough} from './delete.js'\nimport {emphasis} from './emphasis.js'\nimport {footnoteReference} from './footnote-reference.js'\nimport {heading} from './heading.js'\nimport {html} from './html.js'\nimport {imageReference} from './image-reference.js'\nimport {image} from './image.js'\nimport {inlineCode} from './inline-code.js'\nimport {linkReference} from './link-reference.js'\nimport {link} from './link.js'\nimport {listItem} from './list-item.js'\nimport {list} from './list.js'\nimport {paragraph} from './paragraph.js'\nimport {root} from './root.js'\nimport {strong} from './strong.js'\nimport {table} from './table.js'\nimport {tableRow} from './table-row.js'\nimport {tableCell} from './table-cell.js'\nimport {text} from './text.js'\nimport {thematicBreak} from './thematic-break.js'\n\n/**\n * Default handlers for nodes.\n *\n * @satisfies {Handlers}\n */\nexport const handlers = {\n  blockquote,\n  break: hardBreak,\n  code,\n  delete: strikethrough,\n  emphasis,\n  footnoteReference,\n  heading,\n  html,\n  imageReference,\n  image,\n  inlineCode,\n  linkReference,\n  link,\n  listItem,\n  list,\n  paragraph,\n  // @ts-expect-error: root is different, but hard to type.\n  root,\n  strong,\n  table,\n  tableCell,\n  tableRow,\n  text,\n  thematicBreak,\n  toml: ignore,\n  yaml: ignore,\n  definition: ignore,\n  footnoteDefinition: ignore\n}\n\n// Return nothing for nodes that are ignored.\nfunction ignore() {\n  return undefined\n}\n", "import {\n  VOID, PRIMITIVE,\n  ARRAY, OBJECT,\n  DATE, REGEXP, MAP, SET,\n  ERROR, BIGINT\n} from './types.js';\n\nconst env = typeof self === 'object' ? self : globalThis;\n\nconst deserializer = ($, _) => {\n  const as = (out, index) => {\n    $.set(index, out);\n    return out;\n  };\n\n  const unpair = index => {\n    if ($.has(index))\n      return $.get(index);\n\n    const [type, value] = _[index];\n    switch (type) {\n      case PRIMITIVE:\n      case VOID:\n        return as(value, index);\n      case ARRAY: {\n        const arr = as([], index);\n        for (const index of value)\n          arr.push(unpair(index));\n        return arr;\n      }\n      case OBJECT: {\n        const object = as({}, index);\n        for (const [key, index] of value)\n          object[unpair(key)] = unpair(index);\n        return object;\n      }\n      case DATE:\n        return as(new Date(value), index);\n      case REGEXP: {\n        const {source, flags} = value;\n        return as(new RegExp(source, flags), index);\n      }\n      case MAP: {\n        const map = as(new Map, index);\n        for (const [key, index] of value)\n          map.set(unpair(key), unpair(index));\n        return map;\n      }\n      case SET: {\n        const set = as(new Set, index);\n        for (const index of value)\n          set.add(unpair(index));\n        return set;\n      }\n      case ERROR: {\n        const {name, message} = value;\n        return as(new env[name](message), index);\n      }\n      case BIGINT:\n        return as(BigInt(value), index);\n      case 'BigInt':\n        return as(Object(BigInt(value)), index);\n      case 'ArrayBuffer':\n        return as(new Uint8Array(value).buffer, value);\n      case 'DataView': {\n        const { buffer } = new Uint8Array(value);\n        return as(new DataView(buffer), value);\n      }\n    }\n    return as(new env[type](value), index);\n  };\n\n  return unpair;\n};\n\n/**\n * @typedef {Array} Record a type representation\n */\n\n/**\n * Returns a deserialized value from a serialized array of Records.\n * @param {Record[]} serialized a previously serialized value.\n * @returns {any}\n */\nexport const deserialize = serialized => deserializer(new Map, serialized)(0);\n", "import {\n  VOID, PRIMITIVE,\n  ARRAY, OBJECT,\n  DATE, REGEXP, MAP, SET,\n  ERROR, BIGINT\n} from './types.js';\n\nconst EMPTY = '';\n\nconst {toString} = {};\nconst {keys} = Object;\n\nconst typeOf = value => {\n  const type = typeof value;\n  if (type !== 'object' || !value)\n    return [PRIMITIVE, type];\n\n  const asString = toString.call(value).slice(8, -1);\n  switch (asString) {\n    case 'Array':\n      return [ARRAY, EMPTY];\n    case 'Object':\n      return [OBJECT, EMPTY];\n    case 'Date':\n      return [DATE, EMPTY];\n    case 'RegExp':\n      return [REGEXP, EMPTY];\n    case 'Map':\n      return [MAP, EMPTY];\n    case 'Set':\n      return [SET, EMPTY];\n    case 'DataView':\n      return [ARRAY, asString];\n  }\n\n  if (asString.includes('Array'))\n    return [ARRAY, asString];\n\n  if (asString.includes('Error'))\n    return [ERROR, asString];\n\n  return [OBJECT, asString];\n};\n\nconst shouldSkip = ([TYPE, type]) => (\n  TYPE === PRIMITIVE &&\n  (type === 'function' || type === 'symbol')\n);\n\nconst serializer = (strict, json, $, _) => {\n\n  const as = (out, value) => {\n    const index = _.push(out) - 1;\n    $.set(value, index);\n    return index;\n  };\n\n  const pair = value => {\n    if ($.has(value))\n      return $.get(value);\n\n    let [TYPE, type] = typeOf(value);\n    switch (TYPE) {\n      case PRIMITIVE: {\n        let entry = value;\n        switch (type) {\n          case 'bigint':\n            TYPE = BIGINT;\n            entry = value.toString();\n            break;\n          case 'function':\n          case 'symbol':\n            if (strict)\n              throw new TypeError('unable to serialize ' + type);\n            entry = null;\n            break;\n          case 'undefined':\n            return as([VOID], value);\n        }\n        return as([TYPE, entry], value);\n      }\n      case ARRAY: {\n        if (type) {\n          let spread = value;\n          if (type === 'DataView') {\n            spread = new Uint8Array(value.buffer);\n          }\n          else if (type === 'ArrayBuffer') {\n            spread = new Uint8Array(value);\n          }\n          return as([type, [...spread]], value);\n        }\n\n        const arr = [];\n        const index = as([TYPE, arr], value);\n        for (const entry of value)\n          arr.push(pair(entry));\n        return index;\n      }\n      case OBJECT: {\n        if (type) {\n          switch (type) {\n            case 'BigInt':\n              return as([type, value.toString()], value);\n            case 'Boolean':\n            case 'Number':\n            case 'String':\n              return as([type, value.valueOf()], value);\n          }\n        }\n\n        if (json && ('toJSON' in value))\n          return pair(value.toJSON());\n\n        const entries = [];\n        const index = as([TYPE, entries], value);\n        for (const key of keys(value)) {\n          if (strict || !shouldSkip(typeOf(value[key])))\n            entries.push([pair(key), pair(value[key])]);\n        }\n        return index;\n      }\n      case DATE:\n        return as([TYPE, value.toISOString()], value);\n      case REGEXP: {\n        const {source, flags} = value;\n        return as([TYPE, {source, flags}], value);\n      }\n      case MAP: {\n        const entries = [];\n        const index = as([TYPE, entries], value);\n        for (const [key, entry] of value) {\n          if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry))))\n            entries.push([pair(key), pair(entry)]);\n        }\n        return index;\n      }\n      case SET: {\n        const entries = [];\n        const index = as([TYPE, entries], value);\n        for (const entry of value) {\n          if (strict || !shouldSkip(typeOf(entry)))\n            entries.push(pair(entry));\n        }\n        return index;\n      }\n    }\n\n    const {message} = value;\n    return as([TYPE, {name: type, message}], value);\n  };\n\n  return pair;\n};\n\n/**\n * @typedef {Array} Record a type representation\n */\n\n/**\n * Returns an array of serialized Records.\n * @param {any} value a serializable value.\n * @param {{json?: boolean, lossy?: boolean}?} options an object with a `lossy` or `json` property that,\n *  if `true`, will not throw errors on incompatible types, and behave more\n *  like JSON stringify would behave. Symbol and Function will be discarded.\n * @returns {Record[]}\n */\n export const serialize = (value, {json, lossy} = {}) => {\n  const _ = [];\n  return serializer(!(json || lossy), !!json, new Map, _)(value), _;\n};\n", "import {deserialize} from './deserialize.js';\nimport {serialize} from './serialize.js';\n\n/**\n * @typedef {Array} Record a type representation\n */\n\n/**\n * Returns an array of serialized Records.\n * @param {any} any a serializable value.\n * @param {{transfer?: any[], json?: boolean, lossy?: boolean}?} options an object with\n * a transfer option (ignored when polyfilled) and/or non standard fields that\n * fallback to the polyfill if present.\n * @returns {Record[]}\n */\nexport default typeof structuredClone === \"function\" ?\n  /* c8 ignore start */\n  (any, options) => (\n    options && ('json' in options || 'lossy' in options) ?\n      deserialize(serialize(any, options)) : structuredClone(any)\n  ) :\n  (any, options) => deserialize(serialize(any, options));\n  /* c8 ignore stop */\n\nexport {deserialize, serialize};\n", "/**\n * @import {ElementContent, Element} from 'hast'\n * @import {State} from './state.js'\n */\n\n/**\n * @callback FootnoteBackContentTemplate\n *   Generate content for the backreference dynamically.\n *\n *   For the following markdown:\n *\n *   ```markdown\n *   Alpha[^micromark], bravo[^micromark], and charlie[^remark].\n *\n *   [^remark]: things about remark\n *   [^micromark]: things about micromark\n *   ```\n *\n *   This function will be called with:\n *\n *   *  `0` and `0` for the backreference from `things about micromark` to\n *      `alpha`, as it is the first used definition, and the first call to it\n *   *  `0` and `1` for the backreference from `things about micromark` to\n *      `bravo`, as it is the first used definition, and the second call to it\n *   *  `1` and `0` for the backreference from `things about remark` to\n *      `charlie`, as it is the second used definition\n * @param {number} referenceIndex\n *   Index of the definition in the order that they are first referenced,\n *   0-indexed.\n * @param {number} rereferenceIndex\n *   Index of calls to the same definition, 0-indexed.\n * @returns {Array | ElementContent | string}\n *   Content for the backreference when linking back from definitions to their\n *   reference.\n *\n * @callback FootnoteBackLabelTemplate\n *   Generate a back label dynamically.\n *\n *   For the following markdown:\n *\n *   ```markdown\n *   Alpha[^micromark], bravo[^micromark], and charlie[^remark].\n *\n *   [^remark]: things about remark\n *   [^micromark]: things about micromark\n *   ```\n *\n *   This function will be called with:\n *\n *   *  `0` and `0` for the backreference from `things about micromark` to\n *      `alpha`, as it is the first used definition, and the first call to it\n *   *  `0` and `1` for the backreference from `things about micromark` to\n *      `bravo`, as it is the first used definition, and the second call to it\n *   *  `1` and `0` for the backreference from `things about remark` to\n *      `charlie`, as it is the second used definition\n * @param {number} referenceIndex\n *   Index of the definition in the order that they are first referenced,\n *   0-indexed.\n * @param {number} rereferenceIndex\n *   Index of calls to the same definition, 0-indexed.\n * @returns {string}\n *   Back label to use when linking back from definitions to their reference.\n */\n\nimport structuredClone from '@ungap/structured-clone'\nimport {normalizeUri} from 'micromark-util-sanitize-uri'\n\n/**\n * Generate the default content that GitHub uses on backreferences.\n *\n * @param {number} _\n *   Index of the definition in the order that they are first referenced,\n *   0-indexed.\n * @param {number} rereferenceIndex\n *   Index of calls to the same definition, 0-indexed.\n * @returns {Array}\n *   Content.\n */\nexport function defaultFootnoteBackContent(_, rereferenceIndex) {\n  /** @type {Array} */\n  const result = [{type: 'text', value: '\u21A9'}]\n\n  if (rereferenceIndex > 1) {\n    result.push({\n      type: 'element',\n      tagName: 'sup',\n      properties: {},\n      children: [{type: 'text', value: String(rereferenceIndex)}]\n    })\n  }\n\n  return result\n}\n\n/**\n * Generate the default label that GitHub uses on backreferences.\n *\n * @param {number} referenceIndex\n *   Index of the definition in the order that they are first referenced,\n *   0-indexed.\n * @param {number} rereferenceIndex\n *   Index of calls to the same definition, 0-indexed.\n * @returns {string}\n *   Label.\n */\nexport function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {\n  return (\n    'Back to reference ' +\n    (referenceIndex + 1) +\n    (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')\n  )\n}\n\n/**\n * Generate a hast footer for called footnote definitions.\n *\n * @param {State} state\n *   Info passed around.\n * @returns {Element | undefined}\n *   `section` element or `undefined`.\n */\n// eslint-disable-next-line complexity\nexport function footer(state) {\n  const clobberPrefix =\n    typeof state.options.clobberPrefix === 'string'\n      ? state.options.clobberPrefix\n      : 'user-content-'\n  const footnoteBackContent =\n    state.options.footnoteBackContent || defaultFootnoteBackContent\n  const footnoteBackLabel =\n    state.options.footnoteBackLabel || defaultFootnoteBackLabel\n  const footnoteLabel = state.options.footnoteLabel || 'Footnotes'\n  const footnoteLabelTagName = state.options.footnoteLabelTagName || 'h2'\n  const footnoteLabelProperties = state.options.footnoteLabelProperties || {\n    className: ['sr-only']\n  }\n  /** @type {Array} */\n  const listItems = []\n  let referenceIndex = -1\n\n  while (++referenceIndex < state.footnoteOrder.length) {\n    const definition = state.footnoteById.get(\n      state.footnoteOrder[referenceIndex]\n    )\n\n    if (!definition) {\n      continue\n    }\n\n    const content = state.all(definition)\n    const id = String(definition.identifier).toUpperCase()\n    const safeId = normalizeUri(id.toLowerCase())\n    let rereferenceIndex = 0\n    /** @type {Array} */\n    const backReferences = []\n    const counts = state.footnoteCounts.get(id)\n\n    // eslint-disable-next-line no-unmodified-loop-condition\n    while (counts !== undefined && ++rereferenceIndex <= counts) {\n      if (backReferences.length > 0) {\n        backReferences.push({type: 'text', value: ' '})\n      }\n\n      let children =\n        typeof footnoteBackContent === 'string'\n          ? footnoteBackContent\n          : footnoteBackContent(referenceIndex, rereferenceIndex)\n\n      if (typeof children === 'string') {\n        children = {type: 'text', value: children}\n      }\n\n      backReferences.push({\n        type: 'element',\n        tagName: 'a',\n        properties: {\n          href:\n            '#' +\n            clobberPrefix +\n            'fnref-' +\n            safeId +\n            (rereferenceIndex > 1 ? '-' + rereferenceIndex : ''),\n          dataFootnoteBackref: '',\n          ariaLabel:\n            typeof footnoteBackLabel === 'string'\n              ? footnoteBackLabel\n              : footnoteBackLabel(referenceIndex, rereferenceIndex),\n          className: ['data-footnote-backref']\n        },\n        children: Array.isArray(children) ? children : [children]\n      })\n    }\n\n    const tail = content[content.length - 1]\n\n    if (tail && tail.type === 'element' && tail.tagName === 'p') {\n      const tailTail = tail.children[tail.children.length - 1]\n      if (tailTail && tailTail.type === 'text') {\n        tailTail.value += ' '\n      } else {\n        tail.children.push({type: 'text', value: ' '})\n      }\n\n      tail.children.push(...backReferences)\n    } else {\n      content.push(...backReferences)\n    }\n\n    /** @type {Element} */\n    const listItem = {\n      type: 'element',\n      tagName: 'li',\n      properties: {id: clobberPrefix + 'fn-' + safeId},\n      children: state.wrap(content, true)\n    }\n\n    state.patch(definition, listItem)\n\n    listItems.push(listItem)\n  }\n\n  if (listItems.length === 0) {\n    return\n  }\n\n  return {\n    type: 'element',\n    tagName: 'section',\n    properties: {dataFootnotes: true, className: ['footnotes']},\n    children: [\n      {\n        type: 'element',\n        tagName: footnoteLabelTagName,\n        properties: {\n          ...structuredClone(footnoteLabelProperties),\n          id: 'footnote-label'\n        },\n        children: [{type: 'text', value: footnoteLabel}]\n      },\n      {type: 'text', value: '\\n'},\n      {\n        type: 'element',\n        tagName: 'ol',\n        properties: {},\n        children: state.wrap(listItems, true)\n      },\n      {type: 'text', value: '\\n'}\n    ]\n  }\n}\n", "/**\n * @import {\n *   ElementContent as HastElementContent,\n *   Element as HastElement,\n *   Nodes as HastNodes,\n *   Properties as HastProperties,\n *   RootContent as HastRootContent,\n *   Text as HastText\n * } from 'hast'\n * @import {\n *   Definition as MdastDefinition,\n *   FootnoteDefinition as MdastFootnoteDefinition,\n *   Nodes as MdastNodes,\n *   Parents as MdastParents\n * } from 'mdast'\n * @import {VFile} from 'vfile'\n * @import {\n *   FootnoteBackContentTemplate,\n *   FootnoteBackLabelTemplate\n * } from './footer.js'\n */\n\n/**\n * @callback Handler\n *   Handle a node.\n * @param {State} state\n *   Info passed around.\n * @param {any} node\n *   mdast node to handle.\n * @param {MdastParents | undefined} parent\n *   Parent of `node`.\n * @returns {Array | HastElementContent | undefined}\n *   hast node.\n *\n * @typedef {Partial>} Handlers\n *   Handle nodes.\n *\n * @typedef Options\n *   Configuration (optional).\n * @property {boolean | null | undefined} [allowDangerousHtml=false]\n *   Whether to persist raw HTML in markdown in the hast tree (default:\n *   `false`).\n * @property {string | null | undefined} [clobberPrefix='user-content-']\n *   Prefix to use before the `id` property on footnotes to prevent them from\n *   *clobbering* (default: `'user-content-'`).\n *\n *   Pass `''` for trusted markdown and when you are careful with\n *   polyfilling.\n *   You could pass a different prefix.\n *\n *   DOM clobbering is this:\n *\n *   ```html\n *   

\n * \n * ```\n *\n * The above example shows that elements are made available by browsers, by\n * their ID, on the `window` object.\n * This is a security risk because you might be expecting some other variable\n * at that place.\n * It can also break polyfills.\n * Using a prefix solves these problems.\n * @property {VFile | null | undefined} [file]\n * Corresponding virtual file representing the input document (optional).\n * @property {FootnoteBackContentTemplate | string | null | undefined} [footnoteBackContent]\n * Content of the backreference back to references (default: `defaultFootnoteBackContent`).\n *\n * The default value is:\n *\n * ```js\n * function defaultFootnoteBackContent(_, rereferenceIndex) {\n * const result = [{type: 'text', value: '\u21A9'}]\n *\n * if (rereferenceIndex > 1) {\n * result.push({\n * type: 'element',\n * tagName: 'sup',\n * properties: {},\n * children: [{type: 'text', value: String(rereferenceIndex)}]\n * })\n * }\n *\n * return result\n * }\n * ```\n *\n * This content is used in the `a` element of each backreference (the `\u21A9`\n * links).\n * @property {FootnoteBackLabelTemplate | string | null | undefined} [footnoteBackLabel]\n * Label to describe the backreference back to references (default:\n * `defaultFootnoteBackLabel`).\n *\n * The default value is:\n *\n * ```js\n * function defaultFootnoteBackLabel(referenceIndex, rereferenceIndex) {\n * return (\n * 'Back to reference ' +\n * (referenceIndex + 1) +\n * (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')\n * )\n * }\n * ```\n *\n * Change it when the markdown is not in English.\n *\n * This label is used in the `ariaLabel` property on each backreference\n * (the `\u21A9` links).\n * It affects users of assistive technology.\n * @property {string | null | undefined} [footnoteLabel='Footnotes']\n * Textual label to use for the footnotes section (default: `'Footnotes'`).\n *\n * Change it when the markdown is not in English.\n *\n * This label is typically hidden visually (assuming a `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass different properties with the `footnoteLabelProperties` option.\n * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}]\n * Properties to use on the footnote label (default: `{className:\n * ['sr-only']}`).\n *\n * Change it to show the label and add other properties.\n *\n * This label is typically hidden visually (assuming an `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass an empty string.\n * You can also add different properties.\n *\n * > **Note**: `id: 'footnote-label'` is always added, because footnote\n * > calls use it with `aria-describedby` to provide an accessible label.\n * @property {string | null | undefined} [footnoteLabelTagName='h2']\n * HTML tag name to use for the footnote label element (default: `'h2'`).\n *\n * Change it to match your document structure.\n *\n * This label is typically hidden visually (assuming a `sr-only` CSS class\n * is defined that does that) and so affects screen readers only.\n * If you do have such a class, but want to show this section to everyone,\n * pass different properties with the `footnoteLabelProperties` option.\n * @property {Handlers | null | undefined} [handlers]\n * Extra handlers for nodes (optional).\n * @property {Array | null | undefined} [passThrough]\n * List of custom mdast node types to pass through (keep) in hast (note that\n * the node itself is passed, but eventual children are transformed)\n * (optional).\n * @property {Handler | null | undefined} [unknownHandler]\n * Handler for all unknown nodes (optional).\n *\n * @typedef State\n * Info passed around.\n * @property {(node: MdastNodes) => Array} all\n * Transform the children of an mdast parent to hast.\n * @property {(from: MdastNodes, to: Type) => HastElement | Type} applyData\n * Honor the `data` of `from`, and generate an element instead of `node`.\n * @property {Map} definitionById\n * Definitions by their identifier.\n * @property {Map} footnoteById\n * Footnote definitions by their identifier.\n * @property {Map} footnoteCounts\n * Counts for how often the same footnote was called.\n * @property {Array} footnoteOrder\n * Identifiers of order when footnote calls first appear in tree order.\n * @property {Handlers} handlers\n * Applied handlers.\n * @property {(node: MdastNodes, parent: MdastParents | undefined) => Array | HastElementContent | undefined} one\n * Transform an mdast node to hast.\n * @property {Options} options\n * Configuration.\n * @property {(from: MdastNodes, node: HastNodes) => undefined} patch\n * Copy a node\u2019s positional info.\n * @property {(nodes: Array, loose?: boolean | undefined) => Array} wrap\n * Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`.\n */\n\nimport structuredClone from '@ungap/structured-clone'\nimport {visit} from 'unist-util-visit'\nimport {position} from 'unist-util-position'\nimport {handlers as defaultHandlers} from './handlers/index.js'\n\nconst own = {}.hasOwnProperty\n\n/** @type {Options} */\nconst emptyOptions = {}\n\n/**\n * Create `state` from an mdast tree.\n *\n * @param {MdastNodes} tree\n * mdast node to transform.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {State}\n * `state` function.\n */\nexport function createState(tree, options) {\n const settings = options || emptyOptions\n /** @type {Map} */\n const definitionById = new Map()\n /** @type {Map} */\n const footnoteById = new Map()\n /** @type {Map} */\n const footnoteCounts = new Map()\n /** @type {Handlers} */\n // @ts-expect-error: the root handler returns a root.\n // Hard to type.\n const handlers = {...defaultHandlers, ...settings.handlers}\n\n /** @type {State} */\n const state = {\n all,\n applyData,\n definitionById,\n footnoteById,\n footnoteCounts,\n footnoteOrder: [],\n handlers,\n one,\n options: settings,\n patch,\n wrap\n }\n\n visit(tree, function (node) {\n if (node.type === 'definition' || node.type === 'footnoteDefinition') {\n const map = node.type === 'definition' ? definitionById : footnoteById\n const id = String(node.identifier).toUpperCase()\n\n // Mimick CM behavior of link definitions.\n // See: .\n if (!map.has(id)) {\n // @ts-expect-error: node type matches map.\n map.set(id, node)\n }\n }\n })\n\n return state\n\n /**\n * Transform an mdast node into a hast node.\n *\n * @param {MdastNodes} node\n * mdast node.\n * @param {MdastParents | undefined} [parent]\n * Parent of `node`.\n * @returns {Array | HastElementContent | undefined}\n * Resulting hast node.\n */\n function one(node, parent) {\n const type = node.type\n const handle = state.handlers[type]\n\n if (own.call(state.handlers, type) && handle) {\n return handle(state, node, parent)\n }\n\n if (state.options.passThrough && state.options.passThrough.includes(type)) {\n if ('children' in node) {\n const {children, ...shallow} = node\n const result = structuredClone(shallow)\n // @ts-expect-error: TS doesn\u2019t understand\u2026\n result.children = state.all(node)\n // @ts-expect-error: TS doesn\u2019t understand\u2026\n return result\n }\n\n // @ts-expect-error: it\u2019s custom.\n return structuredClone(node)\n }\n\n const unknown = state.options.unknownHandler || defaultUnknownHandler\n\n return unknown(state, node, parent)\n }\n\n /**\n * Transform the children of an mdast node into hast nodes.\n *\n * @param {MdastNodes} parent\n * mdast node to compile\n * @returns {Array}\n * Resulting hast nodes.\n */\n function all(parent) {\n /** @type {Array} */\n const values = []\n\n if ('children' in parent) {\n const nodes = parent.children\n let index = -1\n while (++index < nodes.length) {\n const result = state.one(nodes[index], parent)\n\n // To do: see if we van clean this? Can we merge texts?\n if (result) {\n if (index && nodes[index - 1].type === 'break') {\n if (!Array.isArray(result) && result.type === 'text') {\n result.value = trimMarkdownSpaceStart(result.value)\n }\n\n if (!Array.isArray(result) && result.type === 'element') {\n const head = result.children[0]\n\n if (head && head.type === 'text') {\n head.value = trimMarkdownSpaceStart(head.value)\n }\n }\n }\n\n if (Array.isArray(result)) {\n values.push(...result)\n } else {\n values.push(result)\n }\n }\n }\n }\n\n return values\n }\n}\n\n/**\n * Copy a node\u2019s positional info.\n *\n * @param {MdastNodes} from\n * mdast node to copy from.\n * @param {HastNodes} to\n * hast node to copy into.\n * @returns {undefined}\n * Nothing.\n */\nfunction patch(from, to) {\n if (from.position) to.position = position(from)\n}\n\n/**\n * Honor the `data` of `from` and maybe generate an element instead of `to`.\n *\n * @template {HastNodes} Type\n * Node type.\n * @param {MdastNodes} from\n * mdast node to use data from.\n * @param {Type} to\n * hast node to change.\n * @returns {HastElement | Type}\n * Nothing.\n */\nfunction applyData(from, to) {\n /** @type {HastElement | Type} */\n let result = to\n\n // Handle `data.hName`, `data.hProperties, `data.hChildren`.\n if (from && from.data) {\n const hName = from.data.hName\n const hChildren = from.data.hChildren\n const hProperties = from.data.hProperties\n\n if (typeof hName === 'string') {\n // Transforming the node resulted in an element with a different name\n // than wanted:\n if (result.type === 'element') {\n result.tagName = hName\n }\n // Transforming the node resulted in a non-element, which happens for\n // raw, text, and root nodes (unless custom handlers are passed).\n // The intent of `hName` is to create an element, but likely also to keep\n // the content around (otherwise: pass `hChildren`).\n else {\n /** @type {Array} */\n // @ts-expect-error: assume no doctypes in `root`.\n const children = 'children' in result ? result.children : [result]\n result = {type: 'element', tagName: hName, properties: {}, children}\n }\n }\n\n if (result.type === 'element' && hProperties) {\n Object.assign(result.properties, structuredClone(hProperties))\n }\n\n if (\n 'children' in result &&\n result.children &&\n hChildren !== null &&\n hChildren !== undefined\n ) {\n result.children = hChildren\n }\n }\n\n return result\n}\n\n/**\n * Transform an unknown node.\n *\n * @param {State} state\n * Info passed around.\n * @param {MdastNodes} node\n * Unknown mdast node.\n * @returns {HastElement | HastText}\n * Resulting hast node.\n */\nfunction defaultUnknownHandler(state, node) {\n const data = node.data || {}\n /** @type {HastElement | HastText} */\n const result =\n 'value' in node &&\n !(own.call(data, 'hProperties') || own.call(data, 'hChildren'))\n ? {type: 'text', value: node.value}\n : {\n type: 'element',\n tagName: 'div',\n properties: {},\n children: state.all(node)\n }\n\n state.patch(node, result)\n return state.applyData(node, result)\n}\n\n/**\n * Wrap `nodes` with line endings between each node.\n *\n * @template {HastRootContent} Type\n * Node type.\n * @param {Array} nodes\n * List of nodes to wrap.\n * @param {boolean | undefined} [loose=false]\n * Whether to add line endings at start and end (default: `false`).\n * @returns {Array}\n * Wrapped nodes.\n */\nexport function wrap(nodes, loose) {\n /** @type {Array} */\n const result = []\n let index = -1\n\n if (loose) {\n result.push({type: 'text', value: '\\n'})\n }\n\n while (++index < nodes.length) {\n if (index) result.push({type: 'text', value: '\\n'})\n result.push(nodes[index])\n }\n\n if (loose && nodes.length > 0) {\n result.push({type: 'text', value: '\\n'})\n }\n\n return result\n}\n\n/**\n * Trim spaces and tabs at the start of `value`.\n *\n * @param {string} value\n * Value to trim.\n * @returns {string}\n * Result.\n */\nfunction trimMarkdownSpaceStart(value) {\n let index = 0\n let code = value.charCodeAt(index)\n\n while (code === 9 || code === 32) {\n index++\n code = value.charCodeAt(index)\n }\n\n return value.slice(index)\n}\n", "/**\n * @import {Nodes as HastNodes} from 'hast'\n * @import {Nodes as MdastNodes} from 'mdast'\n * @import {Options} from './state.js'\n */\n\nimport {ok as assert} from 'devlop'\nimport {footer} from './footer.js'\nimport {createState} from './state.js'\n\n/**\n * Transform mdast to hast.\n *\n * ##### Notes\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most utilities ignore `raw` nodes but two notable ones don\u2019t:\n *\n * * `hast-util-to-html` also has an option `allowDangerousHtml` which will\n * output the raw HTML.\n * This is typically discouraged as noted by the option name but is useful\n * if you completely trust authors\n * * `hast-util-raw` can handle the raw embedded HTML strings by parsing them\n * into standard hast nodes (`element`, `text`, etc).\n * This is a heavy task as it needs a full HTML parser, but it is the only\n * way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark, which we follow by default.\n * They are supported by GitHub, so footnotes can be enabled in markdown with\n * `mdast-util-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes, which is hidden for sighted users but shown to\n * assistive technology.\n * When your page is not in English, you must define translated values.\n *\n * Back references use ARIA attributes, but the section label itself uses a\n * heading that is hidden with an `sr-only` class.\n * To show it to sighted users, define different attributes in\n * `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem, as it links footnote calls to footnote\n * definitions on the page through `id` attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n *

\n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * Example: headings (DOM clobbering) in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn\u2019t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value` (and doesn\u2019t have `data.hName`,\n * `data.hProperties`, or `data.hChildren`, see later), create a hast `text`\n * node\n * * otherwise, create a `
` element (which could be changed with\n * `data.hName`), with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @param {MdastNodes} tree\n * mdast tree.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {HastNodes}\n * hast tree.\n */\nexport function toHast(tree, options) {\n const state = createState(tree, options)\n const node = state.one(tree, undefined)\n const foot = footer(state)\n /** @type {HastNodes} */\n const result = Array.isArray(node)\n ? {type: 'root', children: node}\n : node || {type: 'root', children: []}\n\n if (foot) {\n // If there\u2019s a footer, there were definitions, meaning block\n // content.\n // So `result` is a parent node.\n assert('children' in result)\n result.children.push({type: 'text', value: '\\n'}, foot)\n }\n\n return result\n}\n", "/**\n * @import {Root as HastRoot} from 'hast'\n * @import {Root as MdastRoot} from 'mdast'\n * @import {Options as ToHastOptions} from 'mdast-util-to-hast'\n * @import {Processor} from 'unified'\n * @import {VFile} from 'vfile'\n */\n\n/**\n * @typedef {Omit} Options\n *\n * @callback TransformBridge\n * Bridge-mode.\n *\n * Runs the destination with the new hast tree.\n * Discards result.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {Promise}\n * Nothing.\n *\n * @callback TransformMutate\n * Mutate-mode.\n *\n * Further transformers run on the hast tree.\n * @param {MdastRoot} tree\n * Tree.\n * @param {VFile} file\n * File.\n * @returns {HastRoot}\n * Tree (hast).\n */\n\nimport {toHast} from 'mdast-util-to-hast'\n\n/**\n * Turn markdown into HTML.\n *\n * ##### Notes\n *\n * ###### Signature\n *\n * * if a processor is given,\n * runs the (rehype) plugins used on it with a hast tree,\n * then discards the result (*bridge mode*)\n * * otherwise,\n * returns a hast tree,\n * the plugins used after `remarkRehype` are rehype plugins (*mutate mode*)\n *\n * > \uD83D\uDC49 **Note**:\n * > It\u2019s highly unlikely that you want to pass a `processor`.\n *\n * ###### HTML\n *\n * Raw HTML is available in mdast as `html` nodes and can be embedded in hast\n * as semistandard `raw` nodes.\n * Most plugins ignore `raw` nodes but two notable ones don\u2019t:\n *\n * * `rehype-stringify` also has an option `allowDangerousHtml` which will\n * output the raw HTML.\n * This is typically discouraged as noted by the option name but is useful if\n * you completely trust authors\n * * `rehype-raw` can handle the raw embedded HTML strings by parsing them\n * into standard hast nodes (`element`, `text`, etc);\n * this is a heavy task as it needs a full HTML parser,\n * but it is the only way to support untrusted content\n *\n * ###### Footnotes\n *\n * Many options supported here relate to footnotes.\n * Footnotes are not specified by CommonMark,\n * which we follow by default.\n * They are supported by GitHub,\n * so footnotes can be enabled in markdown with `remark-gfm`.\n *\n * The options `footnoteBackLabel` and `footnoteLabel` define natural language\n * that explains footnotes,\n * which is hidden for sighted users but shown to assistive technology.\n * When your page is not in English,\n * you must define translated values.\n *\n * Back references use ARIA attributes,\n * but the section label itself uses a heading that is hidden with an\n * `sr-only` class.\n * To show it to sighted users,\n * define different attributes in `footnoteLabelProperties`.\n *\n * ###### Clobbering\n *\n * Footnotes introduces a problem,\n * as it links footnote calls to footnote definitions on the page through `id`\n * attributes generated from user content,\n * which results in DOM clobbering.\n *\n * DOM clobbering is this:\n *\n * ```html\n *

\n * \n * ```\n *\n * Elements by their ID are made available by browsers on the `window` object,\n * which is a security risk.\n * Using a prefix solves this problem.\n *\n * More information on how to handle clobbering and the prefix is explained in\n * *Example: headings (DOM clobbering)* in `rehype-sanitize`.\n *\n * ###### Unknown nodes\n *\n * Unknown nodes are nodes with a type that isn\u2019t in `handlers` or `passThrough`.\n * The default behavior for unknown nodes is:\n *\n * * when the node has a `value`\n * (and doesn\u2019t have `data.hName`, `data.hProperties`, or `data.hChildren`,\n * see later),\n * create a hast `text` node\n * * otherwise,\n * create a `
` element (which could be changed with `data.hName`),\n * with its children mapped from mdast to hast as well\n *\n * This behavior can be changed by passing an `unknownHandler`.\n *\n * @overload\n * @param {Processor} processor\n * @param {Readonly | null | undefined} [options]\n * @returns {TransformBridge}\n *\n * @overload\n * @param {Readonly | null | undefined} [options]\n * @returns {TransformMutate}\n *\n * @overload\n * @param {Readonly | Processor | null | undefined} [destination]\n * @param {Readonly | null | undefined} [options]\n * @returns {TransformBridge | TransformMutate}\n *\n * @param {Readonly | Processor | null | undefined} [destination]\n * Processor or configuration (optional).\n * @param {Readonly | null | undefined} [options]\n * When a processor was given,\n * configuration (optional).\n * @returns {TransformBridge | TransformMutate}\n * Transform.\n */\nexport default function remarkRehype(destination, options) {\n if (destination && 'run' in destination) {\n /**\n * @type {TransformBridge}\n */\n return async function (tree, file) {\n // Cast because root in -> root out.\n const hastTree = /** @type {HastRoot} */ (\n toHast(tree, {file, ...options})\n )\n await destination.run(hastTree, file)\n }\n }\n\n /**\n * @type {TransformMutate}\n */\n return function (tree, file) {\n // Cast because root in -> root out.\n // To do: in the future, disallow ` || options` fallback.\n // With `unified-engine`, `destination` can be `undefined` but\n // `options` will be the file set.\n // We should not pass that as `options`.\n return /** @type {HastRoot} */ (\n toHast(tree, {file, ...(destination || options)})\n )\n }\n}\n", "/**\n * @import {Comment, Doctype, Element, Nodes, RootContent, Root, Text} from 'hast'\n * @import {DefaultTreeAdapterMap, Token} from 'parse5'\n * @import {Schema} from 'property-information'\n */\n\n/**\n * @typedef {DefaultTreeAdapterMap['document']} Parse5Document\n * @typedef {DefaultTreeAdapterMap['documentFragment']} Parse5Fragment\n * @typedef {DefaultTreeAdapterMap['element']} Parse5Element\n * @typedef {DefaultTreeAdapterMap['node']} Parse5Nodes\n * @typedef {DefaultTreeAdapterMap['documentType']} Parse5Doctype\n * @typedef {DefaultTreeAdapterMap['commentNode']} Parse5Comment\n * @typedef {DefaultTreeAdapterMap['textNode']} Parse5Text\n * @typedef {DefaultTreeAdapterMap['parentNode']} Parse5Parent\n * @typedef {Token.Attribute} Parse5Attribute\n *\n * @typedef Options\n * Configuration.\n * @property {Space | null | undefined} [space='html']\n * Which space the document is in (default: `'html'`).\n *\n * When an `` element is found in the HTML space, this package already\n * automatically switches to and from the SVG space when entering and exiting\n * it.\n *\n * @typedef {Exclude} Parse5Content\n *\n * @typedef {'html' | 'svg'} Space\n */\n\nimport {stringify as commas} from 'comma-separated-tokens'\nimport {ok as assert} from 'devlop'\nimport {find, html, svg} from 'property-information'\nimport {stringify as spaces} from 'space-separated-tokens'\nimport {webNamespaces} from 'web-namespaces'\nimport {zwitch} from 'zwitch'\n\n/** @type {Options} */\nconst emptyOptions = {}\n\nconst own = {}.hasOwnProperty\n\nconst one = zwitch('type', {handlers: {root, element, text, comment, doctype}})\n\n/**\n * Transform a hast tree to a `parse5` AST.\n *\n * @param {Nodes} tree\n * Tree to transform.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {Parse5Nodes}\n * `parse5` node.\n */\nexport function toParse5(tree, options) {\n const settings = options || emptyOptions\n const space = settings.space\n return one(tree, space === 'svg' ? svg : html)\n}\n\n/**\n * @param {Root} node\n * Node (hast) to transform.\n * @param {Schema} schema\n * Current schema.\n * @returns {Parse5Document}\n * Parse5 node.\n */\nfunction root(node, schema) {\n /** @type {Parse5Document} */\n const result = {\n nodeName: '#document',\n // @ts-expect-error: `parse5` uses enums, which are actually strings.\n mode: (node.data || {}).quirksMode ? 'quirks' : 'no-quirks',\n childNodes: []\n }\n result.childNodes = all(node.children, result, schema)\n patch(node, result)\n return result\n}\n\n/**\n * @param {Root} node\n * Node (hast) to transform.\n * @param {Schema} schema\n * Current schema.\n * @returns {Parse5Fragment}\n * Parse5 node.\n */\nfunction fragment(node, schema) {\n /** @type {Parse5Fragment} */\n const result = {nodeName: '#document-fragment', childNodes: []}\n result.childNodes = all(node.children, result, schema)\n patch(node, result)\n return result\n}\n\n/**\n * @param {Doctype} node\n * Node (hast) to transform.\n * @returns {Parse5Doctype}\n * Parse5 node.\n */\nfunction doctype(node) {\n /** @type {Parse5Doctype} */\n const result = {\n nodeName: '#documentType',\n name: 'html',\n publicId: '',\n systemId: '',\n parentNode: null\n }\n\n patch(node, result)\n return result\n}\n\n/**\n * @param {Text} node\n * Node (hast) to transform.\n * @returns {Parse5Text}\n * Parse5 node.\n */\nfunction text(node) {\n /** @type {Parse5Text} */\n const result = {\n nodeName: '#text',\n value: node.value,\n parentNode: null\n }\n patch(node, result)\n return result\n}\n\n/**\n * @param {Comment} node\n * Node (hast) to transform.\n * @returns {Parse5Comment}\n * Parse5 node.\n */\nfunction comment(node) {\n /** @type {Parse5Comment} */\n const result = {\n nodeName: '#comment',\n data: node.value,\n parentNode: null\n }\n\n patch(node, result)\n\n return result\n}\n\n/**\n * @param {Element} node\n * Node (hast) to transform.\n * @param {Schema} schema\n * Current schema.\n * @returns {Parse5Element}\n * Parse5 node.\n */\nfunction element(node, schema) {\n const parentSchema = schema\n let currentSchema = parentSchema\n\n if (\n node.type === 'element' &&\n node.tagName.toLowerCase() === 'svg' &&\n parentSchema.space === 'html'\n ) {\n currentSchema = svg\n }\n\n /** @type {Array} */\n const attrs = []\n /** @type {string} */\n let prop\n\n if (node.properties) {\n for (prop in node.properties) {\n if (prop !== 'children' && own.call(node.properties, prop)) {\n const result = createProperty(\n currentSchema,\n prop,\n node.properties[prop]\n )\n\n if (result) {\n attrs.push(result)\n }\n }\n }\n }\n\n const space = currentSchema.space\n // `html` and `svg` both have a space.\n assert(space)\n\n /** @type {Parse5Element} */\n const result = {\n nodeName: node.tagName,\n tagName: node.tagName,\n attrs,\n // @ts-expect-error: `parse5` types are wrong.\n namespaceURI: webNamespaces[space],\n childNodes: [],\n parentNode: null\n }\n result.childNodes = all(node.children, result, currentSchema)\n patch(node, result)\n\n if (node.tagName === 'template' && node.content) {\n // @ts-expect-error: `parse5` types are wrong.\n result.content = fragment(node.content, currentSchema)\n }\n\n return result\n}\n\n/**\n * Handle a property.\n *\n * @param {Schema} schema\n * Current schema.\n * @param {string} prop\n * Key.\n * @param {Array | boolean | number | string | null | undefined} value\n * hast property value.\n * @returns {Parse5Attribute | undefined}\n * Field for runtime, optional.\n */\nfunction createProperty(schema, prop, value) {\n const info = find(schema, prop)\n\n // Ignore nullish and `NaN` values.\n if (\n value === false ||\n value === null ||\n value === undefined ||\n (typeof value === 'number' && Number.isNaN(value)) ||\n (!value && info.boolean)\n ) {\n return\n }\n\n if (Array.isArray(value)) {\n // Accept `array`.\n // Most props are space-separated.\n value = info.commaSeparated ? commas(value) : spaces(value)\n }\n\n /** @type {Parse5Attribute} */\n const attribute = {\n name: info.attribute,\n value: value === true ? '' : String(value)\n }\n\n if (info.space && info.space !== 'html' && info.space !== 'svg') {\n const index = attribute.name.indexOf(':')\n\n if (index < 0) {\n attribute.prefix = ''\n } else {\n attribute.name = attribute.name.slice(index + 1)\n attribute.prefix = info.attribute.slice(0, index)\n }\n\n attribute.namespace = webNamespaces[info.space]\n }\n\n return attribute\n}\n\n/**\n * Transform all hast nodes.\n *\n * @param {Array} children\n * List of children.\n * @param {Parse5Parent} parentNode\n * `parse5` parent node.\n * @param {Schema} schema\n * Current schema.\n * @returns {Array}\n * Transformed children.\n */\nfunction all(children, parentNode, schema) {\n let index = -1\n /** @type {Array} */\n const results = []\n\n if (children) {\n while (++index < children.length) {\n /** @type {Parse5Content} */\n const child = one(children[index], schema)\n\n child.parentNode = parentNode\n\n results.push(child)\n }\n }\n\n return results\n}\n\n/**\n * Add position info from `from` to `to`.\n *\n * @param {Nodes} from\n * hast node.\n * @param {Parse5Nodes} to\n * `parse5` node.\n * @returns {undefined}\n * Nothing.\n */\nfunction patch(from, to) {\n const position = from.position\n\n if (position && position.start && position.end) {\n assert(typeof position.start.offset === 'number')\n assert(typeof position.end.offset === 'number')\n\n to.sourceCodeLocation = {\n startLine: position.start.line,\n startCol: position.start.column,\n startOffset: position.start.offset,\n endLine: position.end.line,\n endCol: position.end.column,\n endOffset: position.end.offset\n }\n }\n}\n", "/**\n * @import {Options} from 'hast-util-raw'\n * @import {Comment, Doctype, Element, Nodes, RootContent, Root, Text} from 'hast'\n * @import {Raw} from 'mdast-util-to-hast'\n * @import {DefaultTreeAdapterMap, ParserOptions} from 'parse5'\n * @import {Point} from 'unist'\n */\n\n/**\n * @typedef State\n * Info passed around about the current state.\n * @property {(node: Nodes) => undefined} handle\n * Add a hast node to the parser.\n * @property {Options} options\n * User configuration.\n * @property {Parser} parser\n * Current parser.\n * @property {boolean} stitches\n * Whether there are stitches.\n */\n\n/**\n * @typedef Stitch\n * Custom comment-like value we pass through parse5, which contains a\n * replacement node that we\u2019ll swap back in afterwards.\n * @property {'comment'} type\n * Node type.\n * @property {{stitch: Nodes}} value\n * Replacement value.\n */\n\nimport structuredClone from '@ungap/structured-clone'\nimport {fromParse5} from 'hast-util-from-parse5'\nimport {toParse5} from 'hast-util-to-parse5'\nimport {htmlVoidElements} from 'html-void-elements'\nimport {Parser, Token, TokenizerMode, html} from 'parse5'\nimport {pointEnd, pointStart} from 'unist-util-position'\nimport {visit} from 'unist-util-visit'\nimport {webNamespaces} from 'web-namespaces'\nimport {zwitch} from 'zwitch'\n\nconst gfmTagfilterExpression =\n /<(\\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\\t\\n\\f\\r />])/gi\n\n// Node types associated with MDX.\n// \nconst knownMdxNames = new Set([\n 'mdxFlowExpression',\n 'mdxJsxFlowElement',\n 'mdxJsxTextElement',\n 'mdxTextExpression',\n 'mdxjsEsm'\n])\n\n/** @type {ParserOptions} */\nconst parseOptions = {sourceCodeLocationInfo: true, scriptingEnabled: false}\n\n/**\n * Pass a hast tree through an HTML parser, which will fix nesting, and turn\n * raw nodes into actual nodes.\n *\n * @param {Nodes} tree\n * Original hast tree to transform.\n * @param {Options | null | undefined} [options]\n * Configuration (optional).\n * @returns {Nodes}\n * Parsed again tree.\n */\nexport function raw(tree, options) {\n const document = documentMode(tree)\n /** @type {(node: Nodes, state: State) => undefined} */\n const one = zwitch('type', {\n handlers: {root, element, text, comment, doctype, raw: handleRaw},\n unknown\n })\n\n /** @type {State} */\n const state = {\n parser: document\n ? new Parser(parseOptions)\n : Parser.getFragmentParser(undefined, parseOptions),\n handle(node) {\n one(node, state)\n },\n stitches: false,\n options: options || {}\n }\n\n one(tree, state)\n resetTokenizer(state, pointStart())\n\n const p5 = document ? state.parser.document : state.parser.getFragment()\n const result = fromParse5(p5, {\n // To do: support `space`?\n file: state.options.file\n })\n\n if (state.stitches) {\n visit(result, 'comment', function (node, index, parent) {\n const stitch = /** @type {Stitch} */ (/** @type {unknown} */ (node))\n if (stitch.value.stitch && parent && index !== undefined) {\n /** @type {Array} */\n const siblings = parent.children\n // @ts-expect-error: assume the stitch is allowed.\n siblings[index] = stitch.value.stitch\n return index\n }\n })\n }\n\n // Unpack if possible and when not given a `root`.\n if (\n result.type === 'root' &&\n result.children.length === 1 &&\n result.children[0].type === tree.type\n ) {\n return result.children[0]\n }\n\n return result\n}\n\n/**\n * Transform all nodes\n *\n * @param {Array} nodes\n * hast content.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {undefined}\n * Nothing.\n */\nfunction all(nodes, state) {\n let index = -1\n\n /* istanbul ignore else - invalid nodes, see rehypejs/rehype-raw#7. */\n if (nodes) {\n while (++index < nodes.length) {\n state.handle(nodes[index])\n }\n }\n}\n\n/**\n * Transform a root.\n *\n * @param {Root} node\n * hast root node.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {undefined}\n * Nothing.\n */\nfunction root(node, state) {\n all(node.children, state)\n}\n\n/**\n * Transform an element.\n *\n * @param {Element} node\n * hast element node.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {undefined}\n * Nothing.\n */\nfunction element(node, state) {\n startTag(node, state)\n\n all(node.children, state)\n\n endTag(node, state)\n}\n\n/**\n * Transform a text.\n *\n * @param {Text} node\n * hast text node.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {undefined}\n * Nothing.\n */\nfunction text(node, state) {\n // Allow `DATA` through `PLAINTEXT`,\n // but when hanging in a tag for example,\n // switch back to `DATA`.\n // Note: `State` is not exposed by `parse5`, so these numbers are fragile.\n // See: \n if (state.parser.tokenizer.state > 4) {\n state.parser.tokenizer.state = 0\n }\n\n /** @type {Token.CharacterToken} */\n const token = {\n type: Token.TokenType.CHARACTER,\n chars: node.value,\n location: createParse5Location(node)\n }\n\n resetTokenizer(state, pointStart(node))\n // @ts-expect-error: private.\n state.parser.currentToken = token\n // @ts-expect-error: private.\n state.parser._processToken(state.parser.currentToken)\n}\n\n/**\n * Transform a doctype.\n *\n * @param {Doctype} node\n * hast doctype node.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {undefined}\n * Nothing.\n */\nfunction doctype(node, state) {\n /** @type {Token.DoctypeToken} */\n const token = {\n type: Token.TokenType.DOCTYPE,\n name: 'html',\n forceQuirks: false,\n publicId: '',\n systemId: '',\n location: createParse5Location(node)\n }\n\n resetTokenizer(state, pointStart(node))\n // @ts-expect-error: private.\n state.parser.currentToken = token\n // @ts-expect-error: private.\n state.parser._processToken(state.parser.currentToken)\n}\n\n/**\n * Transform a stitch.\n *\n * @param {Nodes} node\n * unknown node.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {undefined}\n * Nothing.\n */\nfunction stitch(node, state) {\n // Mark that there are stitches, so we need to walk the tree and revert them.\n state.stitches = true\n\n /** @type {Nodes} */\n const clone = cloneWithoutChildren(node)\n\n // Recurse, because to somewhat handle `[]` (where `[]` denotes the\n // passed through node).\n if ('children' in node && 'children' in clone) {\n // Root in root out.\n const fakeRoot = /** @type {Root} */ (\n raw({type: 'root', children: node.children}, state.options)\n )\n clone.children = fakeRoot.children\n }\n\n // Hack: `value` is supposed to be a string, but as none of the tools\n // (`parse5` or `hast-util-from-parse5`) looks at it, we can pass nodes\n // through.\n comment({type: 'comment', value: {stitch: clone}}, state)\n}\n\n/**\n * Transform a comment (or stitch).\n *\n * @param {Comment | Stitch} node\n * hast comment node.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {undefined}\n * Nothing.\n */\nfunction comment(node, state) {\n /** @type {string} */\n // @ts-expect-error: we pass stitches through.\n const data = node.value\n\n /** @type {Token.CommentToken} */\n const token = {\n type: Token.TokenType.COMMENT,\n data,\n location: createParse5Location(node)\n }\n resetTokenizer(state, pointStart(node))\n // @ts-expect-error: private.\n state.parser.currentToken = token\n // @ts-expect-error: private.\n state.parser._processToken(state.parser.currentToken)\n}\n\n/**\n * Transform a raw node.\n *\n * @param {Raw} node\n * hast raw node.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {undefined}\n * Nothing.\n */\nfunction handleRaw(node, state) {\n // Reset preprocessor:\n // See: .\n state.parser.tokenizer.preprocessor.html = ''\n state.parser.tokenizer.preprocessor.pos = -1\n // @ts-expect-error: private.\n // type-coverage:ignore-next-line\n state.parser.tokenizer.preprocessor.lastGapPos = -2\n // @ts-expect-error: private.\n // type-coverage:ignore-next-line\n state.parser.tokenizer.preprocessor.gapStack = []\n // @ts-expect-error: private.\n // type-coverage:ignore-next-line\n state.parser.tokenizer.preprocessor.skipNextNewLine = false\n state.parser.tokenizer.preprocessor.lastChunkWritten = false\n state.parser.tokenizer.preprocessor.endOfChunkHit = false\n // @ts-expect-error: private.\n // type-coverage:ignore-next-line\n state.parser.tokenizer.preprocessor.isEol = false\n\n // Now pass `node.value`.\n setPoint(state, pointStart(node))\n\n state.parser.tokenizer.write(\n state.options.tagfilter\n ? node.value.replace(gfmTagfilterExpression, '<$1$2')\n : node.value,\n false\n )\n // @ts-expect-error: private.\n state.parser.tokenizer._runParsingLoop()\n\n // Character references hang, so if we ended there, we need to flush\n // those too.\n // We reset the preprocessor as if the document ends here.\n // Then one single call to the relevant state does the trick, parse5\n // consumes the whole token.\n\n // Note: `State` is not exposed by `parse5`, so these numbers are fragile.\n // See: \n // Note: a change to `parse5`, which breaks this, was merged but not released.\n // Investigate when it is.\n // To do: remove next major.\n /* c8 ignore next 12 -- removed in */\n if (\n state.parser.tokenizer.state === 72 /* NAMED_CHARACTER_REFERENCE */ ||\n // @ts-expect-error: removed.\n state.parser.tokenizer.state === 78 /* NUMERIC_CHARACTER_REFERENCE_END */\n ) {\n state.parser.tokenizer.preprocessor.lastChunkWritten = true\n /** @type {number} */\n // @ts-expect-error: private.\n const cp = state.parser.tokenizer._consume()\n // @ts-expect-error: private.\n state.parser.tokenizer._callState(cp)\n }\n}\n\n/**\n * Crash on an unknown node.\n *\n * @param {unknown} node_\n * unknown node.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {undefined}\n * Never.\n */\nfunction unknown(node_, state) {\n const node = /** @type {Nodes} */ (node_)\n\n if (\n state.options.passThrough &&\n state.options.passThrough.includes(node.type)\n ) {\n stitch(node, state)\n } else {\n let extra = ''\n\n if (knownMdxNames.has(node.type)) {\n extra =\n \". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax\"\n }\n\n throw new Error('Cannot compile `' + node.type + '` node' + extra)\n }\n}\n\n/**\n * Reset the tokenizer of a parser.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {Point | undefined} point\n * Point.\n * @returns {undefined}\n * Nothing.\n */\nfunction resetTokenizer(state, point) {\n setPoint(state, point)\n\n // Process final characters if they\u2019re still there after hibernating.\n /** @type {Token.CharacterToken} */\n // @ts-expect-error: private.\n const token = state.parser.tokenizer.currentCharacterToken\n\n if (token && token.location) {\n token.location.endLine = state.parser.tokenizer.preprocessor.line\n token.location.endCol = state.parser.tokenizer.preprocessor.col + 1\n token.location.endOffset = state.parser.tokenizer.preprocessor.offset + 1\n // @ts-expect-error: private.\n state.parser.currentToken = token\n // @ts-expect-error: private.\n state.parser._processToken(state.parser.currentToken)\n }\n\n // Reset tokenizer:\n // See: .\n // Especially putting it back in the `data` state is useful: some elements,\n // like textareas and iframes, change the state.\n // See GH-7.\n // But also if broken HTML is in `raw`, and then a correct element is given.\n // See GH-11.\n // @ts-expect-error: private.\n state.parser.tokenizer.paused = false\n // @ts-expect-error: private.\n state.parser.tokenizer.inLoop = false\n\n // Note: don\u2019t reset `state`, `inForeignNode`, or `lastStartTagName`, we\n // manually update those when needed.\n state.parser.tokenizer.active = false\n // @ts-expect-error: private.\n state.parser.tokenizer.returnState = TokenizerMode.DATA\n // @ts-expect-error: private.\n state.parser.tokenizer.charRefCode = -1\n // @ts-expect-error: private.\n state.parser.tokenizer.consumedAfterSnapshot = -1\n // @ts-expect-error: private.\n state.parser.tokenizer.currentLocation = null\n // @ts-expect-error: private.\n state.parser.tokenizer.currentCharacterToken = null\n // @ts-expect-error: private.\n state.parser.tokenizer.currentToken = null\n // @ts-expect-error: private.\n state.parser.tokenizer.currentAttr = {name: '', value: ''}\n}\n\n/**\n * Set current location.\n *\n * @param {State} state\n * Info passed around about the current state.\n * @param {Point | undefined} point\n * Point.\n * @returns {undefined}\n * Nothing.\n */\nfunction setPoint(state, point) {\n if (point && point.offset !== undefined) {\n /** @type {Token.Location} */\n const location = {\n startLine: point.line,\n startCol: point.column,\n startOffset: point.offset,\n endLine: -1,\n endCol: -1,\n endOffset: -1\n }\n\n // @ts-expect-error: private.\n // type-coverage:ignore-next-line\n state.parser.tokenizer.preprocessor.lineStartPos = -point.column + 1 // Looks weird, but ensures we get correct positional info.\n state.parser.tokenizer.preprocessor.droppedBufferSize = point.offset\n state.parser.tokenizer.preprocessor.line = point.line\n // @ts-expect-error: private.\n state.parser.tokenizer.currentLocation = location\n }\n}\n\n/**\n * Emit a start tag.\n *\n * @param {Element} node\n * Element.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {undefined}\n * Nothing.\n */\nfunction startTag(node, state) {\n const tagName = node.tagName.toLowerCase()\n\n // Ignore tags if we\u2019re in plain text.\n if (state.parser.tokenizer.state === TokenizerMode.PLAINTEXT) return\n\n resetTokenizer(state, pointStart(node))\n\n const current = state.parser.openElements.current\n let ns = 'namespaceURI' in current ? current.namespaceURI : webNamespaces.html\n\n if (ns === webNamespaces.html && tagName === 'svg') {\n ns = webNamespaces.svg\n }\n\n const result = toParse5(\n // Shallow clone to not delve into `children`: we only need the attributes.\n {...node, children: []},\n {space: ns === webNamespaces.svg ? 'svg' : 'html'}\n )\n\n /** @type {Token.TagToken} */\n const tag = {\n type: Token.TokenType.START_TAG,\n tagName,\n tagID: html.getTagID(tagName),\n // We always send start and end tags.\n selfClosing: false,\n ackSelfClosing: false,\n // Always element.\n /* c8 ignore next */\n attrs: 'attrs' in result ? result.attrs : [],\n location: createParse5Location(node)\n }\n\n // The HTML parsing algorithm works by doing half of the state management in\n // the tokenizer and half in the parser.\n // We can\u2019t use the tokenizer here, as we don\u2019t have strings.\n // So we act *as if* the tokenizer emits tokens:\n\n // @ts-expect-error: private.\n state.parser.currentToken = tag\n // @ts-expect-error: private.\n state.parser._processToken(state.parser.currentToken)\n\n // \u2026but then we still need a bunch of work that the tokenizer would normally\n // do, such as:\n\n // Set a tag name, similar to how the tokenizer would do it.\n state.parser.tokenizer.lastStartTagName = tagName\n\n // `inForeignNode` is correctly set by the parser.\n}\n\n/**\n * Emit an end tag.\n *\n * @param {Element} node\n * Element.\n * @param {State} state\n * Info passed around about the current state.\n * @returns {undefined}\n * Nothing.\n */\nfunction endTag(node, state) {\n const tagName = node.tagName.toLowerCase()\n // Do not emit closing tags for HTML void elements.\n if (\n !state.parser.tokenizer.inForeignNode &&\n htmlVoidElements.includes(tagName)\n ) {\n return\n }\n\n // Ignore tags if we\u2019re in plain text.\n if (state.parser.tokenizer.state === TokenizerMode.PLAINTEXT) return\n\n resetTokenizer(state, pointEnd(node))\n\n /** @type {Token.TagToken} */\n const tag = {\n type: Token.TokenType.END_TAG,\n tagName,\n tagID: html.getTagID(tagName),\n selfClosing: false,\n ackSelfClosing: false,\n attrs: [],\n location: createParse5Location(node)\n }\n\n // The HTML parsing algorithm works by doing half of the state management in\n // the tokenizer and half in the parser.\n // We can\u2019t use the tokenizer here, as we don\u2019t have strings.\n // So we act *as if* the tokenizer emits tokens:\n\n // @ts-expect-error: private.\n state.parser.currentToken = tag\n // @ts-expect-error: private.\n state.parser._processToken(state.parser.currentToken)\n\n // \u2026but then we still need a bunch of work that the tokenizer would normally\n // do, such as:\n\n // Switch back to the data state after alternative states that don\u2019t accept\n // tags:\n if (\n // Current element is closed.\n tagName === state.parser.tokenizer.lastStartTagName &&\n // `