tandem-editor 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -45,8 +45,8 @@ var NR=Object.defineProperty;var RR=(t,e,n)=>e in t?NR(t,e,{enumerable:!0,config
|
|
|
45
45
|
`);for(g=h=0;h<D.length&&!D[h].includes("DetermineComponentFrameRoot");)h++;for(;g<V.length&&!V[g].includes("DetermineComponentFrameRoot");)g++;if(h===D.length||g===V.length)for(h=D.length-1,g=V.length-1;1<=h&&0<=g&&D[h]!==V[g];)g--;for(;1<=h&&0<=g;h--,g--)if(D[h]!==V[g]){if(h!==1||g!==1)do if(h--,g--,0>g||D[h]!==V[g]){var G=`
|
|
46
46
|
`+D[h].replace(" at new "," at ");return l.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",l.displayName)),G}while(1<=h&&0<=g);break}}}finally{je=!1,Error.prepareStackTrace=u}return(u=l?l.displayName||l.name:"")?Nt(u):""}function Fi(l,a){switch(l.tag){case 26:case 27:case 5:return Nt(l.type);case 16:return Nt("Lazy");case 13:return l.child!==a&&a!==null?Nt("Suspense Fallback"):Nt("Suspense");case 19:return Nt("SuspenseList");case 0:case 15:return Fn(l.type,!1);case 11:return Fn(l.type.render,!1);case 1:return Fn(l.type,!0);case 31:return Nt("Activity");default:return""}}function qi(l){try{var a="",u=null;do a+=Fi(l,u),u=l,l=l.return;while(l);return a}catch(h){return`
|
|
47
47
|
Error generating stack: `+h.message+`
|
|
48
|
-
`+h.stack}}var Yi=Object.prototype.hasOwnProperty,li=t.unstable_scheduleCallback,ee=t.unstable_cancelCallback,Le=t.unstable_shouldYield,it=t.unstable_requestPaint,qe=t.unstable_now,pt=t.unstable_getCurrentPriorityLevel,Y=t.unstable_ImmediatePriority,oe=t.unstable_UserBlockingPriority,we=t.unstable_NormalPriority,Ue=t.unstable_LowPriority,ut=t.unstable_IdlePriority,oi=t.log,Ar=t.unstable_setDisableYieldValue,Ln=null,en=null;function qn(l){if(typeof oi=="function"&&Ar(l),en&&typeof en.setStrictMode=="function")try{en.setStrictMode(Ln,l)}catch{}}var xt=Math.clz32?Math.clz32:b2,cs=Math.log,Ki=Math.LN2;function b2(l){return l>>>=0,l===0?32:31-(cs(l)/Ki|0)|0}var df=256,hf=262144,pf=4194304;function dl(l){var a=l&42;if(a!==0)return a;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function mf(l,a,u){var h=l.pendingLanes;if(h===0)return 0;var g=0,x=l.suspendedLanes,w=l.pingedLanes;l=l.warmLanes;var C=h&134217727;return C!==0?(h=C&~x,h!==0?g=dl(h):(w&=C,w!==0?g=dl(w):u||(u=C&~l,u!==0&&(g=dl(u))))):(C=h&~x,C!==0?g=dl(C):w!==0?g=dl(w):u||(u=h&~l,u!==0&&(g=dl(u)))),g===0?0:a!==0&&a!==g&&(a&x)===0&&(x=g&-g,u=a&-a,x>=u||x===32&&(u&4194048)!==0)?a:g}function Ga(l,a){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&a)===0}function x2(l,a){switch(l){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 $x(){var l=pf;return pf<<=1,(pf&62914560)===0&&(pf=4194304),l}function mm(l){for(var a=[],u=0;31>u;u++)a.push(l);return a}function Za(l,a){l.pendingLanes|=a,a!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function S2(l,a,u,h,g,x){var w=l.pendingLanes;l.pendingLanes=u,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=u,l.entangledLanes&=u,l.errorRecoveryDisabledLanes&=u,l.shellSuspendCounter=0;var C=l.entanglements,D=l.expirationTimes,V=l.hiddenUpdates;for(u=w&~u;0<u;){var G=31-xt(u),X=1<<G;C[G]=0,D[G]=-1;var $=V[G];if($!==null)for(V[G]=null,G=0;G<$.length;G++){var q=$[G];q!==null&&(q.lane&=-536870913)}u&=~X}h!==0&&Fx(l,h,0),x!==0&&g===0&&l.tag!==0&&(l.suspendedLanes|=x&~(w&~a))}function Fx(l,a,u){l.pendingLanes|=a,l.suspendedLanes&=~a;var h=31-xt(a);l.entangledLanes|=a,l.entanglements[h]=l.entanglements[h]|1073741824|u&261930}function qx(l,a){var u=l.entangledLanes|=a;for(l=l.entanglements;u;){var h=31-xt(u),g=1<<h;g&a|l[h]&a&&(l[h]|=a),u&=~g}}function Yx(l,a){var u=a&-a;return u=(u&42)!==0?1:gm(u),(u&(l.suspendedLanes|a))!==0?0:u}function gm(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function ym(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function Kx(){var l=K.p;return l!==0?l:(l=window.event,l===void 0?32:Nk(l.type))}function Gx(l,a){var u=K.p;try{return K.p=l,a()}finally{K.p=u}}var us=Math.random().toString(36).slice(2),mn="__reactFiber$"+us,Yn="__reactProps$"+us,uo="__reactContainer$"+us,bm="__reactEvents$"+us,w2="__reactListeners$"+us,v2="__reactHandles$"+us,Zx="__reactResources$"+us,Ja="__reactMarker$"+us;function xm(l){delete l[mn],delete l[Yn],delete l[bm],delete l[w2],delete l[v2]}function fo(l){var a=l[mn];if(a)return a;for(var u=l.parentNode;u;){if(a=u[uo]||u[mn]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(l=gk(l);l!==null;){if(u=l[mn])return u;l=gk(l)}return a}l=u,u=l.parentNode}return null}function ho(l){if(l=l[mn]||l[uo]){var a=l.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return l}return null}function Xa(l){var a=l.tag;if(a===5||a===26||a===27||a===6)return l.stateNode;throw Error(i(33))}function po(l){var a=l[Zx];return a||(a=l[Zx]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function rn(l){l[Ja]=!0}var Jx=new Set,Xx={};function hl(l,a){mo(l,a),mo(l+"Capture",a)}function mo(l,a){for(Xx[l]=a,l=0;l<a.length;l++)Jx.add(a[l])}var k2=RegExp("^[: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]*$"),Wx={},Qx={};function C2(l){return Yi.call(Qx,l)?!0:Yi.call(Wx,l)?!1:k2.test(l)?Qx[l]=!0:(Wx[l]=!0,!1)}function gf(l,a,u){if(C2(a))if(u===null)l.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":l.removeAttribute(a);return;case"boolean":var h=a.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){l.removeAttribute(a);return}}l.setAttribute(a,""+u)}}function yf(l,a,u){if(u===null)l.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(a);return}l.setAttribute(a,""+u)}}function Mr(l,a,u,h){if(h===null)l.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(u);return}l.setAttributeNS(a,u,""+h)}}function vi(l){switch(typeof l){case"bigint":case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function eS(l){var a=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function E2(l,a,u){var h=Object.getOwnPropertyDescriptor(l.constructor.prototype,a);if(!l.hasOwnProperty(a)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var g=h.get,x=h.set;return Object.defineProperty(l,a,{configurable:!0,get:function(){return g.call(this)},set:function(w){u=""+w,x.call(this,w)}}),Object.defineProperty(l,a,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(w){u=""+w},stopTracking:function(){l._valueTracker=null,delete l[a]}}}}function Sm(l){if(!l._valueTracker){var a=eS(l)?"checked":"value";l._valueTracker=E2(l,a,""+l[a])}}function tS(l){if(!l)return!1;var a=l._valueTracker;if(!a)return!0;var u=a.getValue(),h="";return l&&(h=eS(l)?l.checked?"true":"false":l.value),l=h,l!==u?(a.setValue(l),!0):!1}function bf(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var T2=/[\n"\\]/g;function ki(l){return l.replace(T2,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function wm(l,a,u,h,g,x,w,C){l.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?l.type=w:l.removeAttribute("type"),a!=null?w==="number"?(a===0&&l.value===""||l.value!=a)&&(l.value=""+vi(a)):l.value!==""+vi(a)&&(l.value=""+vi(a)):w!=="submit"&&w!=="reset"||l.removeAttribute("value"),a!=null?vm(l,w,vi(a)):u!=null?vm(l,w,vi(u)):h!=null&&l.removeAttribute("value"),g==null&&x!=null&&(l.defaultChecked=!!x),g!=null&&(l.checked=g&&typeof g!="function"&&typeof g!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?l.name=""+vi(C):l.removeAttribute("name")}function nS(l,a,u,h,g,x,w,C){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(l.type=x),a!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||a!=null)){Sm(l);return}u=u!=null?""+vi(u):"",a=a!=null?""+vi(a):u,C||a===l.value||(l.value=a),l.defaultValue=a}h=h??g,h=typeof h!="function"&&typeof h!="symbol"&&!!h,l.checked=C?l.checked:!!h,l.defaultChecked=!!h,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(l.name=w),Sm(l)}function vm(l,a,u){a==="number"&&bf(l.ownerDocument)===l||l.defaultValue===""+u||(l.defaultValue=""+u)}function go(l,a,u,h){if(l=l.options,a){a={};for(var g=0;g<u.length;g++)a["$"+u[g]]=!0;for(u=0;u<l.length;u++)g=a.hasOwnProperty("$"+l[u].value),l[u].selected!==g&&(l[u].selected=g),g&&h&&(l[u].defaultSelected=!0)}else{for(u=""+vi(u),a=null,g=0;g<l.length;g++){if(l[g].value===u){l[g].selected=!0,h&&(l[g].defaultSelected=!0);return}a!==null||l[g].disabled||(a=l[g])}a!==null&&(a.selected=!0)}}function iS(l,a,u){if(a!=null&&(a=""+vi(a),a!==l.value&&(l.value=a),u==null)){l.defaultValue!==a&&(l.defaultValue=a);return}l.defaultValue=u!=null?""+vi(u):""}function rS(l,a,u,h){if(a==null){if(h!=null){if(u!=null)throw Error(i(92));if(Z(h)){if(1<h.length)throw Error(i(93));h=h[0]}u=h}u==null&&(u=""),a=u}u=vi(a),l.defaultValue=u,h=l.textContent,h===u&&h!==""&&h!==null&&(l.value=h),Sm(l)}function yo(l,a){if(a){var u=l.firstChild;if(u&&u===l.lastChild&&u.nodeType===3){u.nodeValue=a;return}}l.textContent=a}var A2=new Set("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(" "));function sS(l,a,u){var h=a.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?l.setProperty(a,""):a==="float"?l.cssFloat="":l[a]="":h?l.setProperty(a,u):typeof u!="number"||u===0||A2.has(a)?a==="float"?l.cssFloat=u:l[a]=(""+u).trim():l[a]=u+"px"}function lS(l,a,u){if(a!=null&&typeof a!="object")throw Error(i(62));if(l=l.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||a!=null&&a.hasOwnProperty(h)||(h.indexOf("--")===0?l.setProperty(h,""):h==="float"?l.cssFloat="":l[h]="");for(var g in a)h=a[g],a.hasOwnProperty(g)&&u[g]!==h&&sS(l,g,h)}else for(var x in a)a.hasOwnProperty(x)&&sS(l,x,a[x])}function km(l){if(l.indexOf("-")===-1)return!1;switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var M2=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),O2=/^[\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;function xf(l){return O2.test(""+l)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":l}function Or(){}var Cm=null;function Em(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var bo=null,xo=null;function oS(l){var a=ho(l);if(a&&(l=a.stateNode)){var u=l[Yn]||null;e:switch(l=a.stateNode,a.type){case"input":if(wm(l,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),a=u.name,u.type==="radio"&&a!=null){for(u=l;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+ki(""+a)+'"][type="radio"]'),a=0;a<u.length;a++){var h=u[a];if(h!==l&&h.form===l.form){var g=h[Yn]||null;if(!g)throw Error(i(90));wm(h,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(a=0;a<u.length;a++)h=u[a],h.form===l.form&&tS(h)}break e;case"textarea":iS(l,u.value,u.defaultValue);break e;case"select":a=u.value,a!=null&&go(l,!!u.multiple,a,!1)}}}var Tm=!1;function aS(l,a,u){if(Tm)return l(a,u);Tm=!0;try{var h=l(a);return h}finally{if(Tm=!1,(bo!==null||xo!==null)&&(ld(),bo&&(a=bo,l=xo,xo=bo=null,oS(a),l)))for(a=0;a<l.length;a++)oS(l[a])}}function Wa(l,a){var u=l.stateNode;if(u===null)return null;var h=u[Yn]||null;if(h===null)return null;u=h[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(l=l.type,h=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!h;break e;default:l=!1}if(l)return null;if(u&&typeof u!="function")throw Error(i(231,a,typeof u));return u}var _r=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Am=!1;if(_r)try{var Qa={};Object.defineProperty(Qa,"passive",{get:function(){Am=!0}}),window.addEventListener("test",Qa,Qa),window.removeEventListener("test",Qa,Qa)}catch{Am=!1}var fs=null,Mm=null,Sf=null;function cS(){if(Sf)return Sf;var l,a=Mm,u=a.length,h,g="value"in fs?fs.value:fs.textContent,x=g.length;for(l=0;l<u&&a[l]===g[l];l++);var w=u-l;for(h=1;h<=w&&a[u-h]===g[x-h];h++);return Sf=g.slice(l,1<h?1-h:void 0)}function wf(l){var a=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&a===13&&(l=13)):l=a,l===10&&(l=13),32<=l||l===13?l:0}function vf(){return!0}function uS(){return!1}function Kn(l){function a(u,h,g,x,w){this._reactName=u,this._targetInst=g,this.type=h,this.nativeEvent=x,this.target=w,this.currentTarget=null;for(var C in l)l.hasOwnProperty(C)&&(u=l[C],this[C]=u?u(x):x[C]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?vf:uS,this.isPropagationStopped=uS,this}return m(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=vf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=vf)},persist:function(){},isPersistent:vf}),a}var pl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kf=Kn(pl),ec=m({},pl,{view:0,detail:0}),_2=Kn(ec),Om,_m,tc,Cf=m({},ec,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nm,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==tc&&(tc&&l.type==="mousemove"?(Om=l.screenX-tc.screenX,_m=l.screenY-tc.screenY):_m=Om=0,tc=l),Om)},movementY:function(l){return"movementY"in l?l.movementY:_m}}),fS=Kn(Cf),D2=m({},Cf,{dataTransfer:0}),N2=Kn(D2),R2=m({},ec,{relatedTarget:0}),Dm=Kn(R2),z2=m({},pl,{animationName:0,elapsedTime:0,pseudoElement:0}),L2=Kn(z2),I2=m({},pl,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),B2=Kn(I2),j2=m({},pl,{data:0}),dS=Kn(j2),U2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},H2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},V2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function P2(l){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(l):(l=V2[l])?!!a[l]:!1}function Nm(){return P2}var $2=m({},ec,{key:function(l){if(l.key){var a=U2[l.key]||l.key;if(a!=="Unidentified")return a}return l.type==="keypress"?(l=wf(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?H2[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nm,charCode:function(l){return l.type==="keypress"?wf(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?wf(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),F2=Kn($2),q2=m({},Cf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hS=Kn(q2),Y2=m({},ec,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nm}),K2=Kn(Y2),G2=m({},pl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Z2=Kn(G2),J2=m({},Cf,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),X2=Kn(J2),W2=m({},pl,{newState:0,oldState:0}),Q2=Kn(W2),eN=[9,13,27,32],Rm=_r&&"CompositionEvent"in window,nc=null;_r&&"documentMode"in document&&(nc=document.documentMode);var tN=_r&&"TextEvent"in window&&!nc,pS=_r&&(!Rm||nc&&8<nc&&11>=nc),mS=" ",gS=!1;function yS(l,a){switch(l){case"keyup":return eN.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bS(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var So=!1;function nN(l,a){switch(l){case"compositionend":return bS(a);case"keypress":return a.which!==32?null:(gS=!0,mS);case"textInput":return l=a.data,l===mS&&gS?null:l;default:return null}}function iN(l,a){if(So)return l==="compositionend"||!Rm&&yS(l,a)?(l=cS(),Sf=Mm=fs=null,So=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return pS&&a.locale!=="ko"?null:a.data;default:return null}}var rN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xS(l){var a=l&&l.nodeName&&l.nodeName.toLowerCase();return a==="input"?!!rN[l.type]:a==="textarea"}function SS(l,a,u,h){bo?xo?xo.push(h):xo=[h]:bo=h,a=hd(a,"onChange"),0<a.length&&(u=new kf("onChange","change",null,u,h),l.push({event:u,listeners:a}))}var ic=null,rc=null;function sN(l){nk(l,0)}function Ef(l){var a=Xa(l);if(tS(a))return l}function wS(l,a){if(l==="change")return a}var vS=!1;if(_r){var zm;if(_r){var Lm="oninput"in document;if(!Lm){var kS=document.createElement("div");kS.setAttribute("oninput","return;"),Lm=typeof kS.oninput=="function"}zm=Lm}else zm=!1;vS=zm&&(!document.documentMode||9<document.documentMode)}function CS(){ic&&(ic.detachEvent("onpropertychange",ES),rc=ic=null)}function ES(l){if(l.propertyName==="value"&&Ef(rc)){var a=[];SS(a,rc,l,Em(l)),aS(sN,a)}}function lN(l,a,u){l==="focusin"?(CS(),ic=a,rc=u,ic.attachEvent("onpropertychange",ES)):l==="focusout"&&CS()}function oN(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Ef(rc)}function aN(l,a){if(l==="click")return Ef(a)}function cN(l,a){if(l==="input"||l==="change")return Ef(a)}function uN(l,a){return l===a&&(l!==0||1/l===1/a)||l!==l&&a!==a}var ai=typeof Object.is=="function"?Object.is:uN;function sc(l,a){if(ai(l,a))return!0;if(typeof l!="object"||l===null||typeof a!="object"||a===null)return!1;var u=Object.keys(l),h=Object.keys(a);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var g=u[h];if(!Yi.call(a,g)||!ai(l[g],a[g]))return!1}return!0}function TS(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function AS(l,a){var u=TS(l);l=0;for(var h;u;){if(u.nodeType===3){if(h=l+u.textContent.length,l<=a&&h>=a)return{node:u,offset:a-l};l=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=TS(u)}}function MS(l,a){return l&&a?l===a?!0:l&&l.nodeType===3?!1:a&&a.nodeType===3?MS(l,a.parentNode):"contains"in l?l.contains(a):l.compareDocumentPosition?!!(l.compareDocumentPosition(a)&16):!1:!1}function OS(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var a=bf(l.document);a instanceof l.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)l=a.contentWindow;else break;a=bf(l.document)}return a}function Im(l){var a=l&&l.nodeName&&l.nodeName.toLowerCase();return a&&(a==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||a==="textarea"||l.contentEditable==="true")}var fN=_r&&"documentMode"in document&&11>=document.documentMode,wo=null,Bm=null,lc=null,jm=!1;function _S(l,a,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;jm||wo==null||wo!==bf(h)||(h=wo,"selectionStart"in h&&Im(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),lc&&sc(lc,h)||(lc=h,h=hd(Bm,"onSelect"),0<h.length&&(a=new kf("onSelect","select",null,a,u),l.push({event:a,listeners:h}),a.target=wo)))}function ml(l,a){var u={};return u[l.toLowerCase()]=a.toLowerCase(),u["Webkit"+l]="webkit"+a,u["Moz"+l]="moz"+a,u}var vo={animationend:ml("Animation","AnimationEnd"),animationiteration:ml("Animation","AnimationIteration"),animationstart:ml("Animation","AnimationStart"),transitionrun:ml("Transition","TransitionRun"),transitionstart:ml("Transition","TransitionStart"),transitioncancel:ml("Transition","TransitionCancel"),transitionend:ml("Transition","TransitionEnd")},Um={},DS={};_r&&(DS=document.createElement("div").style,"AnimationEvent"in window||(delete vo.animationend.animation,delete vo.animationiteration.animation,delete vo.animationstart.animation),"TransitionEvent"in window||delete vo.transitionend.transition);function gl(l){if(Um[l])return Um[l];if(!vo[l])return l;var a=vo[l],u;for(u in a)if(a.hasOwnProperty(u)&&u in DS)return Um[l]=a[u];return l}var NS=gl("animationend"),RS=gl("animationiteration"),zS=gl("animationstart"),dN=gl("transitionrun"),hN=gl("transitionstart"),pN=gl("transitioncancel"),LS=gl("transitionend"),IS=new Map,Hm="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(" ");Hm.push("scrollEnd");function Gi(l,a){IS.set(l,a),hl(a,[l])}var Tf=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},Ci=[],ko=0,Vm=0;function Af(){for(var l=ko,a=Vm=ko=0;a<l;){var u=Ci[a];Ci[a++]=null;var h=Ci[a];Ci[a++]=null;var g=Ci[a];Ci[a++]=null;var x=Ci[a];if(Ci[a++]=null,h!==null&&g!==null){var w=h.pending;w===null?g.next=g:(g.next=w.next,w.next=g),h.pending=g}x!==0&&BS(u,g,x)}}function Mf(l,a,u,h){Ci[ko++]=l,Ci[ko++]=a,Ci[ko++]=u,Ci[ko++]=h,Vm|=h,l.lanes|=h,l=l.alternate,l!==null&&(l.lanes|=h)}function Pm(l,a,u,h){return Mf(l,a,u,h),Of(l)}function yl(l,a){return Mf(l,null,null,a),Of(l)}function BS(l,a,u){l.lanes|=u;var h=l.alternate;h!==null&&(h.lanes|=u);for(var g=!1,x=l.return;x!==null;)x.childLanes|=u,h=x.alternate,h!==null&&(h.childLanes|=u),x.tag===22&&(l=x.stateNode,l===null||l._visibility&1||(g=!0)),l=x,x=x.return;return l.tag===3?(x=l.stateNode,g&&a!==null&&(g=31-xt(u),l=x.hiddenUpdates,h=l[g],h===null?l[g]=[a]:h.push(a),a.lane=u|536870912),x):null}function Of(l){if(50<Mc)throw Mc=0,Xg=null,Error(i(185));for(var a=l.return;a!==null;)l=a,a=l.return;return l.tag===3?l.stateNode:null}var Co={};function mN(l,a,u,h){this.tag=l,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(l,a,u,h){return new mN(l,a,u,h)}function $m(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Dr(l,a){var u=l.alternate;return u===null?(u=ci(l.tag,a,l.key,l.mode),u.elementType=l.elementType,u.type=l.type,u.stateNode=l.stateNode,u.alternate=l,l.alternate=u):(u.pendingProps=a,u.type=l.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=l.flags&65011712,u.childLanes=l.childLanes,u.lanes=l.lanes,u.child=l.child,u.memoizedProps=l.memoizedProps,u.memoizedState=l.memoizedState,u.updateQueue=l.updateQueue,a=l.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=l.sibling,u.index=l.index,u.ref=l.ref,u.refCleanup=l.refCleanup,u}function jS(l,a){l.flags&=65011714;var u=l.alternate;return u===null?(l.childLanes=0,l.lanes=a,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=u.childLanes,l.lanes=u.lanes,l.child=u.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=u.memoizedProps,l.memoizedState=u.memoizedState,l.updateQueue=u.updateQueue,l.type=u.type,a=u.dependencies,l.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),l}function _f(l,a,u,h,g,x){var w=0;if(h=l,typeof l=="function")$m(l)&&(w=1);else if(typeof l=="string")w=SR(l,u,ne.current)?26:l==="html"||l==="head"||l==="body"?27:5;else e:switch(l){case se:return l=ci(31,u,a,g),l.elementType=se,l.lanes=x,l;case v:return bl(u.children,g,x,a);case k:w=8,g|=24;break;case E:return l=ci(12,u,a,g|2),l.elementType=E,l.lanes=x,l;case P:return l=ci(13,u,a,g),l.elementType=P,l.lanes=x,l;case O:return l=ci(19,u,a,g),l.elementType=O,l.lanes=x,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case L:w=10;break e;case j:w=9;break e;case re:w=11;break e;case z:w=14;break e;case F:w=16,h=null;break e}w=29,u=Error(i(130,l===null?"null":typeof l,"")),h=null}return a=ci(w,u,a,g),a.elementType=l,a.type=h,a.lanes=x,a}function bl(l,a,u,h){return l=ci(7,l,h,a),l.lanes=u,l}function Fm(l,a,u){return l=ci(6,l,null,a),l.lanes=u,l}function US(l){var a=ci(18,null,null,0);return a.stateNode=l,a}function qm(l,a,u){return a=ci(4,l.children!==null?l.children:[],l.key,a),a.lanes=u,a.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},a}var HS=new WeakMap;function Ei(l,a){if(typeof l=="object"&&l!==null){var u=HS.get(l);return u!==void 0?u:(a={value:l,source:a,stack:qi(a)},HS.set(l,a),a)}return{value:l,source:a,stack:qi(a)}}var Eo=[],To=0,Df=null,oc=0,Ti=[],Ai=0,ds=null,lr=1,or="";function Nr(l,a){Eo[To++]=oc,Eo[To++]=Df,Df=l,oc=a}function VS(l,a,u){Ti[Ai++]=lr,Ti[Ai++]=or,Ti[Ai++]=ds,ds=l;var h=lr;l=or;var g=32-xt(h)-1;h&=~(1<<g),u+=1;var x=32-xt(a)+g;if(30<x){var w=g-g%5;x=(h&(1<<w)-1).toString(32),h>>=w,g-=w,lr=1<<32-xt(a)+g|u<<g|h,or=x+l}else lr=1<<x|u<<g|h,or=l}function Ym(l){l.return!==null&&(Nr(l,1),VS(l,1,0))}function Km(l){for(;l===Df;)Df=Eo[--To],Eo[To]=null,oc=Eo[--To],Eo[To]=null;for(;l===ds;)ds=Ti[--Ai],Ti[Ai]=null,or=Ti[--Ai],Ti[Ai]=null,lr=Ti[--Ai],Ti[Ai]=null}function PS(l,a){Ti[Ai++]=lr,Ti[Ai++]=or,Ti[Ai++]=ds,lr=a.id,or=a.overflow,ds=l}var gn=null,At=null,tt=!1,hs=null,Mi=!1,Gm=Error(i(519));function ps(l){var a=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ac(Ei(a,l)),Gm}function $S(l){var a=l.stateNode,u=l.type,h=l.memoizedProps;switch(a[mn]=l,a[Yn]=h,u){case"dialog":Je("cancel",a),Je("close",a);break;case"iframe":case"object":case"embed":Je("load",a);break;case"video":case"audio":for(u=0;u<_c.length;u++)Je(_c[u],a);break;case"source":Je("error",a);break;case"img":case"image":case"link":Je("error",a),Je("load",a);break;case"details":Je("toggle",a);break;case"input":Je("invalid",a),nS(a,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Je("invalid",a);break;case"textarea":Je("invalid",a),rS(a,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||a.textContent===""+u||h.suppressHydrationWarning===!0||lk(a.textContent,u)?(h.popover!=null&&(Je("beforetoggle",a),Je("toggle",a)),h.onScroll!=null&&Je("scroll",a),h.onScrollEnd!=null&&Je("scrollend",a),h.onClick!=null&&(a.onclick=Or),a=!0):a=!1,a||ps(l,!0)}function FS(l){for(gn=l.return;gn;)switch(gn.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:gn=gn.return}}function Ao(l){if(l!==gn)return!1;if(!tt)return FS(l),tt=!0,!1;var a=l.tag,u;if((u=a!==3&&a!==27)&&((u=a===5)&&(u=l.type,u=!(u!=="form"&&u!=="button")||dy(l.type,l.memoizedProps)),u=!u),u&&At&&ps(l),FS(l),a===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));At=mk(l)}else if(a===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));At=mk(l)}else a===27?(a=At,Ms(l.type)?(l=yy,yy=null,At=l):At=a):At=gn?_i(l.stateNode.nextSibling):null;return!0}function xl(){At=gn=null,tt=!1}function Zm(){var l=hs;return l!==null&&(Xn===null?Xn=l:Xn.push.apply(Xn,l),hs=null),l}function ac(l){hs===null?hs=[l]:hs.push(l)}var Jm=_(null),Sl=null,Rr=null;function ms(l,a,u){T(Jm,a._currentValue),a._currentValue=u}function zr(l){l._currentValue=Jm.current,U(Jm)}function Xm(l,a,u){for(;l!==null;){var h=l.alternate;if((l.childLanes&a)!==a?(l.childLanes|=a,h!==null&&(h.childLanes|=a)):h!==null&&(h.childLanes&a)!==a&&(h.childLanes|=a),l===u)break;l=l.return}}function Wm(l,a,u,h){var g=l.child;for(g!==null&&(g.return=l);g!==null;){var x=g.dependencies;if(x!==null){var w=g.child;x=x.firstContext;e:for(;x!==null;){var C=x;x=g;for(var D=0;D<a.length;D++)if(C.context===a[D]){x.lanes|=u,C=x.alternate,C!==null&&(C.lanes|=u),Xm(x.return,u,l),h||(w=null);break e}x=C.next}}else if(g.tag===18){if(w=g.return,w===null)throw Error(i(341));w.lanes|=u,x=w.alternate,x!==null&&(x.lanes|=u),Xm(w,u,l),w=null}else w=g.child;if(w!==null)w.return=g;else for(w=g;w!==null;){if(w===l){w=null;break}if(g=w.sibling,g!==null){g.return=w.return,w=g;break}w=w.return}g=w}}function Mo(l,a,u,h){l=null;for(var g=a,x=!1;g!==null;){if(!x){if((g.flags&524288)!==0)x=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var w=g.alternate;if(w===null)throw Error(i(387));if(w=w.memoizedProps,w!==null){var C=g.type;ai(g.pendingProps.value,w.value)||(l!==null?l.push(C):l=[C])}}else if(g===Oe.current){if(w=g.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(l!==null?l.push(Lc):l=[Lc])}g=g.return}l!==null&&Wm(a,l,u,h),a.flags|=262144}function Nf(l){for(l=l.firstContext;l!==null;){if(!ai(l.context._currentValue,l.memoizedValue))return!0;l=l.next}return!1}function wl(l){Sl=l,Rr=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function yn(l){return qS(Sl,l)}function Rf(l,a){return Sl===null&&wl(l),qS(l,a)}function qS(l,a){var u=a._currentValue;if(a={context:a,memoizedValue:u,next:null},Rr===null){if(l===null)throw Error(i(308));Rr=a,l.dependencies={lanes:0,firstContext:a},l.flags|=524288}else Rr=Rr.next=a;return u}var gN=typeof AbortController<"u"?AbortController:function(){var l=[],a=this.signal={aborted:!1,addEventListener:function(u,h){l.push(h)}};this.abort=function(){a.aborted=!0,l.forEach(function(u){return u()})}},yN=t.unstable_scheduleCallback,bN=t.unstable_NormalPriority,Ft={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qm(){return{controller:new gN,data:new Map,refCount:0}}function cc(l){l.refCount--,l.refCount===0&&yN(bN,function(){l.controller.abort()})}var uc=null,eg=0,Oo=0,_o=null;function xN(l,a){if(uc===null){var u=uc=[];eg=0,Oo=iy(),_o={status:"pending",value:void 0,then:function(h){u.push(h)}}}return eg++,a.then(YS,YS),a}function YS(){if(--eg===0&&uc!==null){_o!==null&&(_o.status="fulfilled");var l=uc;uc=null,Oo=0,_o=null;for(var a=0;a<l.length;a++)(0,l[a])()}}function SN(l,a){var u=[],h={status:"pending",value:null,reason:null,then:function(g){u.push(g)}};return l.then(function(){h.status="fulfilled",h.value=a;for(var g=0;g<u.length;g++)(0,u[g])(a)},function(g){for(h.status="rejected",h.reason=g,g=0;g<u.length;g++)(0,u[g])(void 0)}),h}var KS=I.S;I.S=function(l,a){_v=qe(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&xN(l,a),KS!==null&&KS(l,a)};var vl=_(null);function tg(){var l=vl.current;return l!==null?l:St.pooledCache}function zf(l,a){a===null?T(vl,vl.current):T(vl,a.pool)}function GS(){var l=tg();return l===null?null:{parent:Ft._currentValue,pool:l}}var Do=Error(i(460)),ng=Error(i(474)),Lf=Error(i(542)),If={then:function(){}};function ZS(l){return l=l.status,l==="fulfilled"||l==="rejected"}function JS(l,a,u){switch(u=l[u],u===void 0?l.push(a):u!==a&&(a.then(Or,Or),a=u),a.status){case"fulfilled":return a.value;case"rejected":throw l=a.reason,WS(l),l;default:if(typeof a.status=="string")a.then(Or,Or);else{if(l=St,l!==null&&100<l.shellSuspendCounter)throw Error(i(482));l=a,l.status="pending",l.then(function(h){if(a.status==="pending"){var g=a;g.status="fulfilled",g.value=h}},function(h){if(a.status==="pending"){var g=a;g.status="rejected",g.reason=h}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw l=a.reason,WS(l),l}throw Cl=a,Do}}function kl(l){try{var a=l._init;return a(l._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Cl=u,Do):u}}var Cl=null;function XS(){if(Cl===null)throw Error(i(459));var l=Cl;return Cl=null,l}function WS(l){if(l===Do||l===Lf)throw Error(i(483))}var No=null,fc=0;function Bf(l){var a=fc;return fc+=1,No===null&&(No=[]),JS(No,l,a)}function dc(l,a){a=a.props.ref,l.ref=a!==void 0?a:null}function jf(l,a){throw a.$$typeof===y?Error(i(525)):(l=Object.prototype.toString.call(a),Error(i(31,l==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":l)))}function QS(l){function a(B,R){if(l){var H=B.deletions;H===null?(B.deletions=[R],B.flags|=16):H.push(R)}}function u(B,R){if(!l)return null;for(;R!==null;)a(B,R),R=R.sibling;return null}function h(B){for(var R=new Map;B!==null;)B.key!==null?R.set(B.key,B):R.set(B.index,B),B=B.sibling;return R}function g(B,R){return B=Dr(B,R),B.index=0,B.sibling=null,B}function x(B,R,H){return B.index=H,l?(H=B.alternate,H!==null?(H=H.index,H<R?(B.flags|=67108866,R):H):(B.flags|=67108866,R)):(B.flags|=1048576,R)}function w(B){return l&&B.alternate===null&&(B.flags|=67108866),B}function C(B,R,H,J){return R===null||R.tag!==6?(R=Fm(H,B.mode,J),R.return=B,R):(R=g(R,H),R.return=B,R)}function D(B,R,H,J){var Te=H.type;return Te===v?G(B,R,H.props.children,J,H.key):R!==null&&(R.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===F&&kl(Te)===R.type)?(R=g(R,H.props),dc(R,H),R.return=B,R):(R=_f(H.type,H.key,H.props,null,B.mode,J),dc(R,H),R.return=B,R)}function V(B,R,H,J){return R===null||R.tag!==4||R.stateNode.containerInfo!==H.containerInfo||R.stateNode.implementation!==H.implementation?(R=qm(H,B.mode,J),R.return=B,R):(R=g(R,H.children||[]),R.return=B,R)}function G(B,R,H,J,Te){return R===null||R.tag!==7?(R=bl(H,B.mode,J,Te),R.return=B,R):(R=g(R,H),R.return=B,R)}function X(B,R,H){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Fm(""+R,B.mode,H),R.return=B,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case b:return H=_f(R.type,R.key,R.props,null,B.mode,H),dc(H,R),H.return=B,H;case S:return R=qm(R,B.mode,H),R.return=B,R;case F:return R=kl(R),X(B,R,H)}if(Z(R)||ce(R))return R=bl(R,B.mode,H,null),R.return=B,R;if(typeof R.then=="function")return X(B,Bf(R),H);if(R.$$typeof===L)return X(B,Rf(B,R),H);jf(B,R)}return null}function $(B,R,H,J){var Te=R!==null?R.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Te!==null?null:C(B,R,""+H,J);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return H.key===Te?D(B,R,H,J):null;case S:return H.key===Te?V(B,R,H,J):null;case F:return H=kl(H),$(B,R,H,J)}if(Z(H)||ce(H))return Te!==null?null:G(B,R,H,J,null);if(typeof H.then=="function")return $(B,R,Bf(H),J);if(H.$$typeof===L)return $(B,R,Rf(B,H),J);jf(B,H)}return null}function q(B,R,H,J,Te){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return B=B.get(H)||null,C(R,B,""+J,Te);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return B=B.get(J.key===null?H:J.key)||null,D(R,B,J,Te);case S:return B=B.get(J.key===null?H:J.key)||null,V(R,B,J,Te);case F:return J=kl(J),q(B,R,H,J,Te)}if(Z(J)||ce(J))return B=B.get(H)||null,G(R,B,J,Te,null);if(typeof J.then=="function")return q(B,R,H,Bf(J),Te);if(J.$$typeof===L)return q(B,R,H,Rf(R,J),Te);jf(R,J)}return null}function be(B,R,H,J){for(var Te=null,rt=null,ve=R,He=R=0,Qe=null;ve!==null&&He<H.length;He++){ve.index>He?(Qe=ve,ve=null):Qe=ve.sibling;var st=$(B,ve,H[He],J);if(st===null){ve===null&&(ve=Qe);break}l&&ve&&st.alternate===null&&a(B,ve),R=x(st,R,He),rt===null?Te=st:rt.sibling=st,rt=st,ve=Qe}if(He===H.length)return u(B,ve),tt&&Nr(B,He),Te;if(ve===null){for(;He<H.length;He++)ve=X(B,H[He],J),ve!==null&&(R=x(ve,R,He),rt===null?Te=ve:rt.sibling=ve,rt=ve);return tt&&Nr(B,He),Te}for(ve=h(ve);He<H.length;He++)Qe=q(ve,B,He,H[He],J),Qe!==null&&(l&&Qe.alternate!==null&&ve.delete(Qe.key===null?He:Qe.key),R=x(Qe,R,He),rt===null?Te=Qe:rt.sibling=Qe,rt=Qe);return l&&ve.forEach(function(Rs){return a(B,Rs)}),tt&&Nr(B,He),Te}function Me(B,R,H,J){if(H==null)throw Error(i(151));for(var Te=null,rt=null,ve=R,He=R=0,Qe=null,st=H.next();ve!==null&&!st.done;He++,st=H.next()){ve.index>He?(Qe=ve,ve=null):Qe=ve.sibling;var Rs=$(B,ve,st.value,J);if(Rs===null){ve===null&&(ve=Qe);break}l&&ve&&Rs.alternate===null&&a(B,ve),R=x(Rs,R,He),rt===null?Te=Rs:rt.sibling=Rs,rt=Rs,ve=Qe}if(st.done)return u(B,ve),tt&&Nr(B,He),Te;if(ve===null){for(;!st.done;He++,st=H.next())st=X(B,st.value,J),st!==null&&(R=x(st,R,He),rt===null?Te=st:rt.sibling=st,rt=st);return tt&&Nr(B,He),Te}for(ve=h(ve);!st.done;He++,st=H.next())st=q(ve,B,He,st.value,J),st!==null&&(l&&st.alternate!==null&&ve.delete(st.key===null?He:st.key),R=x(st,R,He),rt===null?Te=st:rt.sibling=st,rt=st);return l&&ve.forEach(function(DR){return a(B,DR)}),tt&&Nr(B,He),Te}function yt(B,R,H,J){if(typeof H=="object"&&H!==null&&H.type===v&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case b:e:{for(var Te=H.key;R!==null;){if(R.key===Te){if(Te=H.type,Te===v){if(R.tag===7){u(B,R.sibling),J=g(R,H.props.children),J.return=B,B=J;break e}}else if(R.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===F&&kl(Te)===R.type){u(B,R.sibling),J=g(R,H.props),dc(J,H),J.return=B,B=J;break e}u(B,R);break}else a(B,R);R=R.sibling}H.type===v?(J=bl(H.props.children,B.mode,J,H.key),J.return=B,B=J):(J=_f(H.type,H.key,H.props,null,B.mode,J),dc(J,H),J.return=B,B=J)}return w(B);case S:e:{for(Te=H.key;R!==null;){if(R.key===Te)if(R.tag===4&&R.stateNode.containerInfo===H.containerInfo&&R.stateNode.implementation===H.implementation){u(B,R.sibling),J=g(R,H.children||[]),J.return=B,B=J;break e}else{u(B,R);break}else a(B,R);R=R.sibling}J=qm(H,B.mode,J),J.return=B,B=J}return w(B);case F:return H=kl(H),yt(B,R,H,J)}if(Z(H))return be(B,R,H,J);if(ce(H)){if(Te=ce(H),typeof Te!="function")throw Error(i(150));return H=Te.call(H),Me(B,R,H,J)}if(typeof H.then=="function")return yt(B,R,Bf(H),J);if(H.$$typeof===L)return yt(B,R,Rf(B,H),J);jf(B,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,R!==null&&R.tag===6?(u(B,R.sibling),J=g(R,H),J.return=B,B=J):(u(B,R),J=Fm(H,B.mode,J),J.return=B,B=J),w(B)):u(B,R)}return function(B,R,H,J){try{fc=0;var Te=yt(B,R,H,J);return No=null,Te}catch(ve){if(ve===Do||ve===Lf)throw ve;var rt=ci(29,ve,null,B.mode);return rt.lanes=J,rt.return=B,rt}finally{}}}var El=QS(!0),ew=QS(!1),gs=!1;function ig(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rg(l,a){l=l.updateQueue,a.updateQueue===l&&(a.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function ys(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function bs(l,a,u){var h=l.updateQueue;if(h===null)return null;if(h=h.shared,(ot&2)!==0){var g=h.pending;return g===null?a.next=a:(a.next=g.next,g.next=a),h.pending=a,a=Of(l),BS(l,null,u),a}return Mf(l,h,a,u),Of(l)}function hc(l,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194048)!==0)){var h=a.lanes;h&=l.pendingLanes,u|=h,a.lanes=u,qx(l,u)}}function sg(l,a){var u=l.updateQueue,h=l.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var g=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var w={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?g=x=w:x=x.next=w,u=u.next}while(u!==null);x===null?g=x=a:x=x.next=a}else g=x=a;u={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:x,shared:h.shared,callbacks:h.callbacks},l.updateQueue=u;return}l=u.lastBaseUpdate,l===null?u.firstBaseUpdate=a:l.next=a,u.lastBaseUpdate=a}var lg=!1;function pc(){if(lg){var l=_o;if(l!==null)throw l}}function mc(l,a,u,h){lg=!1;var g=l.updateQueue;gs=!1;var x=g.firstBaseUpdate,w=g.lastBaseUpdate,C=g.shared.pending;if(C!==null){g.shared.pending=null;var D=C,V=D.next;D.next=null,w===null?x=V:w.next=V,w=D;var G=l.alternate;G!==null&&(G=G.updateQueue,C=G.lastBaseUpdate,C!==w&&(C===null?G.firstBaseUpdate=V:C.next=V,G.lastBaseUpdate=D))}if(x!==null){var X=g.baseState;w=0,G=V=D=null,C=x;do{var $=C.lane&-536870913,q=$!==C.lane;if(q?(We&$)===$:(h&$)===$){$!==0&&$===Oo&&(lg=!0),G!==null&&(G=G.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var be=l,Me=C;$=a;var yt=u;switch(Me.tag){case 1:if(be=Me.payload,typeof be=="function"){X=be.call(yt,X,$);break e}X=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Me.payload,$=typeof be=="function"?be.call(yt,X,$):be,$==null)break e;X=m({},X,$);break e;case 2:gs=!0}}$=C.callback,$!==null&&(l.flags|=64,q&&(l.flags|=8192),q=g.callbacks,q===null?g.callbacks=[$]:q.push($))}else q={lane:$,tag:C.tag,payload:C.payload,callback:C.callback,next:null},G===null?(V=G=q,D=X):G=G.next=q,w|=$;if(C=C.next,C===null){if(C=g.shared.pending,C===null)break;q=C,C=q.next,q.next=null,g.lastBaseUpdate=q,g.shared.pending=null}}while(!0);G===null&&(D=X),g.baseState=D,g.firstBaseUpdate=V,g.lastBaseUpdate=G,x===null&&(g.shared.lanes=0),ks|=w,l.lanes=w,l.memoizedState=X}}function tw(l,a){if(typeof l!="function")throw Error(i(191,l));l.call(a)}function nw(l,a){var u=l.callbacks;if(u!==null)for(l.callbacks=null,l=0;l<u.length;l++)tw(u[l],a)}var Ro=_(null),Uf=_(0);function iw(l,a){l=$r,T(Uf,l),T(Ro,a),$r=l|a.baseLanes}function og(){T(Uf,$r),T(Ro,Ro.current)}function ag(){$r=Uf.current,U(Ro),U(Uf)}var ui=_(null),Oi=null;function xs(l){var a=l.alternate;T(Vt,Vt.current&1),T(ui,l),Oi===null&&(a===null||Ro.current!==null||a.memoizedState!==null)&&(Oi=l)}function cg(l){T(Vt,Vt.current),T(ui,l),Oi===null&&(Oi=l)}function rw(l){l.tag===22?(T(Vt,Vt.current),T(ui,l),Oi===null&&(Oi=l)):Ss()}function Ss(){T(Vt,Vt.current),T(ui,ui.current)}function fi(l){U(ui),Oi===l&&(Oi=null),U(Vt)}var Vt=_(0);function Hf(l){for(var a=l;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||my(u)||gy(u)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break;for(;a.sibling===null;){if(a.return===null||a.return===l)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Lr=0,Be=null,mt=null,qt=null,Vf=!1,zo=!1,Tl=!1,Pf=0,gc=0,Lo=null,wN=0;function zt(){throw Error(i(321))}function ug(l,a){if(a===null)return!1;for(var u=0;u<a.length&&u<l.length;u++)if(!ai(l[u],a[u]))return!1;return!0}function fg(l,a,u,h,g,x){return Lr=x,Be=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,I.H=l===null||l.memoizedState===null?Vw:Tg,Tl=!1,x=u(h,g),Tl=!1,zo&&(x=lw(a,u,h,g)),sw(l),x}function sw(l){I.H=xc;var a=mt!==null&&mt.next!==null;if(Lr=0,qt=mt=Be=null,Vf=!1,gc=0,Lo=null,a)throw Error(i(300));l===null||Yt||(l=l.dependencies,l!==null&&Nf(l)&&(Yt=!0))}function lw(l,a,u,h){Be=l;var g=0;do{if(zo&&(Lo=null),gc=0,zo=!1,25<=g)throw Error(i(301));if(g+=1,qt=mt=null,l.updateQueue!=null){var x=l.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}I.H=Pw,x=a(u,h)}while(zo);return x}function vN(){var l=I.H,a=l.useState()[0];return a=typeof a.then=="function"?yc(a):a,l=l.useState()[0],(mt!==null?mt.memoizedState:null)!==l&&(Be.flags|=1024),a}function dg(){var l=Pf!==0;return Pf=0,l}function hg(l,a,u){a.updateQueue=l.updateQueue,a.flags&=-2053,l.lanes&=~u}function pg(l){if(Vf){for(l=l.memoizedState;l!==null;){var a=l.queue;a!==null&&(a.pending=null),l=l.next}Vf=!1}Lr=0,qt=mt=Be=null,zo=!1,gc=Pf=0,Lo=null}function In(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?Be.memoizedState=qt=l:qt=qt.next=l,qt}function Pt(){if(mt===null){var l=Be.alternate;l=l!==null?l.memoizedState:null}else l=mt.next;var a=qt===null?Be.memoizedState:qt.next;if(a!==null)qt=a,mt=l;else{if(l===null)throw Be.alternate===null?Error(i(467)):Error(i(310));mt=l,l={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},qt===null?Be.memoizedState=qt=l:qt=qt.next=l}return qt}function $f(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yc(l){var a=gc;return gc+=1,Lo===null&&(Lo=[]),l=JS(Lo,l,a),a=Be,(qt===null?a.memoizedState:qt.next)===null&&(a=a.alternate,I.H=a===null||a.memoizedState===null?Vw:Tg),l}function Ff(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return yc(l);if(l.$$typeof===L)return yn(l)}throw Error(i(438,String(l)))}function mg(l){var a=null,u=Be.updateQueue;if(u!==null&&(a=u.memoCache),a==null){var h=Be.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(a={data:h.data.map(function(g){return g.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),u===null&&(u=$f(),Be.updateQueue=u),u.memoCache=a,u=a.data[a.index],u===void 0)for(u=a.data[a.index]=Array(l),h=0;h<l;h++)u[h]=te;return a.index++,u}function Ir(l,a){return typeof a=="function"?a(l):a}function qf(l){var a=Pt();return gg(a,mt,l)}function gg(l,a,u){var h=l.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=u;var g=l.baseQueue,x=h.pending;if(x!==null){if(g!==null){var w=g.next;g.next=x.next,x.next=w}a.baseQueue=g=x,h.pending=null}if(x=l.baseState,g===null)l.memoizedState=x;else{a=g.next;var C=w=null,D=null,V=a,G=!1;do{var X=V.lane&-536870913;if(X!==V.lane?(We&X)===X:(Lr&X)===X){var $=V.revertLane;if($===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),X===Oo&&(G=!0);else if((Lr&$)===$){V=V.next,$===Oo&&(G=!0);continue}else X={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(C=D=X,w=x):D=D.next=X,Be.lanes|=$,ks|=$;X=V.action,Tl&&u(x,X),x=V.hasEagerState?V.eagerState:u(x,X)}else $={lane:X,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(C=D=$,w=x):D=D.next=$,Be.lanes|=X,ks|=X;V=V.next}while(V!==null&&V!==a);if(D===null?w=x:D.next=C,!ai(x,l.memoizedState)&&(Yt=!0,G&&(u=_o,u!==null)))throw u;l.memoizedState=x,l.baseState=w,l.baseQueue=D,h.lastRenderedState=x}return g===null&&(h.lanes=0),[l.memoizedState,h.dispatch]}function yg(l){var a=Pt(),u=a.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=l;var h=u.dispatch,g=u.pending,x=a.memoizedState;if(g!==null){u.pending=null;var w=g=g.next;do x=l(x,w.action),w=w.next;while(w!==g);ai(x,a.memoizedState)||(Yt=!0),a.memoizedState=x,a.baseQueue===null&&(a.baseState=x),u.lastRenderedState=x}return[x,h]}function ow(l,a,u){var h=Be,g=Pt(),x=tt;if(x){if(u===void 0)throw Error(i(407));u=u()}else u=a();var w=!ai((mt||g).memoizedState,u);if(w&&(g.memoizedState=u,Yt=!0),g=g.queue,Sg(uw.bind(null,h,g,l),[l]),g.getSnapshot!==a||w||qt!==null&&qt.memoizedState.tag&1){if(h.flags|=2048,Io(9,{destroy:void 0},cw.bind(null,h,g,u,a),null),St===null)throw Error(i(349));x||(Lr&127)!==0||aw(h,a,u)}return u}function aw(l,a,u){l.flags|=16384,l={getSnapshot:a,value:u},a=Be.updateQueue,a===null?(a=$f(),Be.updateQueue=a,a.stores=[l]):(u=a.stores,u===null?a.stores=[l]:u.push(l))}function cw(l,a,u,h){a.value=u,a.getSnapshot=h,fw(a)&&dw(l)}function uw(l,a,u){return u(function(){fw(a)&&dw(l)})}function fw(l){var a=l.getSnapshot;l=l.value;try{var u=a();return!ai(l,u)}catch{return!0}}function dw(l){var a=yl(l,2);a!==null&&Wn(a,l,2)}function bg(l){var a=In();if(typeof l=="function"){var u=l;if(l=u(),Tl){qn(!0);try{u()}finally{qn(!1)}}}return a.memoizedState=a.baseState=l,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:l},a}function hw(l,a,u,h){return l.baseState=u,gg(l,mt,typeof h=="function"?h:Ir)}function kN(l,a,u,h,g){if(Gf(l))throw Error(i(485));if(l=a.action,l!==null){var x={payload:g,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){x.listeners.push(w)}};I.T!==null?u(!0):x.isTransition=!1,h(x),u=a.pending,u===null?(x.next=a.pending=x,pw(a,x)):(x.next=u.next,a.pending=u.next=x)}}function pw(l,a){var u=a.action,h=a.payload,g=l.state;if(a.isTransition){var x=I.T,w={};I.T=w;try{var C=u(g,h),D=I.S;D!==null&&D(w,C),mw(l,a,C)}catch(V){xg(l,a,V)}finally{x!==null&&w.types!==null&&(x.types=w.types),I.T=x}}else try{x=u(g,h),mw(l,a,x)}catch(V){xg(l,a,V)}}function mw(l,a,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){gw(l,a,h)},function(h){return xg(l,a,h)}):gw(l,a,u)}function gw(l,a,u){a.status="fulfilled",a.value=u,yw(a),l.state=u,a=l.pending,a!==null&&(u=a.next,u===a?l.pending=null:(u=u.next,a.next=u,pw(l,u)))}function xg(l,a,u){var h=l.pending;if(l.pending=null,h!==null){h=h.next;do a.status="rejected",a.reason=u,yw(a),a=a.next;while(a!==h)}l.action=null}function yw(l){l=l.listeners;for(var a=0;a<l.length;a++)(0,l[a])()}function bw(l,a){return a}function xw(l,a){if(tt){var u=St.formState;if(u!==null){e:{var h=Be;if(tt){if(At){t:{for(var g=At,x=Mi;g.nodeType!==8;){if(!x){g=null;break t}if(g=_i(g.nextSibling),g===null){g=null;break t}}x=g.data,g=x==="F!"||x==="F"?g:null}if(g){At=_i(g.nextSibling),h=g.data==="F!";break e}}ps(h)}h=!1}h&&(a=u[0])}}return u=In(),u.memoizedState=u.baseState=a,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bw,lastRenderedState:a},u.queue=h,u=jw.bind(null,Be,h),h.dispatch=u,h=bg(!1),x=Eg.bind(null,Be,!1,h.queue),h=In(),g={state:a,dispatch:null,action:l,pending:null},h.queue=g,u=kN.bind(null,Be,g,x,u),g.dispatch=u,h.memoizedState=l,[a,u,!1]}function Sw(l){var a=Pt();return ww(a,mt,l)}function ww(l,a,u){if(a=gg(l,a,bw)[0],l=qf(Ir)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var h=yc(a)}catch(w){throw w===Do?Lf:w}else h=a;a=Pt();var g=a.queue,x=g.dispatch;return u!==a.memoizedState&&(Be.flags|=2048,Io(9,{destroy:void 0},CN.bind(null,g,u),null)),[h,x,l]}function CN(l,a){l.action=a}function vw(l){var a=Pt(),u=mt;if(u!==null)return ww(a,u,l);Pt(),a=a.memoizedState,u=Pt();var h=u.queue.dispatch;return u.memoizedState=l,[a,h,!1]}function Io(l,a,u,h){return l={tag:l,create:u,deps:h,inst:a,next:null},a=Be.updateQueue,a===null&&(a=$f(),Be.updateQueue=a),u=a.lastEffect,u===null?a.lastEffect=l.next=l:(h=u.next,u.next=l,l.next=h,a.lastEffect=l),l}function kw(){return Pt().memoizedState}function Yf(l,a,u,h){var g=In();Be.flags|=l,g.memoizedState=Io(1|a,{destroy:void 0},u,h===void 0?null:h)}function Kf(l,a,u,h){var g=Pt();h=h===void 0?null:h;var x=g.memoizedState.inst;mt!==null&&h!==null&&ug(h,mt.memoizedState.deps)?g.memoizedState=Io(a,x,u,h):(Be.flags|=l,g.memoizedState=Io(1|a,x,u,h))}function Cw(l,a){Yf(8390656,8,l,a)}function Sg(l,a){Kf(2048,8,l,a)}function EN(l){Be.flags|=4;var a=Be.updateQueue;if(a===null)a=$f(),Be.updateQueue=a,a.events=[l];else{var u=a.events;u===null?a.events=[l]:u.push(l)}}function Ew(l){var a=Pt().memoizedState;return EN({ref:a,nextImpl:l}),function(){if((ot&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}function Tw(l,a){return Kf(4,2,l,a)}function Aw(l,a){return Kf(4,4,l,a)}function Mw(l,a){if(typeof a=="function"){l=l();var u=a(l);return function(){typeof u=="function"?u():a(null)}}if(a!=null)return l=l(),a.current=l,function(){a.current=null}}function Ow(l,a,u){u=u!=null?u.concat([l]):null,Kf(4,4,Mw.bind(null,a,l),u)}function wg(){}function _w(l,a){var u=Pt();a=a===void 0?null:a;var h=u.memoizedState;return a!==null&&ug(a,h[1])?h[0]:(u.memoizedState=[l,a],l)}function Dw(l,a){var u=Pt();a=a===void 0?null:a;var h=u.memoizedState;if(a!==null&&ug(a,h[1]))return h[0];if(h=l(),Tl){qn(!0);try{l()}finally{qn(!1)}}return u.memoizedState=[h,a],h}function vg(l,a,u){return u===void 0||(Lr&1073741824)!==0&&(We&261930)===0?l.memoizedState=a:(l.memoizedState=u,l=Nv(),Be.lanes|=l,ks|=l,u)}function Nw(l,a,u,h){return ai(u,a)?u:Ro.current!==null?(l=vg(l,u,h),ai(l,a)||(Yt=!0),l):(Lr&42)===0||(Lr&1073741824)!==0&&(We&261930)===0?(Yt=!0,l.memoizedState=u):(l=Nv(),Be.lanes|=l,ks|=l,a)}function Rw(l,a,u,h,g){var x=K.p;K.p=x!==0&&8>x?x:8;var w=I.T,C={};I.T=C,Eg(l,!1,a,u);try{var D=g(),V=I.S;if(V!==null&&V(C,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var G=SN(D,h);bc(l,a,G,pi(l))}else bc(l,a,h,pi(l))}catch(X){bc(l,a,{then:function(){},status:"rejected",reason:X},pi())}finally{K.p=x,w!==null&&C.types!==null&&(w.types=C.types),I.T=w}}function TN(){}function kg(l,a,u,h){if(l.tag!==5)throw Error(i(476));var g=zw(l).queue;Rw(l,g,a,pe,u===null?TN:function(){return Lw(l),u(h)})}function zw(l){var a=l.memoizedState;if(a!==null)return a;a={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:pe},next:null};var u={};return a.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:u},next:null},l.memoizedState=a,l=l.alternate,l!==null&&(l.memoizedState=a),a}function Lw(l){var a=zw(l);a.next===null&&(a=l.alternate.memoizedState),bc(l,a.next.queue,{},pi())}function Cg(){return yn(Lc)}function Iw(){return Pt().memoizedState}function Bw(){return Pt().memoizedState}function AN(l){for(var a=l.return;a!==null;){switch(a.tag){case 24:case 3:var u=pi();l=ys(u);var h=bs(a,l,u);h!==null&&(Wn(h,a,u),hc(h,a,u)),a={cache:Qm()},l.payload=a;return}a=a.return}}function MN(l,a,u){var h=pi();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Gf(l)?Uw(a,u):(u=Pm(l,a,u,h),u!==null&&(Wn(u,l,h),Hw(u,a,h)))}function jw(l,a,u){var h=pi();bc(l,a,u,h)}function bc(l,a,u,h){var g={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Gf(l))Uw(a,g);else{var x=l.alternate;if(l.lanes===0&&(x===null||x.lanes===0)&&(x=a.lastRenderedReducer,x!==null))try{var w=a.lastRenderedState,C=x(w,u);if(g.hasEagerState=!0,g.eagerState=C,ai(C,w))return Mf(l,a,g,0),St===null&&Af(),!1}catch{}finally{}if(u=Pm(l,a,g,h),u!==null)return Wn(u,l,h),Hw(u,a,h),!0}return!1}function Eg(l,a,u,h){if(h={lane:2,revertLane:iy(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Gf(l)){if(a)throw Error(i(479))}else a=Pm(l,u,h,2),a!==null&&Wn(a,l,2)}function Gf(l){var a=l.alternate;return l===Be||a!==null&&a===Be}function Uw(l,a){zo=Vf=!0;var u=l.pending;u===null?a.next=a:(a.next=u.next,u.next=a),l.pending=a}function Hw(l,a,u){if((u&4194048)!==0){var h=a.lanes;h&=l.pendingLanes,u|=h,a.lanes=u,qx(l,u)}}var xc={readContext:yn,use:Ff,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt};xc.useEffectEvent=zt;var Vw={readContext:yn,use:Ff,useCallback:function(l,a){return In().memoizedState=[l,a===void 0?null:a],l},useContext:yn,useEffect:Cw,useImperativeHandle:function(l,a,u){u=u!=null?u.concat([l]):null,Yf(4194308,4,Mw.bind(null,a,l),u)},useLayoutEffect:function(l,a){return Yf(4194308,4,l,a)},useInsertionEffect:function(l,a){Yf(4,2,l,a)},useMemo:function(l,a){var u=In();a=a===void 0?null:a;var h=l();if(Tl){qn(!0);try{l()}finally{qn(!1)}}return u.memoizedState=[h,a],h},useReducer:function(l,a,u){var h=In();if(u!==void 0){var g=u(a);if(Tl){qn(!0);try{u(a)}finally{qn(!1)}}}else g=a;return h.memoizedState=h.baseState=g,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:g},h.queue=l,l=l.dispatch=MN.bind(null,Be,l),[h.memoizedState,l]},useRef:function(l){var a=In();return l={current:l},a.memoizedState=l},useState:function(l){l=bg(l);var a=l.queue,u=jw.bind(null,Be,a);return a.dispatch=u,[l.memoizedState,u]},useDebugValue:wg,useDeferredValue:function(l,a){var u=In();return vg(u,l,a)},useTransition:function(){var l=bg(!1);return l=Rw.bind(null,Be,l.queue,!0,!1),In().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,a,u){var h=Be,g=In();if(tt){if(u===void 0)throw Error(i(407));u=u()}else{if(u=a(),St===null)throw Error(i(349));(We&127)!==0||aw(h,a,u)}g.memoizedState=u;var x={value:u,getSnapshot:a};return g.queue=x,Cw(uw.bind(null,h,x,l),[l]),h.flags|=2048,Io(9,{destroy:void 0},cw.bind(null,h,x,u,a),null),u},useId:function(){var l=In(),a=St.identifierPrefix;if(tt){var u=or,h=lr;u=(h&~(1<<32-xt(h)-1)).toString(32)+u,a="_"+a+"R_"+u,u=Pf++,0<u&&(a+="H"+u.toString(32)),a+="_"}else u=wN++,a="_"+a+"r_"+u.toString(32)+"_";return l.memoizedState=a},useHostTransitionStatus:Cg,useFormState:xw,useActionState:xw,useOptimistic:function(l){var a=In();a.memoizedState=a.baseState=l;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=u,a=Eg.bind(null,Be,!0,u),u.dispatch=a,[l,a]},useMemoCache:mg,useCacheRefresh:function(){return In().memoizedState=AN.bind(null,Be)},useEffectEvent:function(l){var a=In(),u={impl:l};return a.memoizedState=u,function(){if((ot&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},Tg={readContext:yn,use:Ff,useCallback:_w,useContext:yn,useEffect:Sg,useImperativeHandle:Ow,useInsertionEffect:Tw,useLayoutEffect:Aw,useMemo:Dw,useReducer:qf,useRef:kw,useState:function(){return qf(Ir)},useDebugValue:wg,useDeferredValue:function(l,a){var u=Pt();return Nw(u,mt.memoizedState,l,a)},useTransition:function(){var l=qf(Ir)[0],a=Pt().memoizedState;return[typeof l=="boolean"?l:yc(l),a]},useSyncExternalStore:ow,useId:Iw,useHostTransitionStatus:Cg,useFormState:Sw,useActionState:Sw,useOptimistic:function(l,a){var u=Pt();return hw(u,mt,l,a)},useMemoCache:mg,useCacheRefresh:Bw};Tg.useEffectEvent=Ew;var Pw={readContext:yn,use:Ff,useCallback:_w,useContext:yn,useEffect:Sg,useImperativeHandle:Ow,useInsertionEffect:Tw,useLayoutEffect:Aw,useMemo:Dw,useReducer:yg,useRef:kw,useState:function(){return yg(Ir)},useDebugValue:wg,useDeferredValue:function(l,a){var u=Pt();return mt===null?vg(u,l,a):Nw(u,mt.memoizedState,l,a)},useTransition:function(){var l=yg(Ir)[0],a=Pt().memoizedState;return[typeof l=="boolean"?l:yc(l),a]},useSyncExternalStore:ow,useId:Iw,useHostTransitionStatus:Cg,useFormState:vw,useActionState:vw,useOptimistic:function(l,a){var u=Pt();return mt!==null?hw(u,mt,l,a):(u.baseState=l,[l,u.queue.dispatch])},useMemoCache:mg,useCacheRefresh:Bw};Pw.useEffectEvent=Ew;function Ag(l,a,u,h){a=l.memoizedState,u=u(h,a),u=u==null?a:m({},a,u),l.memoizedState=u,l.lanes===0&&(l.updateQueue.baseState=u)}var Mg={enqueueSetState:function(l,a,u){l=l._reactInternals;var h=pi(),g=ys(h);g.payload=a,u!=null&&(g.callback=u),a=bs(l,g,h),a!==null&&(Wn(a,l,h),hc(a,l,h))},enqueueReplaceState:function(l,a,u){l=l._reactInternals;var h=pi(),g=ys(h);g.tag=1,g.payload=a,u!=null&&(g.callback=u),a=bs(l,g,h),a!==null&&(Wn(a,l,h),hc(a,l,h))},enqueueForceUpdate:function(l,a){l=l._reactInternals;var u=pi(),h=ys(u);h.tag=2,a!=null&&(h.callback=a),a=bs(l,h,u),a!==null&&(Wn(a,l,u),hc(a,l,u))}};function $w(l,a,u,h,g,x,w){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(h,x,w):a.prototype&&a.prototype.isPureReactComponent?!sc(u,h)||!sc(g,x):!0}function Fw(l,a,u,h){l=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,h),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,h),a.state!==l&&Mg.enqueueReplaceState(a,a.state,null)}function Al(l,a){var u=a;if("ref"in a){u={};for(var h in a)h!=="ref"&&(u[h]=a[h])}if(l=l.defaultProps){u===a&&(u=m({},u));for(var g in l)u[g]===void 0&&(u[g]=l[g])}return u}function qw(l){Tf(l)}function Yw(l){console.error(l)}function Kw(l){Tf(l)}function Zf(l,a){try{var u=l.onUncaughtError;u(a.value,{componentStack:a.stack})}catch(h){setTimeout(function(){throw h})}}function Gw(l,a,u){try{var h=l.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Og(l,a,u){return u=ys(u),u.tag=3,u.payload={element:null},u.callback=function(){Zf(l,a)},u}function Zw(l){return l=ys(l),l.tag=3,l}function Jw(l,a,u,h){var g=u.type.getDerivedStateFromError;if(typeof g=="function"){var x=h.value;l.payload=function(){return g(x)},l.callback=function(){Gw(a,u,h)}}var w=u.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(l.callback=function(){Gw(a,u,h),typeof g!="function"&&(Cs===null?Cs=new Set([this]):Cs.add(this));var C=h.stack;this.componentDidCatch(h.value,{componentStack:C!==null?C:""})})}function ON(l,a,u,h,g){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(a=u.alternate,a!==null&&Mo(a,u,g,!0),u=ui.current,u!==null){switch(u.tag){case 31:case 13:return Oi===null?od():u.alternate===null&&Lt===0&&(Lt=3),u.flags&=-257,u.flags|=65536,u.lanes=g,h===If?u.flags|=16384:(a=u.updateQueue,a===null?u.updateQueue=new Set([h]):a.add(h),ey(l,h,g)),!1;case 22:return u.flags|=65536,h===If?u.flags|=16384:(a=u.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=a):(u=a.retryQueue,u===null?a.retryQueue=new Set([h]):u.add(h)),ey(l,h,g)),!1}throw Error(i(435,u.tag))}return ey(l,h,g),od(),!1}if(tt)return a=ui.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=g,h!==Gm&&(l=Error(i(422),{cause:h}),ac(Ei(l,u)))):(h!==Gm&&(a=Error(i(423),{cause:h}),ac(Ei(a,u))),l=l.current.alternate,l.flags|=65536,g&=-g,l.lanes|=g,h=Ei(h,u),g=Og(l.stateNode,h,g),sg(l,g),Lt!==4&&(Lt=2)),!1;var x=Error(i(520),{cause:h});if(x=Ei(x,u),Ac===null?Ac=[x]:Ac.push(x),Lt!==4&&(Lt=2),a===null)return!0;h=Ei(h,u),u=a;do{switch(u.tag){case 3:return u.flags|=65536,l=g&-g,u.lanes|=l,l=Og(u.stateNode,h,l),sg(u,l),!1;case 1:if(a=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Cs===null||!Cs.has(x))))return u.flags|=65536,g&=-g,u.lanes|=g,g=Zw(g),Jw(g,l,u,h),sg(u,g),!1}u=u.return}while(u!==null);return!1}var _g=Error(i(461)),Yt=!1;function bn(l,a,u,h){a.child=l===null?ew(a,null,u,h):El(a,l.child,u,h)}function Xw(l,a,u,h,g){u=u.render;var x=a.ref;if("ref"in h){var w={};for(var C in h)C!=="ref"&&(w[C]=h[C])}else w=h;return wl(a),h=fg(l,a,u,w,x,g),C=dg(),l!==null&&!Yt?(hg(l,a,g),Br(l,a,g)):(tt&&C&&Ym(a),a.flags|=1,bn(l,a,h,g),a.child)}function Ww(l,a,u,h,g){if(l===null){var x=u.type;return typeof x=="function"&&!$m(x)&&x.defaultProps===void 0&&u.compare===null?(a.tag=15,a.type=x,Qw(l,a,x,h,g)):(l=_f(u.type,null,h,a,a.mode,g),l.ref=a.ref,l.return=a,a.child=l)}if(x=l.child,!jg(l,g)){var w=x.memoizedProps;if(u=u.compare,u=u!==null?u:sc,u(w,h)&&l.ref===a.ref)return Br(l,a,g)}return a.flags|=1,l=Dr(x,h),l.ref=a.ref,l.return=a,a.child=l}function Qw(l,a,u,h,g){if(l!==null){var x=l.memoizedProps;if(sc(x,h)&&l.ref===a.ref)if(Yt=!1,a.pendingProps=h=x,jg(l,g))(l.flags&131072)!==0&&(Yt=!0);else return a.lanes=l.lanes,Br(l,a,g)}return Dg(l,a,u,h,g)}function ev(l,a,u,h){var g=h.children,x=l!==null?l.memoizedState:null;if(l===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((a.flags&128)!==0){if(x=x!==null?x.baseLanes|u:u,l!==null){for(h=a.child=l.child,g=0;h!==null;)g=g|h.lanes|h.childLanes,h=h.sibling;h=g&~x}else h=0,a.child=null;return tv(l,a,x,u,h)}if((u&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},l!==null&&zf(a,x!==null?x.cachePool:null),x!==null?iw(a,x):og(),rw(a);else return h=a.lanes=536870912,tv(l,a,x!==null?x.baseLanes|u:u,u,h)}else x!==null?(zf(a,x.cachePool),iw(a,x),Ss(),a.memoizedState=null):(l!==null&&zf(a,null),og(),Ss());return bn(l,a,g,u),a.child}function Sc(l,a){return l!==null&&l.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function tv(l,a,u,h,g){var x=tg();return x=x===null?null:{parent:Ft._currentValue,pool:x},a.memoizedState={baseLanes:u,cachePool:x},l!==null&&zf(a,null),og(),rw(a),l!==null&&Mo(l,a,h,!0),a.childLanes=g,null}function Jf(l,a){return a=Wf({mode:a.mode,children:a.children},l.mode),a.ref=l.ref,l.child=a,a.return=l,a}function nv(l,a,u){return El(a,l.child,null,u),l=Jf(a,a.pendingProps),l.flags|=2,fi(a),a.memoizedState=null,l}function _N(l,a,u){var h=a.pendingProps,g=(a.flags&128)!==0;if(a.flags&=-129,l===null){if(tt){if(h.mode==="hidden")return l=Jf(a,h),a.lanes=536870912,Sc(null,l);if(cg(a),(l=At)?(l=pk(l,Mi),l=l!==null&&l.data==="&"?l:null,l!==null&&(a.memoizedState={dehydrated:l,treeContext:ds!==null?{id:lr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},u=US(l),u.return=a,a.child=u,gn=a,At=null)):l=null,l===null)throw ps(a);return a.lanes=536870912,null}return Jf(a,h)}var x=l.memoizedState;if(x!==null){var w=x.dehydrated;if(cg(a),g)if(a.flags&256)a.flags&=-257,a=nv(l,a,u);else if(a.memoizedState!==null)a.child=l.child,a.flags|=128,a=null;else throw Error(i(558));else if(Yt||Mo(l,a,u,!1),g=(u&l.childLanes)!==0,Yt||g){if(h=St,h!==null&&(w=Yx(h,u),w!==0&&w!==x.retryLane))throw x.retryLane=w,yl(l,w),Wn(h,l,w),_g;od(),a=nv(l,a,u)}else l=x.treeContext,At=_i(w.nextSibling),gn=a,tt=!0,hs=null,Mi=!1,l!==null&&PS(a,l),a=Jf(a,h),a.flags|=4096;return a}return l=Dr(l.child,{mode:h.mode,children:h.children}),l.ref=a.ref,a.child=l,l.return=a,l}function Xf(l,a){var u=a.ref;if(u===null)l!==null&&l.ref!==null&&(a.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(l===null||l.ref!==u)&&(a.flags|=4194816)}}function Dg(l,a,u,h,g){return wl(a),u=fg(l,a,u,h,void 0,g),h=dg(),l!==null&&!Yt?(hg(l,a,g),Br(l,a,g)):(tt&&h&&Ym(a),a.flags|=1,bn(l,a,u,g),a.child)}function iv(l,a,u,h,g,x){return wl(a),a.updateQueue=null,u=lw(a,h,u,g),sw(l),h=dg(),l!==null&&!Yt?(hg(l,a,x),Br(l,a,x)):(tt&&h&&Ym(a),a.flags|=1,bn(l,a,u,x),a.child)}function rv(l,a,u,h,g){if(wl(a),a.stateNode===null){var x=Co,w=u.contextType;typeof w=="object"&&w!==null&&(x=yn(w)),x=new u(h,x),a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Mg,a.stateNode=x,x._reactInternals=a,x=a.stateNode,x.props=h,x.state=a.memoizedState,x.refs={},ig(a),w=u.contextType,x.context=typeof w=="object"&&w!==null?yn(w):Co,x.state=a.memoizedState,w=u.getDerivedStateFromProps,typeof w=="function"&&(Ag(a,u,w,h),x.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(w=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),w!==x.state&&Mg.enqueueReplaceState(x,x.state,null),mc(a,h,x,g),pc(),x.state=a.memoizedState),typeof x.componentDidMount=="function"&&(a.flags|=4194308),h=!0}else if(l===null){x=a.stateNode;var C=a.memoizedProps,D=Al(u,C);x.props=D;var V=x.context,G=u.contextType;w=Co,typeof G=="object"&&G!==null&&(w=yn(G));var X=u.getDerivedStateFromProps;G=typeof X=="function"||typeof x.getSnapshotBeforeUpdate=="function",C=a.pendingProps!==C,G||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(C||V!==w)&&Fw(a,x,h,w),gs=!1;var $=a.memoizedState;x.state=$,mc(a,h,x,g),pc(),V=a.memoizedState,C||$!==V||gs?(typeof X=="function"&&(Ag(a,u,X,h),V=a.memoizedState),(D=gs||$w(a,u,D,h,$,V,w))?(G||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(a.flags|=4194308)):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=h,a.memoizedState=V),x.props=h,x.state=V,x.context=w,h=D):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),h=!1)}else{x=a.stateNode,rg(l,a),w=a.memoizedProps,G=Al(u,w),x.props=G,X=a.pendingProps,$=x.context,V=u.contextType,D=Co,typeof V=="object"&&V!==null&&(D=yn(V)),C=u.getDerivedStateFromProps,(V=typeof C=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(w!==X||$!==D)&&Fw(a,x,h,D),gs=!1,$=a.memoizedState,x.state=$,mc(a,h,x,g),pc();var q=a.memoizedState;w!==X||$!==q||gs||l!==null&&l.dependencies!==null&&Nf(l.dependencies)?(typeof C=="function"&&(Ag(a,u,C,h),q=a.memoizedState),(G=gs||$w(a,u,G,h,$,q,D)||l!==null&&l.dependencies!==null&&Nf(l.dependencies))?(V||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(h,q,D),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(h,q,D)),typeof x.componentDidUpdate=="function"&&(a.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof x.componentDidUpdate!="function"||w===l.memoizedProps&&$===l.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===l.memoizedProps&&$===l.memoizedState||(a.flags|=1024),a.memoizedProps=h,a.memoizedState=q),x.props=h,x.state=q,x.context=D,h=G):(typeof x.componentDidUpdate!="function"||w===l.memoizedProps&&$===l.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===l.memoizedProps&&$===l.memoizedState||(a.flags|=1024),h=!1)}return x=h,Xf(l,a),h=(a.flags&128)!==0,x||h?(x=a.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:x.render(),a.flags|=1,l!==null&&h?(a.child=El(a,l.child,null,g),a.child=El(a,null,u,g)):bn(l,a,u,g),a.memoizedState=x.state,l=a.child):l=Br(l,a,g),l}function sv(l,a,u,h){return xl(),a.flags|=256,bn(l,a,u,h),a.child}var Ng={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rg(l){return{baseLanes:l,cachePool:GS()}}function zg(l,a,u){return l=l!==null?l.childLanes&~u:0,a&&(l|=hi),l}function lv(l,a,u){var h=a.pendingProps,g=!1,x=(a.flags&128)!==0,w;if((w=x)||(w=l!==null&&l.memoizedState===null?!1:(Vt.current&2)!==0),w&&(g=!0,a.flags&=-129),w=(a.flags&32)!==0,a.flags&=-33,l===null){if(tt){if(g?xs(a):Ss(),(l=At)?(l=pk(l,Mi),l=l!==null&&l.data!=="&"?l:null,l!==null&&(a.memoizedState={dehydrated:l,treeContext:ds!==null?{id:lr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},u=US(l),u.return=a,a.child=u,gn=a,At=null)):l=null,l===null)throw ps(a);return gy(l)?a.lanes=32:a.lanes=536870912,null}var C=h.children;return h=h.fallback,g?(Ss(),g=a.mode,C=Wf({mode:"hidden",children:C},g),h=bl(h,g,u,null),C.return=a,h.return=a,C.sibling=h,a.child=C,h=a.child,h.memoizedState=Rg(u),h.childLanes=zg(l,w,u),a.memoizedState=Ng,Sc(null,h)):(xs(a),Lg(a,C))}var D=l.memoizedState;if(D!==null&&(C=D.dehydrated,C!==null)){if(x)a.flags&256?(xs(a),a.flags&=-257,a=Ig(l,a,u)):a.memoizedState!==null?(Ss(),a.child=l.child,a.flags|=128,a=null):(Ss(),C=h.fallback,g=a.mode,h=Wf({mode:"visible",children:h.children},g),C=bl(C,g,u,null),C.flags|=2,h.return=a,C.return=a,h.sibling=C,a.child=h,El(a,l.child,null,u),h=a.child,h.memoizedState=Rg(u),h.childLanes=zg(l,w,u),a.memoizedState=Ng,a=Sc(null,h));else if(xs(a),gy(C)){if(w=C.nextSibling&&C.nextSibling.dataset,w)var V=w.dgst;w=V,h=Error(i(419)),h.stack="",h.digest=w,ac({value:h,source:null,stack:null}),a=Ig(l,a,u)}else if(Yt||Mo(l,a,u,!1),w=(u&l.childLanes)!==0,Yt||w){if(w=St,w!==null&&(h=Yx(w,u),h!==0&&h!==D.retryLane))throw D.retryLane=h,yl(l,h),Wn(w,l,h),_g;my(C)||od(),a=Ig(l,a,u)}else my(C)?(a.flags|=192,a.child=l.child,a=null):(l=D.treeContext,At=_i(C.nextSibling),gn=a,tt=!0,hs=null,Mi=!1,l!==null&&PS(a,l),a=Lg(a,h.children),a.flags|=4096);return a}return g?(Ss(),C=h.fallback,g=a.mode,D=l.child,V=D.sibling,h=Dr(D,{mode:"hidden",children:h.children}),h.subtreeFlags=D.subtreeFlags&65011712,V!==null?C=Dr(V,C):(C=bl(C,g,u,null),C.flags|=2),C.return=a,h.return=a,h.sibling=C,a.child=h,Sc(null,h),h=a.child,C=l.child.memoizedState,C===null?C=Rg(u):(g=C.cachePool,g!==null?(D=Ft._currentValue,g=g.parent!==D?{parent:D,pool:D}:g):g=GS(),C={baseLanes:C.baseLanes|u,cachePool:g}),h.memoizedState=C,h.childLanes=zg(l,w,u),a.memoizedState=Ng,Sc(l.child,h)):(xs(a),u=l.child,l=u.sibling,u=Dr(u,{mode:"visible",children:h.children}),u.return=a,u.sibling=null,l!==null&&(w=a.deletions,w===null?(a.deletions=[l],a.flags|=16):w.push(l)),a.child=u,a.memoizedState=null,u)}function Lg(l,a){return a=Wf({mode:"visible",children:a},l.mode),a.return=l,l.child=a}function Wf(l,a){return l=ci(22,l,null,a),l.lanes=0,l}function Ig(l,a,u){return El(a,l.child,null,u),l=Lg(a,a.pendingProps.children),l.flags|=2,a.memoizedState=null,l}function ov(l,a,u){l.lanes|=a;var h=l.alternate;h!==null&&(h.lanes|=a),Xm(l.return,a,u)}function Bg(l,a,u,h,g,x){var w=l.memoizedState;w===null?l.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:g,treeForkCount:x}:(w.isBackwards=a,w.rendering=null,w.renderingStartTime=0,w.last=h,w.tail=u,w.tailMode=g,w.treeForkCount=x)}function av(l,a,u){var h=a.pendingProps,g=h.revealOrder,x=h.tail;h=h.children;var w=Vt.current,C=(w&2)!==0;if(C?(w=w&1|2,a.flags|=128):w&=1,T(Vt,w),bn(l,a,h,u),h=tt?oc:0,!C&&l!==null&&(l.flags&128)!==0)e:for(l=a.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&ov(l,u,a);else if(l.tag===19)ov(l,u,a);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(g){case"forwards":for(u=a.child,g=null;u!==null;)l=u.alternate,l!==null&&Hf(l)===null&&(g=u),u=u.sibling;u=g,u===null?(g=a.child,a.child=null):(g=u.sibling,u.sibling=null),Bg(a,!1,g,u,x,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,g=a.child,a.child=null;g!==null;){if(l=g.alternate,l!==null&&Hf(l)===null){a.child=g;break}l=g.sibling,g.sibling=u,u=g,g=l}Bg(a,!0,u,null,x,h);break;case"together":Bg(a,!1,null,null,void 0,h);break;default:a.memoizedState=null}return a.child}function Br(l,a,u){if(l!==null&&(a.dependencies=l.dependencies),ks|=a.lanes,(u&a.childLanes)===0)if(l!==null){if(Mo(l,a,u,!1),(u&a.childLanes)===0)return null}else return null;if(l!==null&&a.child!==l.child)throw Error(i(153));if(a.child!==null){for(l=a.child,u=Dr(l,l.pendingProps),a.child=u,u.return=a;l.sibling!==null;)l=l.sibling,u=u.sibling=Dr(l,l.pendingProps),u.return=a;u.sibling=null}return a.child}function jg(l,a){return(l.lanes&a)!==0?!0:(l=l.dependencies,!!(l!==null&&Nf(l)))}function DN(l,a,u){switch(a.tag){case 3:Ge(a,a.stateNode.containerInfo),ms(a,Ft,l.memoizedState.cache),xl();break;case 27:case 5:ct(a);break;case 4:Ge(a,a.stateNode.containerInfo);break;case 10:ms(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,cg(a),null;break;case 13:var h=a.memoizedState;if(h!==null)return h.dehydrated!==null?(xs(a),a.flags|=128,null):(u&a.child.childLanes)!==0?lv(l,a,u):(xs(a),l=Br(l,a,u),l!==null?l.sibling:null);xs(a);break;case 19:var g=(l.flags&128)!==0;if(h=(u&a.childLanes)!==0,h||(Mo(l,a,u,!1),h=(u&a.childLanes)!==0),g){if(h)return av(l,a,u);a.flags|=128}if(g=a.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),T(Vt,Vt.current),h)break;return null;case 22:return a.lanes=0,ev(l,a,u,a.pendingProps);case 24:ms(a,Ft,l.memoizedState.cache)}return Br(l,a,u)}function cv(l,a,u){if(l!==null)if(l.memoizedProps!==a.pendingProps)Yt=!0;else{if(!jg(l,u)&&(a.flags&128)===0)return Yt=!1,DN(l,a,u);Yt=(l.flags&131072)!==0}else Yt=!1,tt&&(a.flags&1048576)!==0&&VS(a,oc,a.index);switch(a.lanes=0,a.tag){case 16:e:{var h=a.pendingProps;if(l=kl(a.elementType),a.type=l,typeof l=="function")$m(l)?(h=Al(l,h),a.tag=1,a=rv(null,a,l,h,u)):(a.tag=0,a=Dg(null,a,l,h,u));else{if(l!=null){var g=l.$$typeof;if(g===re){a.tag=11,a=Xw(null,a,l,h,u);break e}else if(g===z){a.tag=14,a=Ww(null,a,l,h,u);break e}}throw a=ie(l)||l,Error(i(306,a,""))}}return a;case 0:return Dg(l,a,a.type,a.pendingProps,u);case 1:return h=a.type,g=Al(h,a.pendingProps),rv(l,a,h,g,u);case 3:e:{if(Ge(a,a.stateNode.containerInfo),l===null)throw Error(i(387));h=a.pendingProps;var x=a.memoizedState;g=x.element,rg(l,a),mc(a,h,null,u);var w=a.memoizedState;if(h=w.cache,ms(a,Ft,h),h!==x.cache&&Wm(a,[Ft],u,!0),pc(),h=w.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:w.cache},a.updateQueue.baseState=x,a.memoizedState=x,a.flags&256){a=sv(l,a,h,u);break e}else if(h!==g){g=Ei(Error(i(424)),a),ac(g),a=sv(l,a,h,u);break e}else{switch(l=a.stateNode.containerInfo,l.nodeType){case 9:l=l.body;break;default:l=l.nodeName==="HTML"?l.ownerDocument.body:l}for(At=_i(l.firstChild),gn=a,tt=!0,hs=null,Mi=!0,u=ew(a,null,h,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(xl(),h===g){a=Br(l,a,u);break e}bn(l,a,h,u)}a=a.child}return a;case 26:return Xf(l,a),l===null?(u=Sk(a.type,null,a.pendingProps,null))?a.memoizedState=u:tt||(u=a.type,l=a.pendingProps,h=pd(ge.current).createElement(u),h[mn]=a,h[Yn]=l,xn(h,u,l),rn(h),a.stateNode=h):a.memoizedState=Sk(a.type,l.memoizedProps,a.pendingProps,l.memoizedState),null;case 27:return ct(a),l===null&&tt&&(h=a.stateNode=yk(a.type,a.pendingProps,ge.current),gn=a,Mi=!0,g=At,Ms(a.type)?(yy=g,At=_i(h.firstChild)):At=g),bn(l,a,a.pendingProps.children,u),Xf(l,a),l===null&&(a.flags|=4194304),a.child;case 5:return l===null&&tt&&((g=h=At)&&(h=oR(h,a.type,a.pendingProps,Mi),h!==null?(a.stateNode=h,gn=a,At=_i(h.firstChild),Mi=!1,g=!0):g=!1),g||ps(a)),ct(a),g=a.type,x=a.pendingProps,w=l!==null?l.memoizedProps:null,h=x.children,dy(g,x)?h=null:w!==null&&dy(g,w)&&(a.flags|=32),a.memoizedState!==null&&(g=fg(l,a,vN,null,null,u),Lc._currentValue=g),Xf(l,a),bn(l,a,h,u),a.child;case 6:return l===null&&tt&&((l=u=At)&&(u=aR(u,a.pendingProps,Mi),u!==null?(a.stateNode=u,gn=a,At=null,l=!0):l=!1),l||ps(a)),null;case 13:return lv(l,a,u);case 4:return Ge(a,a.stateNode.containerInfo),h=a.pendingProps,l===null?a.child=El(a,null,h,u):bn(l,a,h,u),a.child;case 11:return Xw(l,a,a.type,a.pendingProps,u);case 7:return bn(l,a,a.pendingProps,u),a.child;case 8:return bn(l,a,a.pendingProps.children,u),a.child;case 12:return bn(l,a,a.pendingProps.children,u),a.child;case 10:return h=a.pendingProps,ms(a,a.type,h.value),bn(l,a,h.children,u),a.child;case 9:return g=a.type._context,h=a.pendingProps.children,wl(a),g=yn(g),h=h(g),a.flags|=1,bn(l,a,h,u),a.child;case 14:return Ww(l,a,a.type,a.pendingProps,u);case 15:return Qw(l,a,a.type,a.pendingProps,u);case 19:return av(l,a,u);case 31:return _N(l,a,u);case 22:return ev(l,a,u,a.pendingProps);case 24:return wl(a),h=yn(Ft),l===null?(g=tg(),g===null&&(g=St,x=Qm(),g.pooledCache=x,x.refCount++,x!==null&&(g.pooledCacheLanes|=u),g=x),a.memoizedState={parent:h,cache:g},ig(a),ms(a,Ft,g)):((l.lanes&u)!==0&&(rg(l,a),mc(a,null,null,u),pc()),g=l.memoizedState,x=a.memoizedState,g.parent!==h?(g={parent:h,cache:h},a.memoizedState=g,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=g),ms(a,Ft,h)):(h=x.cache,ms(a,Ft,h),h!==g.cache&&Wm(a,[Ft],u,!0))),bn(l,a,a.pendingProps.children,u),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function jr(l){l.flags|=4}function Ug(l,a,u,h,g){if((a=(l.mode&32)!==0)&&(a=!1),a){if(l.flags|=16777216,(g&335544128)===g)if(l.stateNode.complete)l.flags|=8192;else if(Iv())l.flags|=8192;else throw Cl=If,ng}else l.flags&=-16777217}function uv(l,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!Ek(a))if(Iv())l.flags|=8192;else throw Cl=If,ng}function Qf(l,a){a!==null&&(l.flags|=4),l.flags&16384&&(a=l.tag!==22?$x():536870912,l.lanes|=a,Ho|=a)}function wc(l,a){if(!tt)switch(l.tailMode){case"hidden":a=l.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?l.tail=null:u.sibling=null;break;case"collapsed":u=l.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?a||l.tail===null?l.tail=null:l.tail.sibling=null:h.sibling=null}}function Mt(l){var a=l.alternate!==null&&l.alternate.child===l.child,u=0,h=0;if(a)for(var g=l.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags&65011712,h|=g.flags&65011712,g.return=l,g=g.sibling;else for(g=l.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags,h|=g.flags,g.return=l,g=g.sibling;return l.subtreeFlags|=h,l.childLanes=u,a}function NN(l,a,u){var h=a.pendingProps;switch(Km(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(a),null;case 1:return Mt(a),null;case 3:return u=a.stateNode,h=null,l!==null&&(h=l.memoizedState.cache),a.memoizedState.cache!==h&&(a.flags|=2048),zr(Ft),Fe(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(l===null||l.child===null)&&(Ao(a)?jr(a):l===null||l.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Zm())),Mt(a),null;case 26:var g=a.type,x=a.memoizedState;return l===null?(jr(a),x!==null?(Mt(a),uv(a,x)):(Mt(a),Ug(a,g,null,h,u))):x?x!==l.memoizedState?(jr(a),Mt(a),uv(a,x)):(Mt(a),a.flags&=-16777217):(l=l.memoizedProps,l!==h&&jr(a),Mt(a),Ug(a,g,l,h,u)),null;case 27:if(Ce(a),u=ge.current,g=a.type,l!==null&&a.stateNode!=null)l.memoizedProps!==h&&jr(a);else{if(!h){if(a.stateNode===null)throw Error(i(166));return Mt(a),null}l=ne.current,Ao(a)?$S(a):(l=yk(g,h,u),a.stateNode=l,jr(a))}return Mt(a),null;case 5:if(Ce(a),g=a.type,l!==null&&a.stateNode!=null)l.memoizedProps!==h&&jr(a);else{if(!h){if(a.stateNode===null)throw Error(i(166));return Mt(a),null}if(x=ne.current,Ao(a))$S(a);else{var w=pd(ge.current);switch(x){case 1:x=w.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:x=w.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":x=w.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":x=w.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":x=w.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof h.is=="string"?w.createElement("select",{is:h.is}):w.createElement("select"),h.multiple?x.multiple=!0:h.size&&(x.size=h.size);break;default:x=typeof h.is=="string"?w.createElement(g,{is:h.is}):w.createElement(g)}}x[mn]=a,x[Yn]=h;e:for(w=a.child;w!==null;){if(w.tag===5||w.tag===6)x.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===a)break e;for(;w.sibling===null;){if(w.return===null||w.return===a)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}a.stateNode=x;e:switch(xn(x,g,h),g){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&jr(a)}}return Mt(a),Ug(a,a.type,l===null?null:l.memoizedProps,a.pendingProps,u),null;case 6:if(l&&a.stateNode!=null)l.memoizedProps!==h&&jr(a);else{if(typeof h!="string"&&a.stateNode===null)throw Error(i(166));if(l=ge.current,Ao(a)){if(l=a.stateNode,u=a.memoizedProps,h=null,g=gn,g!==null)switch(g.tag){case 27:case 5:h=g.memoizedProps}l[mn]=a,l=!!(l.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||lk(l.nodeValue,u)),l||ps(a,!0)}else l=pd(l).createTextNode(h),l[mn]=a,a.stateNode=l}return Mt(a),null;case 31:if(u=a.memoizedState,l===null||l.memoizedState!==null){if(h=Ao(a),u!==null){if(l===null){if(!h)throw Error(i(318));if(l=a.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(557));l[mn]=a}else xl(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Mt(a),l=!1}else u=Zm(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=u),l=!0;if(!l)return a.flags&256?(fi(a),a):(fi(a),null);if((a.flags&128)!==0)throw Error(i(558))}return Mt(a),null;case 13:if(h=a.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(g=Ao(a),h!==null&&h.dehydrated!==null){if(l===null){if(!g)throw Error(i(318));if(g=a.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[mn]=a}else xl(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Mt(a),g=!1}else g=Zm(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),g=!0;if(!g)return a.flags&256?(fi(a),a):(fi(a),null)}return fi(a),(a.flags&128)!==0?(a.lanes=u,a):(u=h!==null,l=l!==null&&l.memoizedState!==null,u&&(h=a.child,g=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(g=h.alternate.memoizedState.cachePool.pool),x=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(x=h.memoizedState.cachePool.pool),x!==g&&(h.flags|=2048)),u!==l&&u&&(a.child.flags|=8192),Qf(a,a.updateQueue),Mt(a),null);case 4:return Fe(),l===null&&oy(a.stateNode.containerInfo),Mt(a),null;case 10:return zr(a.type),Mt(a),null;case 19:if(U(Vt),h=a.memoizedState,h===null)return Mt(a),null;if(g=(a.flags&128)!==0,x=h.rendering,x===null)if(g)wc(h,!1);else{if(Lt!==0||l!==null&&(l.flags&128)!==0)for(l=a.child;l!==null;){if(x=Hf(l),x!==null){for(a.flags|=128,wc(h,!1),l=x.updateQueue,a.updateQueue=l,Qf(a,l),a.subtreeFlags=0,l=u,u=a.child;u!==null;)jS(u,l),u=u.sibling;return T(Vt,Vt.current&1|2),tt&&Nr(a,h.treeForkCount),a.child}l=l.sibling}h.tail!==null&&qe()>rd&&(a.flags|=128,g=!0,wc(h,!1),a.lanes=4194304)}else{if(!g)if(l=Hf(x),l!==null){if(a.flags|=128,g=!0,l=l.updateQueue,a.updateQueue=l,Qf(a,l),wc(h,!0),h.tail===null&&h.tailMode==="hidden"&&!x.alternate&&!tt)return Mt(a),null}else 2*qe()-h.renderingStartTime>rd&&u!==536870912&&(a.flags|=128,g=!0,wc(h,!1),a.lanes=4194304);h.isBackwards?(x.sibling=a.child,a.child=x):(l=h.last,l!==null?l.sibling=x:a.child=x,h.last=x)}return h.tail!==null?(l=h.tail,h.rendering=l,h.tail=l.sibling,h.renderingStartTime=qe(),l.sibling=null,u=Vt.current,T(Vt,g?u&1|2:u&1),tt&&Nr(a,h.treeForkCount),l):(Mt(a),null);case 22:case 23:return fi(a),ag(),h=a.memoizedState!==null,l!==null?l.memoizedState!==null!==h&&(a.flags|=8192):h&&(a.flags|=8192),h?(u&536870912)!==0&&(a.flags&128)===0&&(Mt(a),a.subtreeFlags&6&&(a.flags|=8192)):Mt(a),u=a.updateQueue,u!==null&&Qf(a,u.retryQueue),u=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),h=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),h!==u&&(a.flags|=2048),l!==null&&U(vl),null;case 24:return u=null,l!==null&&(u=l.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),zr(Ft),Mt(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function RN(l,a){switch(Km(a),a.tag){case 1:return l=a.flags,l&65536?(a.flags=l&-65537|128,a):null;case 3:return zr(Ft),Fe(),l=a.flags,(l&65536)!==0&&(l&128)===0?(a.flags=l&-65537|128,a):null;case 26:case 27:case 5:return Ce(a),null;case 31:if(a.memoizedState!==null){if(fi(a),a.alternate===null)throw Error(i(340));xl()}return l=a.flags,l&65536?(a.flags=l&-65537|128,a):null;case 13:if(fi(a),l=a.memoizedState,l!==null&&l.dehydrated!==null){if(a.alternate===null)throw Error(i(340));xl()}return l=a.flags,l&65536?(a.flags=l&-65537|128,a):null;case 19:return U(Vt),null;case 4:return Fe(),null;case 10:return zr(a.type),null;case 22:case 23:return fi(a),ag(),l!==null&&U(vl),l=a.flags,l&65536?(a.flags=l&-65537|128,a):null;case 24:return zr(Ft),null;case 25:return null;default:return null}}function fv(l,a){switch(Km(a),a.tag){case 3:zr(Ft),Fe();break;case 26:case 27:case 5:Ce(a);break;case 4:Fe();break;case 31:a.memoizedState!==null&&fi(a);break;case 13:fi(a);break;case 19:U(Vt);break;case 10:zr(a.type);break;case 22:case 23:fi(a),ag(),l!==null&&U(vl);break;case 24:zr(Ft)}}function vc(l,a){try{var u=a.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var g=h.next;u=g;do{if((u.tag&l)===l){h=void 0;var x=u.create,w=u.inst;h=x(),w.destroy=h}u=u.next}while(u!==g)}}catch(C){dt(a,a.return,C)}}function ws(l,a,u){try{var h=a.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var x=g.next;h=x;do{if((h.tag&l)===l){var w=h.inst,C=w.destroy;if(C!==void 0){w.destroy=void 0,g=a;var D=u,V=C;try{V()}catch(G){dt(g,D,G)}}}h=h.next}while(h!==x)}}catch(G){dt(a,a.return,G)}}function dv(l){var a=l.updateQueue;if(a!==null){var u=l.stateNode;try{nw(a,u)}catch(h){dt(l,l.return,h)}}}function hv(l,a,u){u.props=Al(l.type,l.memoizedProps),u.state=l.memoizedState;try{u.componentWillUnmount()}catch(h){dt(l,a,h)}}function kc(l,a){try{var u=l.ref;if(u!==null){switch(l.tag){case 26:case 27:case 5:var h=l.stateNode;break;case 30:h=l.stateNode;break;default:h=l.stateNode}typeof u=="function"?l.refCleanup=u(h):u.current=h}}catch(g){dt(l,a,g)}}function ar(l,a){var u=l.ref,h=l.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(g){dt(l,a,g)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(g){dt(l,a,g)}else u.current=null}function pv(l){var a=l.type,u=l.memoizedProps,h=l.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(g){dt(l,l.return,g)}}function Hg(l,a,u){try{var h=l.stateNode;tR(h,l.type,u,a),h[Yn]=a}catch(g){dt(l,l.return,g)}}function mv(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&Ms(l.type)||l.tag===4}function Vg(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||mv(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&Ms(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Pg(l,a,u){var h=l.tag;if(h===5||h===6)l=l.stateNode,a?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(l,a):(a=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,a.appendChild(l),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=Or));else if(h!==4&&(h===27&&Ms(l.type)&&(u=l.stateNode,a=null),l=l.child,l!==null))for(Pg(l,a,u),l=l.sibling;l!==null;)Pg(l,a,u),l=l.sibling}function ed(l,a,u){var h=l.tag;if(h===5||h===6)l=l.stateNode,a?u.insertBefore(l,a):u.appendChild(l);else if(h!==4&&(h===27&&Ms(l.type)&&(u=l.stateNode),l=l.child,l!==null))for(ed(l,a,u),l=l.sibling;l!==null;)ed(l,a,u),l=l.sibling}function gv(l){var a=l.stateNode,u=l.memoizedProps;try{for(var h=l.type,g=a.attributes;g.length;)a.removeAttributeNode(g[0]);xn(a,h,u),a[mn]=l,a[Yn]=u}catch(x){dt(l,l.return,x)}}var Ur=!1,Kt=!1,$g=!1,yv=typeof WeakSet=="function"?WeakSet:Set,sn=null;function zN(l,a){if(l=l.containerInfo,uy=wd,l=OS(l),Im(l)){if("selectionStart"in l)var u={start:l.selectionStart,end:l.selectionEnd};else e:{u=(u=l.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var g=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var w=0,C=-1,D=-1,V=0,G=0,X=l,$=null;t:for(;;){for(var q;X!==u||g!==0&&X.nodeType!==3||(C=w+g),X!==x||h!==0&&X.nodeType!==3||(D=w+h),X.nodeType===3&&(w+=X.nodeValue.length),(q=X.firstChild)!==null;)$=X,X=q;for(;;){if(X===l)break t;if($===u&&++V===g&&(C=w),$===x&&++G===h&&(D=w),(q=X.nextSibling)!==null)break;X=$,$=X.parentNode}X=q}u=C===-1||D===-1?null:{start:C,end:D}}else u=null}u=u||{start:0,end:0}}else u=null;for(fy={focusedElem:l,selectionRange:u},wd=!1,sn=a;sn!==null;)if(a=sn,l=a.child,(a.subtreeFlags&1028)!==0&&l!==null)l.return=a,sn=l;else for(;sn!==null;){switch(a=sn,x=a.alternate,l=a.flags,a.tag){case 0:if((l&4)!==0&&(l=a.updateQueue,l=l!==null?l.events:null,l!==null))for(u=0;u<l.length;u++)g=l[u],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((l&1024)!==0&&x!==null){l=void 0,u=a,g=x.memoizedProps,x=x.memoizedState,h=u.stateNode;try{var be=Al(u.type,g);l=h.getSnapshotBeforeUpdate(be,x),h.__reactInternalSnapshotBeforeUpdate=l}catch(Me){dt(u,u.return,Me)}}break;case 3:if((l&1024)!==0){if(l=a.stateNode.containerInfo,u=l.nodeType,u===9)py(l);else if(u===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":py(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((l&1024)!==0)throw Error(i(163))}if(l=a.sibling,l!==null){l.return=a.return,sn=l;break}sn=a.return}}function bv(l,a,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Vr(l,u),h&4&&vc(5,u);break;case 1:if(Vr(l,u),h&4)if(l=u.stateNode,a===null)try{l.componentDidMount()}catch(w){dt(u,u.return,w)}else{var g=Al(u.type,a.memoizedProps);a=a.memoizedState;try{l.componentDidUpdate(g,a,l.__reactInternalSnapshotBeforeUpdate)}catch(w){dt(u,u.return,w)}}h&64&&dv(u),h&512&&kc(u,u.return);break;case 3:if(Vr(l,u),h&64&&(l=u.updateQueue,l!==null)){if(a=null,u.child!==null)switch(u.child.tag){case 27:case 5:a=u.child.stateNode;break;case 1:a=u.child.stateNode}try{nw(l,a)}catch(w){dt(u,u.return,w)}}break;case 27:a===null&&h&4&&gv(u);case 26:case 5:Vr(l,u),a===null&&h&4&&pv(u),h&512&&kc(u,u.return);break;case 12:Vr(l,u);break;case 31:Vr(l,u),h&4&&wv(l,u);break;case 13:Vr(l,u),h&4&&vv(l,u),h&64&&(l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null&&(u=$N.bind(null,u),cR(l,u))));break;case 22:if(h=u.memoizedState!==null||Ur,!h){a=a!==null&&a.memoizedState!==null||Kt,g=Ur;var x=Kt;Ur=h,(Kt=a)&&!x?Pr(l,u,(u.subtreeFlags&8772)!==0):Vr(l,u),Ur=g,Kt=x}break;case 30:break;default:Vr(l,u)}}function xv(l){var a=l.alternate;a!==null&&(l.alternate=null,xv(a)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(a=l.stateNode,a!==null&&xm(a)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}var _t=null,Gn=!1;function Hr(l,a,u){for(u=u.child;u!==null;)Sv(l,a,u),u=u.sibling}function Sv(l,a,u){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(Ln,u)}catch{}switch(u.tag){case 26:Kt||ar(u,a),Hr(l,a,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Kt||ar(u,a);var h=_t,g=Gn;Ms(u.type)&&(_t=u.stateNode,Gn=!1),Hr(l,a,u),Nc(u.stateNode),_t=h,Gn=g;break;case 5:Kt||ar(u,a);case 6:if(h=_t,g=Gn,_t=null,Hr(l,a,u),_t=h,Gn=g,_t!==null)if(Gn)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(u.stateNode)}catch(x){dt(u,a,x)}else try{_t.removeChild(u.stateNode)}catch(x){dt(u,a,x)}break;case 18:_t!==null&&(Gn?(l=_t,dk(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,u.stateNode),Go(l)):dk(_t,u.stateNode));break;case 4:h=_t,g=Gn,_t=u.stateNode.containerInfo,Gn=!0,Hr(l,a,u),_t=h,Gn=g;break;case 0:case 11:case 14:case 15:ws(2,u,a),Kt||ws(4,u,a),Hr(l,a,u);break;case 1:Kt||(ar(u,a),h=u.stateNode,typeof h.componentWillUnmount=="function"&&hv(u,a,h)),Hr(l,a,u);break;case 21:Hr(l,a,u);break;case 22:Kt=(h=Kt)||u.memoizedState!==null,Hr(l,a,u),Kt=h;break;default:Hr(l,a,u)}}function wv(l,a){if(a.memoizedState===null&&(l=a.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{Go(l)}catch(u){dt(a,a.return,u)}}}function vv(l,a){if(a.memoizedState===null&&(l=a.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{Go(l)}catch(u){dt(a,a.return,u)}}function LN(l){switch(l.tag){case 31:case 13:case 19:var a=l.stateNode;return a===null&&(a=l.stateNode=new yv),a;case 22:return l=l.stateNode,a=l._retryCache,a===null&&(a=l._retryCache=new yv),a;default:throw Error(i(435,l.tag))}}function td(l,a){var u=LN(l);a.forEach(function(h){if(!u.has(h)){u.add(h);var g=FN.bind(null,l,h);h.then(g,g)}})}function Zn(l,a){var u=a.deletions;if(u!==null)for(var h=0;h<u.length;h++){var g=u[h],x=l,w=a,C=w;e:for(;C!==null;){switch(C.tag){case 27:if(Ms(C.type)){_t=C.stateNode,Gn=!1;break e}break;case 5:_t=C.stateNode,Gn=!1;break e;case 3:case 4:_t=C.stateNode.containerInfo,Gn=!0;break e}C=C.return}if(_t===null)throw Error(i(160));Sv(x,w,g),_t=null,Gn=!1,x=g.alternate,x!==null&&(x.return=null),g.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)kv(a,l),a=a.sibling}var Zi=null;function kv(l,a){var u=l.alternate,h=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:Zn(a,l),Jn(l),h&4&&(ws(3,l,l.return),vc(3,l),ws(5,l,l.return));break;case 1:Zn(a,l),Jn(l),h&512&&(Kt||u===null||ar(u,u.return)),h&64&&Ur&&(l=l.updateQueue,l!==null&&(h=l.callbacks,h!==null&&(u=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var g=Zi;if(Zn(a,l),Jn(l),h&512&&(Kt||u===null||ar(u,u.return)),h&4){var x=u!==null?u.memoizedState:null;if(h=l.memoizedState,u===null)if(h===null)if(l.stateNode===null){e:{h=l.type,u=l.memoizedProps,g=g.ownerDocument||g;t:switch(h){case"title":x=g.getElementsByTagName("title")[0],(!x||x[Ja]||x[mn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=g.createElement(h),g.head.insertBefore(x,g.querySelector("head > title"))),xn(x,h,u),x[mn]=l,rn(x),h=x;break e;case"link":var w=kk("link","href",g).get(h+(u.href||""));if(w){for(var C=0;C<w.length;C++)if(x=w[C],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){w.splice(C,1);break t}}x=g.createElement(h),xn(x,h,u),g.head.appendChild(x);break;case"meta":if(w=kk("meta","content",g).get(h+(u.content||""))){for(C=0;C<w.length;C++)if(x=w[C],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){w.splice(C,1);break t}}x=g.createElement(h),xn(x,h,u),g.head.appendChild(x);break;default:throw Error(i(468,h))}x[mn]=l,rn(x),h=x}l.stateNode=h}else Ck(g,l.type,l.stateNode);else l.stateNode=vk(g,h,l.memoizedProps);else x!==h?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,h===null?Ck(g,l.type,l.stateNode):vk(g,h,l.memoizedProps)):h===null&&l.stateNode!==null&&Hg(l,l.memoizedProps,u.memoizedProps)}break;case 27:Zn(a,l),Jn(l),h&512&&(Kt||u===null||ar(u,u.return)),u!==null&&h&4&&Hg(l,l.memoizedProps,u.memoizedProps);break;case 5:if(Zn(a,l),Jn(l),h&512&&(Kt||u===null||ar(u,u.return)),l.flags&32){g=l.stateNode;try{yo(g,"")}catch(be){dt(l,l.return,be)}}h&4&&l.stateNode!=null&&(g=l.memoizedProps,Hg(l,g,u!==null?u.memoizedProps:g)),h&1024&&($g=!0);break;case 6:if(Zn(a,l),Jn(l),h&4){if(l.stateNode===null)throw Error(i(162));h=l.memoizedProps,u=l.stateNode;try{u.nodeValue=h}catch(be){dt(l,l.return,be)}}break;case 3:if(yd=null,g=Zi,Zi=md(a.containerInfo),Zn(a,l),Zi=g,Jn(l),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Go(a.containerInfo)}catch(be){dt(l,l.return,be)}$g&&($g=!1,Cv(l));break;case 4:h=Zi,Zi=md(l.stateNode.containerInfo),Zn(a,l),Jn(l),Zi=h;break;case 12:Zn(a,l),Jn(l);break;case 31:Zn(a,l),Jn(l),h&4&&(h=l.updateQueue,h!==null&&(l.updateQueue=null,td(l,h)));break;case 13:Zn(a,l),Jn(l),l.child.flags&8192&&l.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(id=qe()),h&4&&(h=l.updateQueue,h!==null&&(l.updateQueue=null,td(l,h)));break;case 22:g=l.memoizedState!==null;var D=u!==null&&u.memoizedState!==null,V=Ur,G=Kt;if(Ur=V||g,Kt=G||D,Zn(a,l),Kt=G,Ur=V,Jn(l),h&8192)e:for(a=l.stateNode,a._visibility=g?a._visibility&-2:a._visibility|1,g&&(u===null||D||Ur||Kt||Ml(l)),u=null,a=l;;){if(a.tag===5||a.tag===26){if(u===null){D=u=a;try{if(x=D.stateNode,g)w=x.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{C=D.stateNode;var X=D.memoizedProps.style,$=X!=null&&X.hasOwnProperty("display")?X.display:null;C.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(be){dt(D,D.return,be)}}}else if(a.tag===6){if(u===null){D=a;try{D.stateNode.nodeValue=g?"":D.memoizedProps}catch(be){dt(D,D.return,be)}}}else if(a.tag===18){if(u===null){D=a;try{var q=D.stateNode;g?hk(q,!0):hk(D.stateNode,!1)}catch(be){dt(D,D.return,be)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===l)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;u===a&&(u=null),a=a.return}u===a&&(u=null),a.sibling.return=a.return,a=a.sibling}h&4&&(h=l.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,td(l,u))));break;case 19:Zn(a,l),Jn(l),h&4&&(h=l.updateQueue,h!==null&&(l.updateQueue=null,td(l,h)));break;case 30:break;case 21:break;default:Zn(a,l),Jn(l)}}function Jn(l){var a=l.flags;if(a&2){try{for(var u,h=l.return;h!==null;){if(mv(h)){u=h;break}h=h.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var g=u.stateNode,x=Vg(l);ed(l,x,g);break;case 5:var w=u.stateNode;u.flags&32&&(yo(w,""),u.flags&=-33);var C=Vg(l);ed(l,C,w);break;case 3:case 4:var D=u.stateNode.containerInfo,V=Vg(l);Pg(l,V,D);break;default:throw Error(i(161))}}catch(G){dt(l,l.return,G)}l.flags&=-3}a&4096&&(l.flags&=-4097)}function Cv(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var a=l;Cv(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),l=l.sibling}}function Vr(l,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)bv(l,a.alternate,a),a=a.sibling}function Ml(l){for(l=l.child;l!==null;){var a=l;switch(a.tag){case 0:case 11:case 14:case 15:ws(4,a,a.return),Ml(a);break;case 1:ar(a,a.return);var u=a.stateNode;typeof u.componentWillUnmount=="function"&&hv(a,a.return,u),Ml(a);break;case 27:Nc(a.stateNode);case 26:case 5:ar(a,a.return),Ml(a);break;case 22:a.memoizedState===null&&Ml(a);break;case 30:Ml(a);break;default:Ml(a)}l=l.sibling}}function Pr(l,a,u){for(u=u&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var h=a.alternate,g=l,x=a,w=x.flags;switch(x.tag){case 0:case 11:case 15:Pr(g,x,u),vc(4,x);break;case 1:if(Pr(g,x,u),h=x,g=h.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(V){dt(h,h.return,V)}if(h=x,g=h.updateQueue,g!==null){var C=h.stateNode;try{var D=g.shared.hiddenCallbacks;if(D!==null)for(g.shared.hiddenCallbacks=null,g=0;g<D.length;g++)tw(D[g],C)}catch(V){dt(h,h.return,V)}}u&&w&64&&dv(x),kc(x,x.return);break;case 27:gv(x);case 26:case 5:Pr(g,x,u),u&&h===null&&w&4&&pv(x),kc(x,x.return);break;case 12:Pr(g,x,u);break;case 31:Pr(g,x,u),u&&w&4&&wv(g,x);break;case 13:Pr(g,x,u),u&&w&4&&vv(g,x);break;case 22:x.memoizedState===null&&Pr(g,x,u),kc(x,x.return);break;case 30:break;default:Pr(g,x,u)}a=a.sibling}}function Fg(l,a){var u=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),l=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),l!==u&&(l!=null&&l.refCount++,u!=null&&cc(u))}function qg(l,a){l=null,a.alternate!==null&&(l=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==l&&(a.refCount++,l!=null&&cc(l))}function Ji(l,a,u,h){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Ev(l,a,u,h),a=a.sibling}function Ev(l,a,u,h){var g=a.flags;switch(a.tag){case 0:case 11:case 15:Ji(l,a,u,h),g&2048&&vc(9,a);break;case 1:Ji(l,a,u,h);break;case 3:Ji(l,a,u,h),g&2048&&(l=null,a.alternate!==null&&(l=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==l&&(a.refCount++,l!=null&&cc(l)));break;case 12:if(g&2048){Ji(l,a,u,h),l=a.stateNode;try{var x=a.memoizedProps,w=x.id,C=x.onPostCommit;typeof C=="function"&&C(w,a.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(D){dt(a,a.return,D)}}else Ji(l,a,u,h);break;case 31:Ji(l,a,u,h);break;case 13:Ji(l,a,u,h);break;case 23:break;case 22:x=a.stateNode,w=a.alternate,a.memoizedState!==null?x._visibility&2?Ji(l,a,u,h):Cc(l,a):x._visibility&2?Ji(l,a,u,h):(x._visibility|=2,Bo(l,a,u,h,(a.subtreeFlags&10256)!==0||!1)),g&2048&&Fg(w,a);break;case 24:Ji(l,a,u,h),g&2048&&qg(a.alternate,a);break;default:Ji(l,a,u,h)}}function Bo(l,a,u,h,g){for(g=g&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var x=l,w=a,C=u,D=h,V=w.flags;switch(w.tag){case 0:case 11:case 15:Bo(x,w,C,D,g),vc(8,w);break;case 23:break;case 22:var G=w.stateNode;w.memoizedState!==null?G._visibility&2?Bo(x,w,C,D,g):Cc(x,w):(G._visibility|=2,Bo(x,w,C,D,g)),g&&V&2048&&Fg(w.alternate,w);break;case 24:Bo(x,w,C,D,g),g&&V&2048&&qg(w.alternate,w);break;default:Bo(x,w,C,D,g)}a=a.sibling}}function Cc(l,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var u=l,h=a,g=h.flags;switch(h.tag){case 22:Cc(u,h),g&2048&&Fg(h.alternate,h);break;case 24:Cc(u,h),g&2048&&qg(h.alternate,h);break;default:Cc(u,h)}a=a.sibling}}var Ec=8192;function jo(l,a,u){if(l.subtreeFlags&Ec)for(l=l.child;l!==null;)Tv(l,a,u),l=l.sibling}function Tv(l,a,u){switch(l.tag){case 26:jo(l,a,u),l.flags&Ec&&l.memoizedState!==null&&wR(u,Zi,l.memoizedState,l.memoizedProps);break;case 5:jo(l,a,u);break;case 3:case 4:var h=Zi;Zi=md(l.stateNode.containerInfo),jo(l,a,u),Zi=h;break;case 22:l.memoizedState===null&&(h=l.alternate,h!==null&&h.memoizedState!==null?(h=Ec,Ec=16777216,jo(l,a,u),Ec=h):jo(l,a,u));break;default:jo(l,a,u)}}function Av(l){var a=l.alternate;if(a!==null&&(l=a.child,l!==null)){a.child=null;do a=l.sibling,l.sibling=null,l=a;while(l!==null)}}function Tc(l){var a=l.deletions;if((l.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];sn=h,Ov(h,l)}Av(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Mv(l),l=l.sibling}function Mv(l){switch(l.tag){case 0:case 11:case 15:Tc(l),l.flags&2048&&ws(9,l,l.return);break;case 3:Tc(l);break;case 12:Tc(l);break;case 22:var a=l.stateNode;l.memoizedState!==null&&a._visibility&2&&(l.return===null||l.return.tag!==13)?(a._visibility&=-3,nd(l)):Tc(l);break;default:Tc(l)}}function nd(l){var a=l.deletions;if((l.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];sn=h,Ov(h,l)}Av(l)}for(l=l.child;l!==null;){switch(a=l,a.tag){case 0:case 11:case 15:ws(8,a,a.return),nd(a);break;case 22:u=a.stateNode,u._visibility&2&&(u._visibility&=-3,nd(a));break;default:nd(a)}l=l.sibling}}function Ov(l,a){for(;sn!==null;){var u=sn;switch(u.tag){case 0:case 11:case 15:ws(8,u,a);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:cc(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,sn=h;else e:for(u=l;sn!==null;){h=sn;var g=h.sibling,x=h.return;if(xv(h),h===u){sn=null;break e}if(g!==null){g.return=x,sn=g;break e}sn=x}}}var IN={getCacheForType:function(l){var a=yn(Ft),u=a.data.get(l);return u===void 0&&(u=l(),a.data.set(l,u)),u},cacheSignal:function(){return yn(Ft).controller.signal}},BN=typeof WeakMap=="function"?WeakMap:Map,ot=0,St=null,Ze=null,We=0,ft=0,di=null,vs=!1,Uo=!1,Yg=!1,$r=0,Lt=0,ks=0,Ol=0,Kg=0,hi=0,Ho=0,Ac=null,Xn=null,Gg=!1,id=0,_v=0,rd=1/0,sd=null,Cs=null,tn=0,Es=null,Vo=null,Fr=0,Zg=0,Jg=null,Dv=null,Mc=0,Xg=null;function pi(){return(ot&2)!==0&&We!==0?We&-We:I.T!==null?iy():Kx()}function Nv(){if(hi===0)if((We&536870912)===0||tt){var l=hf;hf<<=1,(hf&3932160)===0&&(hf=262144),hi=l}else hi=536870912;return l=ui.current,l!==null&&(l.flags|=32),hi}function Wn(l,a,u){(l===St&&(ft===2||ft===9)||l.cancelPendingCommit!==null)&&(Po(l,0),Ts(l,We,hi,!1)),Za(l,u),((ot&2)===0||l!==St)&&(l===St&&((ot&2)===0&&(Ol|=u),Lt===4&&Ts(l,We,hi,!1)),cr(l))}function Rv(l,a,u){if((ot&6)!==0)throw Error(i(327));var h=!u&&(a&127)===0&&(a&l.expiredLanes)===0||Ga(l,a),g=h?HN(l,a):Qg(l,a,!0),x=h;do{if(g===0){Uo&&!h&&Ts(l,a,0,!1);break}else{if(u=l.current.alternate,x&&!jN(u)){g=Qg(l,a,!1),x=!1;continue}if(g===2){if(x=a,l.errorRecoveryDisabledLanes&x)var w=0;else w=l.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){a=w;e:{var C=l;g=Ac;var D=C.current.memoizedState.isDehydrated;if(D&&(Po(C,w).flags|=256),w=Qg(C,w,!1),w!==2){if(Yg&&!D){C.errorRecoveryDisabledLanes|=x,Ol|=x,g=4;break e}x=Xn,Xn=g,x!==null&&(Xn===null?Xn=x:Xn.push.apply(Xn,x))}g=w}if(x=!1,g!==2)continue}}if(g===1){Po(l,0),Ts(l,a,0,!0);break}e:{switch(h=l,x=g,x){case 0:case 1:throw Error(i(345));case 4:if((a&4194048)!==a)break;case 6:Ts(h,a,hi,!vs);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((a&62914560)===a&&(g=id+300-qe(),10<g)){if(Ts(h,a,hi,!vs),mf(h,0,!0)!==0)break e;Fr=a,h.timeoutHandle=uk(zv.bind(null,h,u,Xn,sd,Gg,a,hi,Ol,Ho,vs,x,"Throttled",-0,0),g);break e}zv(h,u,Xn,sd,Gg,a,hi,Ol,Ho,vs,x,null,-0,0)}}break}while(!0);cr(l)}function zv(l,a,u,h,g,x,w,C,D,V,G,X,$,q){if(l.timeoutHandle=-1,X=a.subtreeFlags,X&8192||(X&16785408)===16785408){X={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Or},Tv(a,x,X);var be=(x&62914560)===x?id-qe():(x&4194048)===x?_v-qe():0;if(be=vR(X,be),be!==null){Fr=x,l.cancelPendingCommit=be(Pv.bind(null,l,a,x,u,h,g,w,C,D,G,X,null,$,q)),Ts(l,x,w,!V);return}}Pv(l,a,x,u,h,g,w,C,D)}function jN(l){for(var a=l;;){var u=a.tag;if((u===0||u===11||u===15)&&a.flags&16384&&(u=a.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var g=u[h],x=g.getSnapshot;g=g.value;try{if(!ai(x(),g))return!1}catch{return!1}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===l)break;for(;a.sibling===null;){if(a.return===null||a.return===l)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ts(l,a,u,h){a&=~Kg,a&=~Ol,l.suspendedLanes|=a,l.pingedLanes&=~a,h&&(l.warmLanes|=a),h=l.expirationTimes;for(var g=a;0<g;){var x=31-xt(g),w=1<<x;h[x]=-1,g&=~w}u!==0&&Fx(l,u,a)}function ld(){return(ot&6)===0?(Oc(0),!1):!0}function Wg(){if(Ze!==null){if(ft===0)var l=Ze.return;else l=Ze,Rr=Sl=null,pg(l),No=null,fc=0,l=Ze;for(;l!==null;)fv(l.alternate,l),l=l.return;Ze=null}}function Po(l,a){var u=l.timeoutHandle;u!==-1&&(l.timeoutHandle=-1,rR(u)),u=l.cancelPendingCommit,u!==null&&(l.cancelPendingCommit=null,u()),Fr=0,Wg(),St=l,Ze=u=Dr(l.current,null),We=a,ft=0,di=null,vs=!1,Uo=Ga(l,a),Yg=!1,Ho=hi=Kg=Ol=ks=Lt=0,Xn=Ac=null,Gg=!1,(a&8)!==0&&(a|=a&32);var h=l.entangledLanes;if(h!==0)for(l=l.entanglements,h&=a;0<h;){var g=31-xt(h),x=1<<g;a|=l[g],h&=~x}return $r=a,Af(),u}function Lv(l,a){Be=null,I.H=xc,a===Do||a===Lf?(a=XS(),ft=3):a===ng?(a=XS(),ft=4):ft=a===_g?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,di=a,Ze===null&&(Lt=1,Zf(l,Ei(a,l.current)))}function Iv(){var l=ui.current;return l===null?!0:(We&4194048)===We?Oi===null:(We&62914560)===We||(We&536870912)!==0?l===Oi:!1}function Bv(){var l=I.H;return I.H=xc,l===null?xc:l}function jv(){var l=I.A;return I.A=IN,l}function od(){Lt=4,vs||(We&4194048)!==We&&ui.current!==null||(Uo=!0),(ks&134217727)===0&&(Ol&134217727)===0||St===null||Ts(St,We,hi,!1)}function Qg(l,a,u){var h=ot;ot|=2;var g=Bv(),x=jv();(St!==l||We!==a)&&(sd=null,Po(l,a)),a=!1;var w=Lt;e:do try{if(ft!==0&&Ze!==null){var C=Ze,D=di;switch(ft){case 8:Wg(),w=6;break e;case 3:case 2:case 9:case 6:ui.current===null&&(a=!0);var V=ft;if(ft=0,di=null,$o(l,C,D,V),u&&Uo){w=0;break e}break;default:V=ft,ft=0,di=null,$o(l,C,D,V)}}UN(),w=Lt;break}catch(G){Lv(l,G)}while(!0);return a&&l.shellSuspendCounter++,Rr=Sl=null,ot=h,I.H=g,I.A=x,Ze===null&&(St=null,We=0,Af()),w}function UN(){for(;Ze!==null;)Uv(Ze)}function HN(l,a){var u=ot;ot|=2;var h=Bv(),g=jv();St!==l||We!==a?(sd=null,rd=qe()+500,Po(l,a)):Uo=Ga(l,a);e:do try{if(ft!==0&&Ze!==null){a=Ze;var x=di;t:switch(ft){case 1:ft=0,di=null,$o(l,a,x,1);break;case 2:case 9:if(ZS(x)){ft=0,di=null,Hv(a);break}a=function(){ft!==2&&ft!==9||St!==l||(ft=7),cr(l)},x.then(a,a);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:ZS(x)?(ft=0,di=null,Hv(a)):(ft=0,di=null,$o(l,a,x,7));break;case 5:var w=null;switch(Ze.tag){case 26:w=Ze.memoizedState;case 5:case 27:var C=Ze;if(w?Ek(w):C.stateNode.complete){ft=0,di=null;var D=C.sibling;if(D!==null)Ze=D;else{var V=C.return;V!==null?(Ze=V,ad(V)):Ze=null}break t}}ft=0,di=null,$o(l,a,x,5);break;case 6:ft=0,di=null,$o(l,a,x,6);break;case 8:Wg(),Lt=6;break e;default:throw Error(i(462))}}VN();break}catch(G){Lv(l,G)}while(!0);return Rr=Sl=null,I.H=h,I.A=g,ot=u,Ze!==null?0:(St=null,We=0,Af(),Lt)}function VN(){for(;Ze!==null&&!Le();)Uv(Ze)}function Uv(l){var a=cv(l.alternate,l,$r);l.memoizedProps=l.pendingProps,a===null?ad(l):Ze=a}function Hv(l){var a=l,u=a.alternate;switch(a.tag){case 15:case 0:a=iv(u,a,a.pendingProps,a.type,void 0,We);break;case 11:a=iv(u,a,a.pendingProps,a.type.render,a.ref,We);break;case 5:pg(a);default:fv(u,a),a=Ze=jS(a,$r),a=cv(u,a,$r)}l.memoizedProps=l.pendingProps,a===null?ad(l):Ze=a}function $o(l,a,u,h){Rr=Sl=null,pg(a),No=null,fc=0;var g=a.return;try{if(ON(l,g,a,u,We)){Lt=1,Zf(l,Ei(u,l.current)),Ze=null;return}}catch(x){if(g!==null)throw Ze=g,x;Lt=1,Zf(l,Ei(u,l.current)),Ze=null;return}a.flags&32768?(tt||h===1?l=!0:Uo||(We&536870912)!==0?l=!1:(vs=l=!0,(h===2||h===9||h===3||h===6)&&(h=ui.current,h!==null&&h.tag===13&&(h.flags|=16384))),Vv(a,l)):ad(a)}function ad(l){var a=l;do{if((a.flags&32768)!==0){Vv(a,vs);return}l=a.return;var u=NN(a.alternate,a,$r);if(u!==null){Ze=u;return}if(a=a.sibling,a!==null){Ze=a;return}Ze=a=l}while(a!==null);Lt===0&&(Lt=5)}function Vv(l,a){do{var u=RN(l.alternate,l);if(u!==null){u.flags&=32767,Ze=u;return}if(u=l.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!a&&(l=l.sibling,l!==null)){Ze=l;return}Ze=l=u}while(l!==null);Lt=6,Ze=null}function Pv(l,a,u,h,g,x,w,C,D){l.cancelPendingCommit=null;do cd();while(tn!==0);if((ot&6)!==0)throw Error(i(327));if(a!==null){if(a===l.current)throw Error(i(177));if(x=a.lanes|a.childLanes,x|=Vm,S2(l,u,x,w,C,D),l===St&&(Ze=St=null,We=0),Vo=a,Es=l,Fr=u,Zg=x,Jg=g,Dv=h,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,qN(we,function(){return Kv(),null})):(l.callbackNode=null,l.callbackPriority=0),h=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||h){h=I.T,I.T=null,g=K.p,K.p=2,w=ot,ot|=4;try{zN(l,a,u)}finally{ot=w,K.p=g,I.T=h}}tn=1,$v(),Fv(),qv()}}function $v(){if(tn===1){tn=0;var l=Es,a=Vo,u=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var h=K.p;K.p=2;var g=ot;ot|=4;try{kv(a,l);var x=fy,w=OS(l.containerInfo),C=x.focusedElem,D=x.selectionRange;if(w!==C&&C&&C.ownerDocument&&MS(C.ownerDocument.documentElement,C)){if(D!==null&&Im(C)){var V=D.start,G=D.end;if(G===void 0&&(G=V),"selectionStart"in C)C.selectionStart=V,C.selectionEnd=Math.min(G,C.value.length);else{var X=C.ownerDocument||document,$=X&&X.defaultView||window;if($.getSelection){var q=$.getSelection(),be=C.textContent.length,Me=Math.min(D.start,be),yt=D.end===void 0?Me:Math.min(D.end,be);!q.extend&&Me>yt&&(w=yt,yt=Me,Me=w);var B=AS(C,Me),R=AS(C,yt);if(B&&R&&(q.rangeCount!==1||q.anchorNode!==B.node||q.anchorOffset!==B.offset||q.focusNode!==R.node||q.focusOffset!==R.offset)){var H=X.createRange();H.setStart(B.node,B.offset),q.removeAllRanges(),Me>yt?(q.addRange(H),q.extend(R.node,R.offset)):(H.setEnd(R.node,R.offset),q.addRange(H))}}}}for(X=[],q=C;q=q.parentNode;)q.nodeType===1&&X.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<X.length;C++){var J=X[C];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}wd=!!uy,fy=uy=null}finally{ot=g,K.p=h,I.T=u}}l.current=a,tn=2}}function Fv(){if(tn===2){tn=0;var l=Es,a=Vo,u=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var h=K.p;K.p=2;var g=ot;ot|=4;try{bv(l,a.alternate,a)}finally{ot=g,K.p=h,I.T=u}}tn=3}}function qv(){if(tn===4||tn===3){tn=0,it();var l=Es,a=Vo,u=Fr,h=Dv;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?tn=5:(tn=0,Vo=Es=null,Yv(l,l.pendingLanes));var g=l.pendingLanes;if(g===0&&(Cs=null),ym(u),a=a.stateNode,en&&typeof en.onCommitFiberRoot=="function")try{en.onCommitFiberRoot(Ln,a,void 0,(a.current.flags&128)===128)}catch{}if(h!==null){a=I.T,g=K.p,K.p=2,I.T=null;try{for(var x=l.onRecoverableError,w=0;w<h.length;w++){var C=h[w];x(C.value,{componentStack:C.stack})}}finally{I.T=a,K.p=g}}(Fr&3)!==0&&cd(),cr(l),g=l.pendingLanes,(u&261930)!==0&&(g&42)!==0?l===Xg?Mc++:(Mc=0,Xg=l):Mc=0,Oc(0)}}function Yv(l,a){(l.pooledCacheLanes&=a)===0&&(a=l.pooledCache,a!=null&&(l.pooledCache=null,cc(a)))}function cd(){return $v(),Fv(),qv(),Kv()}function Kv(){if(tn!==5)return!1;var l=Es,a=Zg;Zg=0;var u=ym(Fr),h=I.T,g=K.p;try{K.p=32>u?32:u,I.T=null,u=Jg,Jg=null;var x=Es,w=Fr;if(tn=0,Vo=Es=null,Fr=0,(ot&6)!==0)throw Error(i(331));var C=ot;if(ot|=4,Mv(x.current),Ev(x,x.current,w,u),ot=C,Oc(0,!1),en&&typeof en.onPostCommitFiberRoot=="function")try{en.onPostCommitFiberRoot(Ln,x)}catch{}return!0}finally{K.p=g,I.T=h,Yv(l,a)}}function Gv(l,a,u){a=Ei(u,a),a=Og(l.stateNode,a,2),l=bs(l,a,2),l!==null&&(Za(l,2),cr(l))}function dt(l,a,u){if(l.tag===3)Gv(l,l,u);else for(;a!==null;){if(a.tag===3){Gv(a,l,u);break}else if(a.tag===1){var h=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Cs===null||!Cs.has(h))){l=Ei(u,l),u=Zw(2),h=bs(a,u,2),h!==null&&(Jw(u,h,a,l),Za(h,2),cr(h));break}}a=a.return}}function ey(l,a,u){var h=l.pingCache;if(h===null){h=l.pingCache=new BN;var g=new Set;h.set(a,g)}else g=h.get(a),g===void 0&&(g=new Set,h.set(a,g));g.has(u)||(Yg=!0,g.add(u),l=PN.bind(null,l,a,u),a.then(l,l))}function PN(l,a,u){var h=l.pingCache;h!==null&&h.delete(a),l.pingedLanes|=l.suspendedLanes&u,l.warmLanes&=~u,St===l&&(We&u)===u&&(Lt===4||Lt===3&&(We&62914560)===We&&300>qe()-id?(ot&2)===0&&Po(l,0):Kg|=u,Ho===We&&(Ho=0)),cr(l)}function Zv(l,a){a===0&&(a=$x()),l=yl(l,a),l!==null&&(Za(l,a),cr(l))}function $N(l){var a=l.memoizedState,u=0;a!==null&&(u=a.retryLane),Zv(l,u)}function FN(l,a){var u=0;switch(l.tag){case 31:case 13:var h=l.stateNode,g=l.memoizedState;g!==null&&(u=g.retryLane);break;case 19:h=l.stateNode;break;case 22:h=l.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(a),Zv(l,u)}function qN(l,a){return li(l,a)}var ud=null,Fo=null,ty=!1,fd=!1,ny=!1,As=0;function cr(l){l!==Fo&&l.next===null&&(Fo===null?ud=Fo=l:Fo=Fo.next=l),fd=!0,ty||(ty=!0,KN())}function Oc(l,a){if(!ny&&fd){ny=!0;do for(var u=!1,h=ud;h!==null;){if(l!==0){var g=h.pendingLanes;if(g===0)var x=0;else{var w=h.suspendedLanes,C=h.pingedLanes;x=(1<<31-xt(42|l)+1)-1,x&=g&~(w&~C),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,Qv(h,x))}else x=We,x=mf(h,h===St?x:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(x&3)===0||Ga(h,x)||(u=!0,Qv(h,x));h=h.next}while(u);ny=!1}}function YN(){Jv()}function Jv(){fd=ty=!1;var l=0;As!==0&&iR()&&(l=As);for(var a=qe(),u=null,h=ud;h!==null;){var g=h.next,x=Xv(h,a);x===0?(h.next=null,u===null?ud=g:u.next=g,g===null&&(Fo=u)):(u=h,(l!==0||(x&3)!==0)&&(fd=!0)),h=g}tn!==0&&tn!==5||Oc(l),As!==0&&(As=0)}function Xv(l,a){for(var u=l.suspendedLanes,h=l.pingedLanes,g=l.expirationTimes,x=l.pendingLanes&-62914561;0<x;){var w=31-xt(x),C=1<<w,D=g[w];D===-1?((C&u)===0||(C&h)!==0)&&(g[w]=x2(C,a)):D<=a&&(l.expiredLanes|=C),x&=~C}if(a=St,u=We,u=mf(l,l===a?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),h=l.callbackNode,u===0||l===a&&(ft===2||ft===9)||l.cancelPendingCommit!==null)return h!==null&&h!==null&&ee(h),l.callbackNode=null,l.callbackPriority=0;if((u&3)===0||Ga(l,u)){if(a=u&-u,a===l.callbackPriority)return a;switch(h!==null&&ee(h),ym(u)){case 2:case 8:u=oe;break;case 32:u=we;break;case 268435456:u=ut;break;default:u=we}return h=Wv.bind(null,l),u=li(u,h),l.callbackPriority=a,l.callbackNode=u,a}return h!==null&&h!==null&&ee(h),l.callbackPriority=2,l.callbackNode=null,2}function Wv(l,a){if(tn!==0&&tn!==5)return l.callbackNode=null,l.callbackPriority=0,null;var u=l.callbackNode;if(cd()&&l.callbackNode!==u)return null;var h=We;return h=mf(l,l===St?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),h===0?null:(Rv(l,h,a),Xv(l,qe()),l.callbackNode!=null&&l.callbackNode===u?Wv.bind(null,l):null)}function Qv(l,a){if(cd())return null;Rv(l,a,!0)}function KN(){sR(function(){(ot&6)!==0?li(Y,YN):Jv()})}function iy(){if(As===0){var l=Oo;l===0&&(l=df,df<<=1,(df&261888)===0&&(df=256)),As=l}return As}function ek(l){return l==null||typeof l=="symbol"||typeof l=="boolean"?null:typeof l=="function"?l:xf(""+l)}function tk(l,a){var u=a.ownerDocument.createElement("input");return u.name=a.name,u.value=a.value,l.id&&u.setAttribute("form",l.id),a.parentNode.insertBefore(u,a),l=new FormData(l),u.parentNode.removeChild(u),l}function GN(l,a,u,h,g){if(a==="submit"&&u&&u.stateNode===g){var x=ek((g[Yn]||null).action),w=h.submitter;w&&(a=(a=w[Yn]||null)?ek(a.formAction):w.getAttribute("formAction"),a!==null&&(x=a,w=null));var C=new kf("action","action",null,h,g);l.push({event:C,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(As!==0){var D=w?tk(g,w):new FormData(g);kg(u,{pending:!0,data:D,method:g.method,action:x},null,D)}}else typeof x=="function"&&(C.preventDefault(),D=w?tk(g,w):new FormData(g),kg(u,{pending:!0,data:D,method:g.method,action:x},x,D))},currentTarget:g}]})}}for(var ry=0;ry<Hm.length;ry++){var sy=Hm[ry],ZN=sy.toLowerCase(),JN=sy[0].toUpperCase()+sy.slice(1);Gi(ZN,"on"+JN)}Gi(NS,"onAnimationEnd"),Gi(RS,"onAnimationIteration"),Gi(zS,"onAnimationStart"),Gi("dblclick","onDoubleClick"),Gi("focusin","onFocus"),Gi("focusout","onBlur"),Gi(dN,"onTransitionRun"),Gi(hN,"onTransitionStart"),Gi(pN,"onTransitionCancel"),Gi(LS,"onTransitionEnd"),mo("onMouseEnter",["mouseout","mouseover"]),mo("onMouseLeave",["mouseout","mouseover"]),mo("onPointerEnter",["pointerout","pointerover"]),mo("onPointerLeave",["pointerout","pointerover"]),hl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),hl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),hl("onBeforeInput",["compositionend","keypress","textInput","paste"]),hl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),hl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),hl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _c="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),XN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_c));function nk(l,a){a=(a&4)!==0;for(var u=0;u<l.length;u++){var h=l[u],g=h.event;h=h.listeners;e:{var x=void 0;if(a)for(var w=h.length-1;0<=w;w--){var C=h[w],D=C.instance,V=C.currentTarget;if(C=C.listener,D!==x&&g.isPropagationStopped())break e;x=C,g.currentTarget=V;try{x(g)}catch(G){Tf(G)}g.currentTarget=null,x=D}else for(w=0;w<h.length;w++){if(C=h[w],D=C.instance,V=C.currentTarget,C=C.listener,D!==x&&g.isPropagationStopped())break e;x=C,g.currentTarget=V;try{x(g)}catch(G){Tf(G)}g.currentTarget=null,x=D}}}}function Je(l,a){var u=a[bm];u===void 0&&(u=a[bm]=new Set);var h=l+"__bubble";u.has(h)||(ik(a,l,2,!1),u.add(h))}function ly(l,a,u){var h=0;a&&(h|=4),ik(u,l,h,a)}var dd="_reactListening"+Math.random().toString(36).slice(2);function oy(l){if(!l[dd]){l[dd]=!0,Jx.forEach(function(u){u!=="selectionchange"&&(XN.has(u)||ly(u,!1,l),ly(u,!0,l))});var a=l.nodeType===9?l:l.ownerDocument;a===null||a[dd]||(a[dd]=!0,ly("selectionchange",!1,a))}}function ik(l,a,u,h){switch(Nk(a)){case 2:var g=ER;break;case 8:g=TR;break;default:g=vy}u=g.bind(null,a,u,l),g=void 0,!Am||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(g=!0),h?g!==void 0?l.addEventListener(a,u,{capture:!0,passive:g}):l.addEventListener(a,u,!0):g!==void 0?l.addEventListener(a,u,{passive:g}):l.addEventListener(a,u,!1)}function ay(l,a,u,h,g){var x=h;if((a&1)===0&&(a&2)===0&&h!==null)e:for(;;){if(h===null)return;var w=h.tag;if(w===3||w===4){var C=h.stateNode.containerInfo;if(C===g)break;if(w===4)for(w=h.return;w!==null;){var D=w.tag;if((D===3||D===4)&&w.stateNode.containerInfo===g)return;w=w.return}for(;C!==null;){if(w=fo(C),w===null)return;if(D=w.tag,D===5||D===6||D===26||D===27){h=x=w;continue e}C=C.parentNode}}h=h.return}aS(function(){var V=x,G=Em(u),X=[];e:{var $=IS.get(l);if($!==void 0){var q=kf,be=l;switch(l){case"keypress":if(wf(u)===0)break e;case"keydown":case"keyup":q=F2;break;case"focusin":be="focus",q=Dm;break;case"focusout":be="blur",q=Dm;break;case"beforeblur":case"afterblur":q=Dm;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=fS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=N2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=K2;break;case NS:case RS:case zS:q=L2;break;case LS:q=Z2;break;case"scroll":case"scrollend":q=_2;break;case"wheel":q=X2;break;case"copy":case"cut":case"paste":q=B2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=hS;break;case"toggle":case"beforetoggle":q=Q2}var Me=(a&4)!==0,yt=!Me&&(l==="scroll"||l==="scrollend"),B=Me?$!==null?$+"Capture":null:$;Me=[];for(var R=V,H;R!==null;){var J=R;if(H=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||H===null||B===null||(J=Wa(R,B),J!=null&&Me.push(Dc(R,J,H))),yt)break;R=R.return}0<Me.length&&($=new q($,be,null,u,G),X.push({event:$,listeners:Me}))}}if((a&7)===0){e:{if($=l==="mouseover"||l==="pointerover",q=l==="mouseout"||l==="pointerout",$&&u!==Cm&&(be=u.relatedTarget||u.fromElement)&&(fo(be)||be[uo]))break e;if((q||$)&&($=G.window===G?G:($=G.ownerDocument)?$.defaultView||$.parentWindow:window,q?(be=u.relatedTarget||u.toElement,q=V,be=be?fo(be):null,be!==null&&(yt=s(be),Me=be.tag,be!==yt||Me!==5&&Me!==27&&Me!==6)&&(be=null)):(q=null,be=V),q!==be)){if(Me=fS,J="onMouseLeave",B="onMouseEnter",R="mouse",(l==="pointerout"||l==="pointerover")&&(Me=hS,J="onPointerLeave",B="onPointerEnter",R="pointer"),yt=q==null?$:Xa(q),H=be==null?$:Xa(be),$=new Me(J,R+"leave",q,u,G),$.target=yt,$.relatedTarget=H,J=null,fo(G)===V&&(Me=new Me(B,R+"enter",be,u,G),Me.target=H,Me.relatedTarget=yt,J=Me),yt=J,q&&be)t:{for(Me=WN,B=q,R=be,H=0,J=B;J;J=Me(J))H++;J=0;for(var Te=R;Te;Te=Me(Te))J++;for(;0<H-J;)B=Me(B),H--;for(;0<J-H;)R=Me(R),J--;for(;H--;){if(B===R||R!==null&&B===R.alternate){Me=B;break t}B=Me(B),R=Me(R)}Me=null}else Me=null;q!==null&&rk(X,$,q,Me,!1),be!==null&&yt!==null&&rk(X,yt,be,Me,!0)}}e:{if($=V?Xa(V):window,q=$.nodeName&&$.nodeName.toLowerCase(),q==="select"||q==="input"&&$.type==="file")var rt=wS;else if(xS($))if(vS)rt=cN;else{rt=oN;var ve=lN}else q=$.nodeName,!q||q.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?V&&km(V.elementType)&&(rt=wS):rt=aN;if(rt&&(rt=rt(l,V))){SS(X,rt,u,G);break e}ve&&ve(l,$,V),l==="focusout"&&V&&$.type==="number"&&V.memoizedProps.value!=null&&vm($,"number",$.value)}switch(ve=V?Xa(V):window,l){case"focusin":(xS(ve)||ve.contentEditable==="true")&&(wo=ve,Bm=V,lc=null);break;case"focusout":lc=Bm=wo=null;break;case"mousedown":jm=!0;break;case"contextmenu":case"mouseup":case"dragend":jm=!1,_S(X,u,G);break;case"selectionchange":if(fN)break;case"keydown":case"keyup":_S(X,u,G)}var He;if(Rm)e:{switch(l){case"compositionstart":var Qe="onCompositionStart";break e;case"compositionend":Qe="onCompositionEnd";break e;case"compositionupdate":Qe="onCompositionUpdate";break e}Qe=void 0}else So?yS(l,u)&&(Qe="onCompositionEnd"):l==="keydown"&&u.keyCode===229&&(Qe="onCompositionStart");Qe&&(pS&&u.locale!=="ko"&&(So||Qe!=="onCompositionStart"?Qe==="onCompositionEnd"&&So&&(He=cS()):(fs=G,Mm="value"in fs?fs.value:fs.textContent,So=!0)),ve=hd(V,Qe),0<ve.length&&(Qe=new dS(Qe,l,null,u,G),X.push({event:Qe,listeners:ve}),He?Qe.data=He:(He=bS(u),He!==null&&(Qe.data=He)))),(He=tN?nN(l,u):iN(l,u))&&(Qe=hd(V,"onBeforeInput"),0<Qe.length&&(ve=new dS("onBeforeInput","beforeinput",null,u,G),X.push({event:ve,listeners:Qe}),ve.data=He)),GN(X,l,V,u,G)}nk(X,a)})}function Dc(l,a,u){return{instance:l,listener:a,currentTarget:u}}function hd(l,a){for(var u=a+"Capture",h=[];l!==null;){var g=l,x=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||x===null||(g=Wa(l,u),g!=null&&h.unshift(Dc(l,g,x)),g=Wa(l,a),g!=null&&h.push(Dc(l,g,x))),l.tag===3)return h;l=l.return}return[]}function WN(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5&&l.tag!==27);return l||null}function rk(l,a,u,h,g){for(var x=a._reactName,w=[];u!==null&&u!==h;){var C=u,D=C.alternate,V=C.stateNode;if(C=C.tag,D!==null&&D===h)break;C!==5&&C!==26&&C!==27||V===null||(D=V,g?(V=Wa(u,x),V!=null&&w.unshift(Dc(u,V,D))):g||(V=Wa(u,x),V!=null&&w.push(Dc(u,V,D)))),u=u.return}w.length!==0&&l.push({event:a,listeners:w})}var QN=/\r\n?/g,eR=/\u0000|\uFFFD/g;function sk(l){return(typeof l=="string"?l:""+l).replace(QN,`
|
|
49
|
-
`).replace(eR,"")}function lk(l,a){return a=sk(a),sk(l)===a}function gt(l,a,u,h,g,x){switch(u){case"children":typeof h=="string"?a==="body"||a==="textarea"&&h===""||yo(l,h):(typeof h=="number"||typeof h=="bigint")&&a!=="body"&&yo(l,""+h);break;case"className":yf(l,"class",h);break;case"tabIndex":yf(l,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":yf(l,u,h);break;case"style":lS(l,h,x);break;case"data":if(a!=="object"){yf(l,"data",h);break}case"src":case"href":if(h===""&&(a!=="a"||u!=="href")){l.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){l.removeAttribute(u);break}h=xf(""+h),l.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){l.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(u==="formAction"?(a!=="input"&>(l,a,"name",g.name,g,null),gt(l,a,"formEncType",g.formEncType,g,null),gt(l,a,"formMethod",g.formMethod,g,null),gt(l,a,"formTarget",g.formTarget,g,null)):(gt(l,a,"encType",g.encType,g,null),gt(l,a,"method",g.method,g,null),gt(l,a,"target",g.target,g,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){l.removeAttribute(u);break}h=xf(""+h),l.setAttribute(u,h);break;case"onClick":h!=null&&(l.onclick=Or);break;case"onScroll":h!=null&&Je("scroll",l);break;case"onScrollEnd":h!=null&&Je("scrollend",l);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(g.children!=null)throw Error(i(60));l.innerHTML=u}}break;case"multiple":l.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":l.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){l.removeAttribute("xlink:href");break}u=xf(""+h),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?l.setAttribute(u,""+h):l.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?l.setAttribute(u,""):l.removeAttribute(u);break;case"capture":case"download":h===!0?l.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?l.setAttribute(u,h):l.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?l.setAttribute(u,h):l.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?l.removeAttribute(u):l.setAttribute(u,h);break;case"popover":Je("beforetoggle",l),Je("toggle",l),gf(l,"popover",h);break;case"xlinkActuate":Mr(l,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Mr(l,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Mr(l,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Mr(l,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Mr(l,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Mr(l,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Mr(l,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Mr(l,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Mr(l,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":gf(l,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=M2.get(u)||u,gf(l,u,h))}}function cy(l,a,u,h,g,x){switch(u){case"style":lS(l,h,x);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(g.children!=null)throw Error(i(60));l.innerHTML=u}}break;case"children":typeof h=="string"?yo(l,h):(typeof h=="number"||typeof h=="bigint")&&yo(l,""+h);break;case"onScroll":h!=null&&Je("scroll",l);break;case"onScrollEnd":h!=null&&Je("scrollend",l);break;case"onClick":h!=null&&(l.onclick=Or);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xx.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(g=u.endsWith("Capture"),a=u.slice(2,g?u.length-7:void 0),x=l[Yn]||null,x=x!=null?x[u]:null,typeof x=="function"&&l.removeEventListener(a,x,g),typeof h=="function")){typeof x!="function"&&x!==null&&(u in l?l[u]=null:l.hasAttribute(u)&&l.removeAttribute(u)),l.addEventListener(a,h,g);break e}u in l?l[u]=h:h===!0?l.setAttribute(u,""):gf(l,u,h)}}}function xn(l,a,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",l),Je("load",l);var h=!1,g=!1,x;for(x in u)if(u.hasOwnProperty(x)){var w=u[x];if(w!=null)switch(x){case"src":h=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:gt(l,a,x,w,u,null)}}g&>(l,a,"srcSet",u.srcSet,u,null),h&>(l,a,"src",u.src,u,null);return;case"input":Je("invalid",l);var C=x=w=g=null,D=null,V=null;for(h in u)if(u.hasOwnProperty(h)){var G=u[h];if(G!=null)switch(h){case"name":g=G;break;case"type":w=G;break;case"checked":D=G;break;case"defaultChecked":V=G;break;case"value":x=G;break;case"defaultValue":C=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,a));break;default:gt(l,a,h,G,u,null)}}nS(l,x,C,D,V,w,g,!1);return;case"select":Je("invalid",l),h=w=x=null;for(g in u)if(u.hasOwnProperty(g)&&(C=u[g],C!=null))switch(g){case"value":x=C;break;case"defaultValue":w=C;break;case"multiple":h=C;default:gt(l,a,g,C,u,null)}a=x,u=w,l.multiple=!!h,a!=null?go(l,!!h,a,!1):u!=null&&go(l,!!h,u,!0);return;case"textarea":Je("invalid",l),x=g=h=null;for(w in u)if(u.hasOwnProperty(w)&&(C=u[w],C!=null))switch(w){case"value":h=C;break;case"defaultValue":g=C;break;case"children":x=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(i(91));break;default:gt(l,a,w,C,u,null)}rS(l,h,g,x);return;case"option":for(D in u)if(u.hasOwnProperty(D)&&(h=u[D],h!=null))switch(D){case"selected":l.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:gt(l,a,D,h,u,null)}return;case"dialog":Je("beforetoggle",l),Je("toggle",l),Je("cancel",l),Je("close",l);break;case"iframe":case"object":Je("load",l);break;case"video":case"audio":for(h=0;h<_c.length;h++)Je(_c[h],l);break;case"image":Je("error",l),Je("load",l);break;case"details":Je("toggle",l);break;case"embed":case"source":case"link":Je("error",l),Je("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in u)if(u.hasOwnProperty(V)&&(h=u[V],h!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:gt(l,a,V,h,u,null)}return;default:if(km(a)){for(G in u)u.hasOwnProperty(G)&&(h=u[G],h!==void 0&&cy(l,a,G,h,u,void 0));return}}for(C in u)u.hasOwnProperty(C)&&(h=u[C],h!=null&>(l,a,C,h,u,null))}function tR(l,a,u,h){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,x=null,w=null,C=null,D=null,V=null,G=null;for(q in u){var X=u[q];if(u.hasOwnProperty(q)&&X!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":D=X;default:h.hasOwnProperty(q)||gt(l,a,q,null,h,X)}}for(var $ in h){var q=h[$];if(X=u[$],h.hasOwnProperty($)&&(q!=null||X!=null))switch($){case"type":x=q;break;case"name":g=q;break;case"checked":V=q;break;case"defaultChecked":G=q;break;case"value":w=q;break;case"defaultValue":C=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(137,a));break;default:q!==X&>(l,a,$,q,h,X)}}wm(l,w,C,D,V,G,x,g);return;case"select":q=w=C=$=null;for(x in u)if(D=u[x],u.hasOwnProperty(x)&&D!=null)switch(x){case"value":break;case"multiple":q=D;default:h.hasOwnProperty(x)||gt(l,a,x,null,h,D)}for(g in h)if(x=h[g],D=u[g],h.hasOwnProperty(g)&&(x!=null||D!=null))switch(g){case"value":$=x;break;case"defaultValue":C=x;break;case"multiple":w=x;default:x!==D&>(l,a,g,x,h,D)}a=C,u=w,h=q,$!=null?go(l,!!u,$,!1):!!h!=!!u&&(a!=null?go(l,!!u,a,!0):go(l,!!u,u?[]:"",!1));return;case"textarea":q=$=null;for(C in u)if(g=u[C],u.hasOwnProperty(C)&&g!=null&&!h.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:gt(l,a,C,null,h,g)}for(w in h)if(g=h[w],x=u[w],h.hasOwnProperty(w)&&(g!=null||x!=null))switch(w){case"value":$=g;break;case"defaultValue":q=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(i(91));break;default:g!==x&>(l,a,w,g,h,x)}iS(l,$,q);return;case"option":for(var be in u)if($=u[be],u.hasOwnProperty(be)&&$!=null&&!h.hasOwnProperty(be))switch(be){case"selected":l.selected=!1;break;default:gt(l,a,be,null,h,$)}for(D in h)if($=h[D],q=u[D],h.hasOwnProperty(D)&&$!==q&&($!=null||q!=null))switch(D){case"selected":l.selected=$&&typeof $!="function"&&typeof $!="symbol";break;default:gt(l,a,D,$,h,q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in u)$=u[Me],u.hasOwnProperty(Me)&&$!=null&&!h.hasOwnProperty(Me)&>(l,a,Me,null,h,$);for(V in h)if($=h[V],q=u[V],h.hasOwnProperty(V)&&$!==q&&($!=null||q!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(i(137,a));break;default:gt(l,a,V,$,h,q)}return;default:if(km(a)){for(var yt in u)$=u[yt],u.hasOwnProperty(yt)&&$!==void 0&&!h.hasOwnProperty(yt)&&cy(l,a,yt,void 0,h,$);for(G in h)$=h[G],q=u[G],!h.hasOwnProperty(G)||$===q||$===void 0&&q===void 0||cy(l,a,G,$,h,q);return}}for(var B in u)$=u[B],u.hasOwnProperty(B)&&$!=null&&!h.hasOwnProperty(B)&>(l,a,B,null,h,$);for(X in h)$=h[X],q=u[X],!h.hasOwnProperty(X)||$===q||$==null&&q==null||gt(l,a,X,$,h,q)}function ok(l){switch(l){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function nR(){if(typeof performance.getEntriesByType=="function"){for(var l=0,a=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var g=u[h],x=g.transferSize,w=g.initiatorType,C=g.duration;if(x&&C&&ok(w)){for(w=0,C=g.responseEnd,h+=1;h<u.length;h++){var D=u[h],V=D.startTime;if(V>C)break;var G=D.transferSize,X=D.initiatorType;G&&ok(X)&&(D=D.responseEnd,w+=G*(D<C?1:(C-V)/(D-V)))}if(--h,a+=8*(x+w)/(g.duration/1e3),l++,10<l)break}}if(0<l)return a/l/1e6}return navigator.connection&&(l=navigator.connection.downlink,typeof l=="number")?l:5}var uy=null,fy=null;function pd(l){return l.nodeType===9?l:l.ownerDocument}function ak(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ck(l,a){if(l===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&a==="foreignObject"?0:l}function dy(l,a){return l==="textarea"||l==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var hy=null;function iR(){var l=window.event;return l&&l.type==="popstate"?l===hy?!1:(hy=l,!0):(hy=null,!1)}var uk=typeof setTimeout=="function"?setTimeout:void 0,rR=typeof clearTimeout=="function"?clearTimeout:void 0,fk=typeof Promise=="function"?Promise:void 0,sR=typeof queueMicrotask=="function"?queueMicrotask:typeof fk<"u"?function(l){return fk.resolve(null).then(l).catch(lR)}:uk;function lR(l){setTimeout(function(){throw l})}function Ms(l){return l==="head"}function dk(l,a){var u=a,h=0;do{var g=u.nextSibling;if(l.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"||u==="/&"){if(h===0){l.removeChild(g),Go(a);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Nc(l.ownerDocument.documentElement);else if(u==="head"){u=l.ownerDocument.head,Nc(u);for(var x=u.firstChild;x;){var w=x.nextSibling,C=x.nodeName;x[Ja]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=w}}else u==="body"&&Nc(l.ownerDocument.body);u=g}while(u);Go(a)}function hk(l,a){var u=l;l=0;do{var h=u.nextSibling;if(u.nodeType===1?a?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(a?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(l===0)break;l--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||l++;u=h}while(u)}function py(l){var a=l.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var u=a;switch(a=a.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":py(u),xm(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}l.removeChild(u)}}function oR(l,a,u,h){for(;l.nodeType===1;){var g=u;if(l.nodeName.toLowerCase()!==a.toLowerCase()){if(!h&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(h){if(!l[Ja])switch(a){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(x=l.getAttribute("rel"),x==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(x!==g.rel||l.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||l.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||l.getAttribute("title")!==(g.title==null?null:g.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(x=l.getAttribute("src"),(x!==(g.src==null?null:g.src)||l.getAttribute("type")!==(g.type==null?null:g.type)||l.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&x&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(a==="input"&&l.type==="hidden"){var x=g.name==null?null:""+g.name;if(g.type==="hidden"&&l.getAttribute("name")===x)return l}else return l;if(l=_i(l.nextSibling),l===null)break}return null}function aR(l,a,u){if(a==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!u||(l=_i(l.nextSibling),l===null))return null;return l}function pk(l,a){for(;l.nodeType!==8;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!a||(l=_i(l.nextSibling),l===null))return null;return l}function my(l){return l.data==="$?"||l.data==="$~"}function gy(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState!=="loading"}function cR(l,a){var u=l.ownerDocument;if(l.data==="$~")l._reactRetry=a;else if(l.data!=="$?"||u.readyState!=="loading")a();else{var h=function(){a(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),l._reactRetry=h}}function _i(l){for(;l!=null;l=l.nextSibling){var a=l.nodeType;if(a===1||a===3)break;if(a===8){if(a=l.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return l}var yy=null;function mk(l){l=l.nextSibling;for(var a=0;l;){if(l.nodeType===8){var u=l.data;if(u==="/$"||u==="/&"){if(a===0)return _i(l.nextSibling);a--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||a++}l=l.nextSibling}return null}function gk(l){l=l.previousSibling;for(var a=0;l;){if(l.nodeType===8){var u=l.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(a===0)return l;a--}else u!=="/$"&&u!=="/&"||a++}l=l.previousSibling}return null}function yk(l,a,u){switch(a=pd(u),l){case"html":if(l=a.documentElement,!l)throw Error(i(452));return l;case"head":if(l=a.head,!l)throw Error(i(453));return l;case"body":if(l=a.body,!l)throw Error(i(454));return l;default:throw Error(i(451))}}function Nc(l){for(var a=l.attributes;a.length;)l.removeAttributeNode(a[0]);xm(l)}var Di=new Map,bk=new Set;function md(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var qr=K.d;K.d={f:uR,r:fR,D:dR,C:hR,L:pR,m:mR,X:yR,S:gR,M:bR};function uR(){var l=qr.f(),a=ld();return l||a}function fR(l){var a=ho(l);a!==null&&a.tag===5&&a.type==="form"?Lw(a):qr.r(l)}var qo=typeof document>"u"?null:document;function xk(l,a,u){var h=qo;if(h&&typeof a=="string"&&a){var g=ki(a);g='link[rel="'+l+'"][href="'+g+'"]',typeof u=="string"&&(g+='[crossorigin="'+u+'"]'),bk.has(g)||(bk.add(g),l={rel:l,crossOrigin:u,href:a},h.querySelector(g)===null&&(a=h.createElement("link"),xn(a,"link",l),rn(a),h.head.appendChild(a)))}}function dR(l){qr.D(l),xk("dns-prefetch",l,null)}function hR(l,a){qr.C(l,a),xk("preconnect",l,a)}function pR(l,a,u){qr.L(l,a,u);var h=qo;if(h&&l&&a){var g='link[rel="preload"][as="'+ki(a)+'"]';a==="image"&&u&&u.imageSrcSet?(g+='[imagesrcset="'+ki(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(g+='[imagesizes="'+ki(u.imageSizes)+'"]')):g+='[href="'+ki(l)+'"]';var x=g;switch(a){case"style":x=Yo(l);break;case"script":x=Ko(l)}Di.has(x)||(l=m({rel:"preload",href:a==="image"&&u&&u.imageSrcSet?void 0:l,as:a},u),Di.set(x,l),h.querySelector(g)!==null||a==="style"&&h.querySelector(Rc(x))||a==="script"&&h.querySelector(zc(x))||(a=h.createElement("link"),xn(a,"link",l),rn(a),h.head.appendChild(a)))}}function mR(l,a){qr.m(l,a);var u=qo;if(u&&l){var h=a&&typeof a.as=="string"?a.as:"script",g='link[rel="modulepreload"][as="'+ki(h)+'"][href="'+ki(l)+'"]',x=g;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ko(l)}if(!Di.has(x)&&(l=m({rel:"modulepreload",href:l},a),Di.set(x,l),u.querySelector(g)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(zc(x)))return}h=u.createElement("link"),xn(h,"link",l),rn(h),u.head.appendChild(h)}}}function gR(l,a,u){qr.S(l,a,u);var h=qo;if(h&&l){var g=po(h).hoistableStyles,x=Yo(l);a=a||"default";var w=g.get(x);if(!w){var C={loading:0,preload:null};if(w=h.querySelector(Rc(x)))C.loading=5;else{l=m({rel:"stylesheet",href:l,"data-precedence":a},u),(u=Di.get(x))&&by(l,u);var D=w=h.createElement("link");rn(D),xn(D,"link",l),D._p=new Promise(function(V,G){D.onload=V,D.onerror=G}),D.addEventListener("load",function(){C.loading|=1}),D.addEventListener("error",function(){C.loading|=2}),C.loading|=4,gd(w,a,h)}w={type:"stylesheet",instance:w,count:1,state:C},g.set(x,w)}}}function yR(l,a){qr.X(l,a);var u=qo;if(u&&l){var h=po(u).hoistableScripts,g=Ko(l),x=h.get(g);x||(x=u.querySelector(zc(g)),x||(l=m({src:l,async:!0},a),(a=Di.get(g))&&xy(l,a),x=u.createElement("script"),rn(x),xn(x,"link",l),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(g,x))}}function bR(l,a){qr.M(l,a);var u=qo;if(u&&l){var h=po(u).hoistableScripts,g=Ko(l),x=h.get(g);x||(x=u.querySelector(zc(g)),x||(l=m({src:l,async:!0,type:"module"},a),(a=Di.get(g))&&xy(l,a),x=u.createElement("script"),rn(x),xn(x,"link",l),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(g,x))}}function Sk(l,a,u,h){var g=(g=ge.current)?md(g):null;if(!g)throw Error(i(446));switch(l){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(a=Yo(u.href),u=po(g).hoistableStyles,h=u.get(a),h||(h={type:"style",instance:null,count:0,state:null},u.set(a,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){l=Yo(u.href);var x=po(g).hoistableStyles,w=x.get(l);if(w||(g=g.ownerDocument||g,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(l,w),(x=g.querySelector(Rc(l)))&&!x._p&&(w.instance=x,w.state.loading=5),Di.has(l)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Di.set(l,u),x||xR(g,l,u,w.state))),a&&h===null)throw Error(i(528,""));return w}if(a&&h!==null)throw Error(i(529,""));return null;case"script":return a=u.async,u=u.src,typeof u=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Ko(u),u=po(g).hoistableScripts,h=u.get(a),h||(h={type:"script",instance:null,count:0,state:null},u.set(a,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,l))}}function Yo(l){return'href="'+ki(l)+'"'}function Rc(l){return'link[rel="stylesheet"]['+l+"]"}function wk(l){return m({},l,{"data-precedence":l.precedence,precedence:null})}function xR(l,a,u,h){l.querySelector('link[rel="preload"][as="style"]['+a+"]")?h.loading=1:(a=l.createElement("link"),h.preload=a,a.addEventListener("load",function(){return h.loading|=1}),a.addEventListener("error",function(){return h.loading|=2}),xn(a,"link",u),rn(a),l.head.appendChild(a))}function Ko(l){return'[src="'+ki(l)+'"]'}function zc(l){return"script[async]"+l}function vk(l,a,u){if(a.count++,a.instance===null)switch(a.type){case"style":var h=l.querySelector('style[data-href~="'+ki(u.href)+'"]');if(h)return a.instance=h,rn(h),h;var g=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(l.ownerDocument||l).createElement("style"),rn(h),xn(h,"style",g),gd(h,u.precedence,l),a.instance=h;case"stylesheet":g=Yo(u.href);var x=l.querySelector(Rc(g));if(x)return a.state.loading|=4,a.instance=x,rn(x),x;h=wk(u),(g=Di.get(g))&&by(h,g),x=(l.ownerDocument||l).createElement("link"),rn(x);var w=x;return w._p=new Promise(function(C,D){w.onload=C,w.onerror=D}),xn(x,"link",h),a.state.loading|=4,gd(x,u.precedence,l),a.instance=x;case"script":return x=Ko(u.src),(g=l.querySelector(zc(x)))?(a.instance=g,rn(g),g):(h=u,(g=Di.get(x))&&(h=m({},u),xy(h,g)),l=l.ownerDocument||l,g=l.createElement("script"),rn(g),xn(g,"link",h),l.head.appendChild(g),a.instance=g);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(h=a.instance,a.state.loading|=4,gd(h,u.precedence,l));return a.instance}function gd(l,a,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=h.length?h[h.length-1]:null,x=g,w=0;w<h.length;w++){var C=h[w];if(C.dataset.precedence===a)x=C;else if(x!==g)break}x?x.parentNode.insertBefore(l,x.nextSibling):(a=u.nodeType===9?u.head:u,a.insertBefore(l,a.firstChild))}function by(l,a){l.crossOrigin==null&&(l.crossOrigin=a.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=a.referrerPolicy),l.title==null&&(l.title=a.title)}function xy(l,a){l.crossOrigin==null&&(l.crossOrigin=a.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=a.referrerPolicy),l.integrity==null&&(l.integrity=a.integrity)}var yd=null;function kk(l,a,u){if(yd===null){var h=new Map,g=yd=new Map;g.set(u,h)}else g=yd,h=g.get(u),h||(h=new Map,g.set(u,h));if(h.has(l))return h;for(h.set(l,null),u=u.getElementsByTagName(l),g=0;g<u.length;g++){var x=u[g];if(!(x[Ja]||x[mn]||l==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var w=x.getAttribute(a)||"";w=l+w;var C=h.get(w);C?C.push(x):h.set(w,[x])}}return h}function Ck(l,a,u){l=l.ownerDocument||l,l.head.insertBefore(u,a==="title"?l.querySelector("head > title"):null)}function SR(l,a,u){if(u===1||a.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return l=a.disabled,typeof a.precedence=="string"&&l==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Ek(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function wR(l,a,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var g=Yo(h.href),x=a.querySelector(Rc(g));if(x){a=x._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(l.count++,l=bd.bind(l),a.then(l,l)),u.state.loading|=4,u.instance=x,rn(x);return}x=a.ownerDocument||a,h=wk(h),(g=Di.get(g))&&by(h,g),x=x.createElement("link"),rn(x);var w=x;w._p=new Promise(function(C,D){w.onload=C,w.onerror=D}),xn(x,"link",h),u.instance=x}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(u,a),(a=u.state.preload)&&(u.state.loading&3)===0&&(l.count++,u=bd.bind(l),a.addEventListener("load",u),a.addEventListener("error",u))}}var Sy=0;function vR(l,a){return l.stylesheets&&l.count===0&&Sd(l,l.stylesheets),0<l.count||0<l.imgCount?function(u){var h=setTimeout(function(){if(l.stylesheets&&Sd(l,l.stylesheets),l.unsuspend){var x=l.unsuspend;l.unsuspend=null,x()}},6e4+a);0<l.imgBytes&&Sy===0&&(Sy=62500*nR());var g=setTimeout(function(){if(l.waitingForImages=!1,l.count===0&&(l.stylesheets&&Sd(l,l.stylesheets),l.unsuspend)){var x=l.unsuspend;l.unsuspend=null,x()}},(l.imgBytes>Sy?50:800)+a);return l.unsuspend=u,function(){l.unsuspend=null,clearTimeout(h),clearTimeout(g)}}:null}function bd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Sd(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var xd=null;function Sd(l,a){l.stylesheets=null,l.unsuspend!==null&&(l.count++,xd=new Map,a.forEach(kR,l),xd=null,bd.call(l))}function kR(l,a){if(!(a.state.loading&4)){var u=xd.get(l);if(u)var h=u.get(null);else{u=new Map,xd.set(l,u);for(var g=l.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<g.length;x++){var w=g[x];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(u.set(w.dataset.precedence,w),h=w)}h&&u.set(null,h)}g=a.instance,w=g.getAttribute("data-precedence"),x=u.get(w)||h,x===h&&u.set(null,g),u.set(w,g),this.count++,h=bd.bind(this),g.addEventListener("load",h),g.addEventListener("error",h),x?x.parentNode.insertBefore(g,x.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(g,l.firstChild)),a.state.loading|=4}}var Lc={$$typeof:L,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function CR(l,a,u,h,g,x,w,C,D){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=mm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mm(0),this.hiddenUpdates=mm(null),this.identifierPrefix=h,this.onUncaughtError=g,this.onCaughtError=x,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Tk(l,a,u,h,g,x,w,C,D,V,G,X){return l=new CR(l,a,u,w,D,V,G,X,C),a=1,x===!0&&(a|=24),x=ci(3,null,null,a),l.current=x,x.stateNode=l,a=Qm(),a.refCount++,l.pooledCache=a,a.refCount++,x.memoizedState={element:h,isDehydrated:u,cache:a},ig(x),l}function Ak(l){return l?(l=Co,l):Co}function Mk(l,a,u,h,g,x){g=Ak(g),h.context===null?h.context=g:h.pendingContext=g,h=ys(a),h.payload={element:u},x=x===void 0?null:x,x!==null&&(h.callback=x),u=bs(l,h,a),u!==null&&(Wn(u,l,a),hc(u,l,a))}function Ok(l,a){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var u=l.retryLane;l.retryLane=u!==0&&u<a?u:a}}function wy(l,a){Ok(l,a),(l=l.alternate)&&Ok(l,a)}function _k(l){if(l.tag===13||l.tag===31){var a=yl(l,67108864);a!==null&&Wn(a,l,67108864),wy(l,67108864)}}function Dk(l){if(l.tag===13||l.tag===31){var a=pi();a=gm(a);var u=yl(l,a);u!==null&&Wn(u,l,a),wy(l,a)}}var wd=!0;function ER(l,a,u,h){var g=I.T;I.T=null;var x=K.p;try{K.p=2,vy(l,a,u,h)}finally{K.p=x,I.T=g}}function TR(l,a,u,h){var g=I.T;I.T=null;var x=K.p;try{K.p=8,vy(l,a,u,h)}finally{K.p=x,I.T=g}}function vy(l,a,u,h){if(wd){var g=ky(h);if(g===null)ay(l,a,h,vd,u),Rk(l,h);else if(MR(g,l,a,u,h))h.stopPropagation();else if(Rk(l,h),a&4&&-1<AR.indexOf(l)){for(;g!==null;){var x=ho(g);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var w=dl(x.pendingLanes);if(w!==0){var C=x;for(C.pendingLanes|=2,C.entangledLanes|=2;w;){var D=1<<31-xt(w);C.entanglements[1]|=D,w&=~D}cr(x),(ot&6)===0&&(rd=qe()+500,Oc(0))}}break;case 31:case 13:C=yl(x,2),C!==null&&Wn(C,x,2),ld(),wy(x,2)}if(x=ky(h),x===null&&ay(l,a,h,vd,u),x===g)break;g=x}g!==null&&h.stopPropagation()}else ay(l,a,h,null,u)}}function ky(l){return l=Em(l),Cy(l)}var vd=null;function Cy(l){if(vd=null,l=fo(l),l!==null){var a=s(l);if(a===null)l=null;else{var u=a.tag;if(u===13){if(l=o(a),l!==null)return l;l=null}else if(u===31){if(l=c(a),l!==null)return l;l=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;l=null}else a!==l&&(l=null)}}return vd=l,null}function Nk(l){switch(l){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(pt()){case Y:return 2;case oe:return 8;case we:case Ue:return 32;case ut:return 268435456;default:return 32}default:return 32}}var Ey=!1,Os=null,_s=null,Ds=null,Ic=new Map,Bc=new Map,Ns=[],AR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Rk(l,a){switch(l){case"focusin":case"focusout":Os=null;break;case"dragenter":case"dragleave":_s=null;break;case"mouseover":case"mouseout":Ds=null;break;case"pointerover":case"pointerout":Ic.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bc.delete(a.pointerId)}}function jc(l,a,u,h,g,x){return l===null||l.nativeEvent!==x?(l={blockedOn:a,domEventName:u,eventSystemFlags:h,nativeEvent:x,targetContainers:[g]},a!==null&&(a=ho(a),a!==null&&_k(a)),l):(l.eventSystemFlags|=h,a=l.targetContainers,g!==null&&a.indexOf(g)===-1&&a.push(g),l)}function MR(l,a,u,h,g){switch(a){case"focusin":return Os=jc(Os,l,a,u,h,g),!0;case"dragenter":return _s=jc(_s,l,a,u,h,g),!0;case"mouseover":return Ds=jc(Ds,l,a,u,h,g),!0;case"pointerover":var x=g.pointerId;return Ic.set(x,jc(Ic.get(x)||null,l,a,u,h,g)),!0;case"gotpointercapture":return x=g.pointerId,Bc.set(x,jc(Bc.get(x)||null,l,a,u,h,g)),!0}return!1}function zk(l){var a=fo(l.target);if(a!==null){var u=s(a);if(u!==null){if(a=u.tag,a===13){if(a=o(u),a!==null){l.blockedOn=a,Gx(l.priority,function(){Dk(u)});return}}else if(a===31){if(a=c(u),a!==null){l.blockedOn=a,Gx(l.priority,function(){Dk(u)});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){l.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}l.blockedOn=null}function kd(l){if(l.blockedOn!==null)return!1;for(var a=l.targetContainers;0<a.length;){var u=ky(l.nativeEvent);if(u===null){u=l.nativeEvent;var h=new u.constructor(u.type,u);Cm=h,u.target.dispatchEvent(h),Cm=null}else return a=ho(u),a!==null&&_k(a),l.blockedOn=u,!1;a.shift()}return!0}function Lk(l,a,u){kd(l)&&u.delete(a)}function OR(){Ey=!1,Os!==null&&kd(Os)&&(Os=null),_s!==null&&kd(_s)&&(_s=null),Ds!==null&&kd(Ds)&&(Ds=null),Ic.forEach(Lk),Bc.forEach(Lk)}function Cd(l,a){l.blockedOn===a&&(l.blockedOn=null,Ey||(Ey=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,OR)))}var Ed=null;function Ik(l){Ed!==l&&(Ed=l,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ed===l&&(Ed=null);for(var a=0;a<l.length;a+=3){var u=l[a],h=l[a+1],g=l[a+2];if(typeof h!="function"){if(Cy(h||u)===null)continue;break}var x=ho(u);x!==null&&(l.splice(a,3),a-=3,kg(x,{pending:!0,data:g,method:u.method,action:h},h,g))}}))}function Go(l){function a(D){return Cd(D,l)}Os!==null&&Cd(Os,l),_s!==null&&Cd(_s,l),Ds!==null&&Cd(Ds,l),Ic.forEach(a),Bc.forEach(a);for(var u=0;u<Ns.length;u++){var h=Ns[u];h.blockedOn===l&&(h.blockedOn=null)}for(;0<Ns.length&&(u=Ns[0],u.blockedOn===null);)zk(u),u.blockedOn===null&&Ns.shift();if(u=(l.ownerDocument||l).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var g=u[h],x=u[h+1],w=g[Yn]||null;if(typeof x=="function")w||Ik(u);else if(w){var C=null;if(x&&x.hasAttribute("formAction")){if(g=x,w=x[Yn]||null)C=w.formAction;else if(Cy(g)!==null)continue}else C=w.action;typeof C=="function"?u[h+1]=C:(u.splice(h,3),h-=3),Ik(u)}}}function Bk(){function l(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(w){return g=w})},focusReset:"manual",scroll:"manual"})}function a(){g!==null&&(g(),g=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,g=null;return navigation.addEventListener("navigate",l),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",l),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),g!==null&&(g(),g=null)}}}function Ty(l){this._internalRoot=l}Td.prototype.render=Ty.prototype.render=function(l){var a=this._internalRoot;if(a===null)throw Error(i(409));var u=a.current,h=pi();Mk(u,h,l,a,null,null)},Td.prototype.unmount=Ty.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var a=l.containerInfo;Mk(l.current,2,null,l,null,null),ld(),a[uo]=null}};function Td(l){this._internalRoot=l}Td.prototype.unstable_scheduleHydration=function(l){if(l){var a=Kx();l={blockedOn:null,target:l,priority:a};for(var u=0;u<Ns.length&&a!==0&&a<Ns[u].priority;u++);Ns.splice(u,0,l),u===0&&zk(l)}};var jk=e.version;if(jk!=="19.2.4")throw Error(i(527,jk,"19.2.4"));K.findDOMNode=function(l){var a=l._reactInternals;if(a===void 0)throw typeof l.render=="function"?Error(i(188)):(l=Object.keys(l).join(","),Error(i(268,l)));return l=d(a),l=l!==null?p(l):null,l=l===null?null:l.stateNode,l};var _R={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ad=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ad.isDisabled&&Ad.supportsFiber)try{Ln=Ad.inject(_R),en=Ad}catch{}}return Hc.createRoot=function(l,a){if(!r(l))throw Error(i(299));var u=!1,h="",g=qw,x=Yw,w=Kw;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError)),a=Tk(l,1,!1,null,null,u,h,null,g,x,w,Bk),l[uo]=a.current,oy(l),new Ty(a)},Hc.hydrateRoot=function(l,a,u){if(!r(l))throw Error(i(299));var h=!1,g="",x=qw,w=Yw,C=Kw,D=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(w=u.onCaughtError),u.onRecoverableError!==void 0&&(C=u.onRecoverableError),u.formState!==void 0&&(D=u.formState)),a=Tk(l,1,!0,a,u??null,h,g,D,x,w,C,Bk),a.context=Ak(null),u=a.current,h=pi(),h=gm(h),g=ys(h),g.callback=null,bs(u,g,h),u=h,a.current.lanes=u,Za(a,u),cr(a),l[uo]=a.current,oy(l),new Td(a)},Hc.version="19.2.4",Hc}var Gk;function VR(){if(Gk)return Oy.exports;Gk=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Oy.exports=HR(),Oy.exports}var PR=VR();class $R extends on.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("[Tandem] React error boundary caught:",e,n.componentStack)}render(){var e;return this.state.hasError?A.jsxs("div",{style:{padding:"2rem",fontFamily:"system-ui, sans-serif"},children:[A.jsx("h2",{children:"Something went wrong"}),A.jsx("p",{style:{color:"#666"},children:"The editor encountered an unexpected error. Reload the page to continue."}),A.jsx("pre",{style:{background:"#f5f5f5",padding:"1rem",borderRadius:"4px",fontSize:"12px",overflow:"auto",maxHeight:"200px"},children:(e=this.state.error)==null?void 0:e.message}),A.jsx("button",{onClick:()=>window.location.reload(),style:{marginTop:"1rem",padding:"8px 16px",cursor:"pointer",border:"1px solid #d1d5db",borderRadius:"4px",background:"#fff"},children:"Reload"})]}):this.props.children}}const Zk=3478,c1=3479,FR=3e3,qR=3e3,YR=3e4,KR=5,bu={yellow:"rgba(255, 235, 59, 0.3)",red:"rgba(244, 67, 54, 0.3)",green:"rgba(76, 175, 80, 0.3)",blue:"rgba(33, 150, 243, 0.3)",purple:"rgba(156, 39, 176, 0.3)"},GR="all",Jk="tandem:interruptionMode",u1="#6366f1",ZR="__tandem_ctrl__",oa="annotations",NA="awareness",RA="userAwareness",Xk="chat",th="documentMeta",Wk="savedAtVersion",f1="tandem:recentFiles",JR=20,V0="tandem:userName",P0="You",Qk={error:8e3,warning:6e3,info:4e3},XR=5,zA="tandem:tutorialCompleted",WR="tutorial-";function Sn(t){this.content=t}Sn.prototype={constructor:Sn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var i=n&&n!=t?this.remove(n):this,r=i.find(t),s=i.content.slice();return r==-1?s.push(n||t,e):(s[r+1]=e,n&&(s[r]=n)),new Sn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Sn(n)},addToStart:function(t,e){return new Sn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Sn(n)},addBefore:function(t,e,n){var i=this.remove(e),r=i.content.slice(),s=i.find(t);return r.splice(s==-1?r.length:s,0,e,n),new Sn(r)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Sn.from(t),t.size?new Sn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Sn.from(t),t.size?new Sn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Sn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Sn.from=function(t){if(t instanceof Sn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Sn(e)};function LA(t,e,n){for(let i=0;;i++){if(i==t.childCount||i==e.childCount)return t.childCount==e.childCount?null:n;let r=t.child(i),s=e.child(i);if(r==s){n+=r.nodeSize;continue}if(!r.sameMarkup(s))return n;if(r.isText&&r.text!=s.text){for(let o=0;r.text[o]==s.text[o];o++)n++;return n}if(r.content.size||s.content.size){let o=LA(r.content,s.content,n+1);if(o!=null)return o}n+=r.nodeSize}}function IA(t,e,n,i){for(let r=t.childCount,s=e.childCount;;){if(r==0||s==0)return r==s?null:{a:n,b:i};let o=t.child(--r),c=e.child(--s),f=o.nodeSize;if(o==c){n-=f,i-=f;continue}if(!o.sameMarkup(c))return{a:n,b:i};if(o.isText&&o.text!=c.text){let d=0,p=Math.min(o.text.length,c.text.length);for(;d<p&&o.text[o.text.length-d-1]==c.text[c.text.length-d-1];)d++,n--,i--;return{a:n,b:i}}if(o.content.size||c.content.size){let d=IA(o.content,c.content,n-1,i-1);if(d)return d}n-=f,i-=f}}class W{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let i=0;i<e.length;i++)this.size+=e[i].nodeSize}nodesBetween(e,n,i,r=0,s){for(let o=0,c=0;c<n;o++){let f=this.content[o],d=c+f.nodeSize;if(d>e&&i(f,r+c,s||null,o)!==!1&&f.content.size){let p=c+1;f.nodesBetween(Math.max(0,e-p),Math.min(f.content.size,n-p),i,r+p)}c=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,i,r){let s="",o=!0;return this.nodesBetween(e,n,(c,f)=>{let d=c.isText?c.text.slice(Math.max(e,f)-f,n-f):c.isLeaf?r?typeof r=="function"?r(c):r:c.type.spec.leafText?c.type.spec.leafText(c):"":"";c.isBlock&&(c.isLeaf&&d||c.isTextblock)&&i&&(o?o=!1:s+=i),s+=d},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,i=e.firstChild,r=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(r[r.length-1]=n.withText(n.text+i.text),s=1);s<e.content.length;s++)r.push(e.content[s]);return new W(r,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let i=[],r=0;if(n>e)for(let s=0,o=0;o<n;s++){let c=this.content[s],f=o+c.nodeSize;f>e&&((o<e||f>n)&&(c.isText?c=c.cut(Math.max(0,e-o),Math.min(c.text.length,n-o)):c=c.cut(Math.max(0,e-o-1),Math.min(c.content.size,n-o-1))),i.push(c),r+=c.nodeSize),o=f}return new W(i,r)}cutByIndex(e,n){return e==n?W.empty:e==0&&n==this.content.length?this:new W(this.content.slice(e,n))}replaceChild(e,n){let i=this.content[e];if(i==n)return this;let r=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return r[e]=n,new W(r,s)}addToStart(e){return new W([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new W(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,i=0;n<this.content.length;n++){let r=this.content[n];e(r,i,n),i+=r.nodeSize}}findDiffStart(e,n=0){return LA(this,e,n)}findDiffEnd(e,n=this.size,i=e.size){return IA(this,e,n,i)}findIndex(e){if(e==0)return Od(0,e);if(e==this.size)return Od(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let r=this.child(n),s=i+r.nodeSize;if(s>=e)return s==e?Od(n+1,s):Od(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return W.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new W(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return W.empty;let n,i=0;for(let r=0;r<e.length;r++){let s=e[r];i+=s.nodeSize,r&&s.isText&&e[r-1].sameMarkup(s)?(n||(n=e.slice(0,r)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new W(n||e,i)}static from(e){if(!e)return W.empty;if(e instanceof W)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new W([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}W.empty=new W([],0);const Ry={index:0,offset:0};function Od(t,e){return Ry.index=t,Ry.offset=e,Ry}function bh(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!bh(t[i],e[i]))return!1}else{for(let i in t)if(!(i in e)||!bh(t[i],e[i]))return!1;for(let i in e)if(!(i in t))return!1}return!0}let vt=class $0{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,i=!1;for(let r=0;r<e.length;r++){let s=e[r];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,r));else{if(s.type.excludes(this.type))return e;!i&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,r)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=e.slice()),i||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&bh(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let i=e.marks[n.type];if(!i)throw new RangeError(`There is no mark type ${n.type} in this schema`);let r=i.create(n.attrs);return i.checkAttrs(r.attrs),r}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].eq(n[i]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return $0.none;if(e instanceof $0)return[e];let n=e.slice();return n.sort((i,r)=>i.type.rank-r.type.rank),n}};vt.none=[];class xh extends Error{}class de{constructor(e,n,i){this.content=e,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let i=jA(this.content,e+this.openStart,n);return i&&new de(i,this.openStart,this.openEnd)}removeBetween(e,n){return new de(BA(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return de.empty;let i=n.openStart||0,r=n.openEnd||0;if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new de(W.fromJSON(e,n.content),i,r)}static maxOpen(e,n=!0){let i=0,r=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)r++;return new de(e,i,r)}}de.empty=new de(W.empty,0,0);function BA(t,e,n){let{index:i,offset:r}=t.findIndex(e),s=t.maybeChild(i),{index:o,offset:c}=t.findIndex(n);if(r==e||s.isText){if(c!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(i!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(i,s.copy(BA(s.content,e-r-1,n-r-1)))}function jA(t,e,n,i){let{index:r,offset:s}=t.findIndex(e),o=t.maybeChild(r);if(s==e||o.isText)return i&&!i.canReplace(r,r,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=jA(o.content,e-s-1,n,o);return c&&t.replaceChild(r,o.copy(c))}function QR(t,e,n){if(n.openStart>t.depth)throw new xh("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new xh("Inconsistent open depths");return UA(t,e,n,0)}function UA(t,e,n,i){let r=t.index(i),s=t.node(i);if(r==e.index(i)&&i<t.depth-n.openStart){let o=UA(t,e,n,i+1);return s.copy(s.content.replaceChild(r,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==i&&e.depth==i){let o=t.parent,c=o.content;return Vl(o,c.cut(0,t.parentOffset).append(n.content).append(c.cut(e.parentOffset)))}else{let{start:o,end:c}=ez(n,t);return Vl(s,VA(t,o,c,e,i))}else return Vl(s,Sh(t,e,i))}function HA(t,e){if(!e.type.compatibleContent(t.type))throw new xh("Cannot join "+e.type.name+" onto "+t.type.name)}function F0(t,e,n){let i=t.node(n);return HA(i,e.node(n)),i}function Hl(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Wc(t,e,n,i){let r=(e||t).node(n),s=0,o=e?e.index(n):r.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Hl(t.nodeAfter,i),s++));for(let c=s;c<o;c++)Hl(r.child(c),i);e&&e.depth==n&&e.textOffset&&Hl(e.nodeBefore,i)}function Vl(t,e){return t.type.checkContent(e),t.copy(e)}function VA(t,e,n,i,r){let s=t.depth>r&&F0(t,e,r+1),o=i.depth>r&&F0(n,i,r+1),c=[];return Wc(null,t,r,c),s&&o&&e.index(r)==n.index(r)?(HA(s,o),Hl(Vl(s,VA(t,e,n,i,r+1)),c)):(s&&Hl(Vl(s,Sh(t,e,r+1)),c),Wc(e,n,r,c),o&&Hl(Vl(o,Sh(n,i,r+1)),c)),Wc(i,null,r,c),new W(c)}function Sh(t,e,n){let i=[];if(Wc(null,t,n,i),t.depth>n){let r=F0(t,e,n+1);Hl(Vl(r,Sh(t,e,n+1)),i)}return Wc(e,null,n,i),new W(i)}function ez(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)r=e.node(s).copy(W.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class xu{constructor(e,n,i){this.pos=e,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let i=this.pos-this.path[this.path.length-1],r=e.child(n);return i?e.child(n).cut(i):r}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let i=this.path[n*3],r=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)r+=i.child(s).nodeSize;return r}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return vt.none;if(this.textOffset)return e.child(n).marks;let i=e.maybeChild(n-1),r=e.maybeChild(n);if(!i){let c=i;i=r,r=c}let s=i.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!r||!s[o].isInSet(r.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let i=n.marks,r=e.parent.maybeChild(e.index());for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!r||!i[s].isInSet(r.marks))&&(i=i[s--].removeFromSet(i));return i}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!n||n(this.node(i))))return new wh(this,e,i);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let i=[],r=0,s=n;for(let o=e;;){let{index:c,offset:f}=o.content.findIndex(s),d=s-f;if(i.push(o,c,r+f),!d||(o=o.child(c),o.isText))break;s=d-1,r+=f+1}return new xu(n,i,s)}static resolveCached(e,n){let i=eC.get(e);if(i)for(let s=0;s<i.elts.length;s++){let o=i.elts[s];if(o.pos==n)return o}else eC.set(e,i=new tz);let r=i.elts[i.i]=xu.resolve(e,n);return i.i=(i.i+1)%nz,r}}class tz{constructor(){this.elts=[],this.i=0}}const nz=12,eC=new WeakMap;class wh{constructor(e,n,i){this.$from=e,this.$to=n,this.depth=i}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const iz=Object.create(null);let Js=class q0{constructor(e,n,i,r=vt.none){this.type=e,this.attrs=n,this.marks=r,this.content=i||W.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,i,r=0){this.content.nodesBetween(e,n,i,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,i,r){return this.content.textBetween(e,n,i,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,i){return this.type==e&&bh(this.attrs,n||e.defaultAttrs||iz)&&vt.sameSet(this.marks,i||vt.none)}copy(e=null){return e==this.content?this:new q0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new q0(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,i=!1){if(e==n)return de.empty;let r=this.resolve(e),s=this.resolve(n),o=i?0:r.sharedDepth(n),c=r.start(o),d=r.node(o).content.cut(r.pos-c,s.pos-c);return new de(d,r.depth-o,s.depth-o)}replace(e,n,i){return QR(this.resolve(e),this.resolve(n),i)}nodeAt(e){for(let n=this;;){let{index:i,offset:r}=n.content.findIndex(e);if(n=n.maybeChild(i),!n)return null;if(r==e||n.isText)return n;e-=r+1}}childAfter(e){let{index:n,offset:i}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:i}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:i}=this.content.findIndex(e);if(i<e)return{node:this.content.child(n),index:n,offset:i};let r=this.content.child(n-1);return{node:r,index:n-1,offset:i-r.nodeSize}}resolve(e){return xu.resolveCached(this,e)}resolveNoCache(e){return xu.resolve(this,e)}rangeHasMark(e,n,i){let r=!1;return n>e&&this.nodesBetween(e,n,s=>(i.isInSet(s.marks)&&(r=!0),!r)),r}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),PA(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,i=W.empty,r=0,s=i.childCount){let o=this.contentMatchAt(e).matchFragment(i,r,s),c=o&&o.matchFragment(this.content,n);if(!c||!c.validEnd)return!1;for(let f=r;f<s;f++)if(!this.type.allowsMarks(i.child(f).marks))return!1;return!0}canReplaceWith(e,n,i,r){if(r&&!this.type.allowsMarks(r))return!1;let s=this.contentMatchAt(e).matchType(i),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=vt.none;for(let n=0;n<this.marks.length;n++){let i=this.marks[n];i.type.checkAttrs(i.attrs),e=i.addToSet(e)}if(!vt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,i)}let r=W.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,r,i);return s.type.checkAttrs(s.attrs),s}};Js.prototype.text=void 0;class vh extends Js{constructor(e,n,i,r){if(super(e,n,null,r),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):PA(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new vh(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vh(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function PA(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Gl{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let i=new rz(e,n);if(i.next==null)return Gl.empty;let r=$A(i);i.next&&i.err("Unexpected trailing text");let s=fz(uz(r));return dz(s,i),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,i=e.childCount){let r=this;for(let s=n;r&&s<i;s++)r=r.matchType(e.child(s).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let i=0;i<e.next.length;i++)if(this.next[n].type==e.next[i].type)return!0;return!1}fillBefore(e,n=!1,i=0){let r=[this];function s(o,c){let f=o.matchFragment(e,i);if(f&&(!n||f.validEnd))return W.from(c.map(d=>d.createAndFill()));for(let d=0;d<o.next.length;d++){let{type:p,next:m}=o.next[d];if(!(p.isText||p.hasRequiredAttrs())&&r.indexOf(m)==-1){r.push(m);let y=s(m,c.concat(p));if(y)return y}}return null}return s(this,[])}findWrapping(e){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==e)return this.wrapCache[i+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let r=i.shift(),s=r.match;if(s.matchType(e)){let o=[];for(let c=r;c.type;c=c.via)o.push(c.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:c,next:f}=s.next[o];!c.isLeaf&&!c.hasRequiredAttrs()&&!(c.name in n)&&(!r.type||f.validEnd)&&(i.push({match:c.contentMatch,type:c,via:r}),n[c.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(i){e.push(i);for(let r=0;r<i.next.length;r++)e.indexOf(i.next[r].next)==-1&&n(i.next[r].next)}return n(this),e.map((i,r)=>{let s=r+(i.validEnd?"*":" ")+" ";for(let o=0;o<i.next.length;o++)s+=(o?", ":"")+i.next[o].type.name+"->"+e.indexOf(i.next[o].next);return s}).join(`
|
|
48
|
+
`+h.stack}}var Yi=Object.prototype.hasOwnProperty,li=t.unstable_scheduleCallback,ee=t.unstable_cancelCallback,Le=t.unstable_shouldYield,it=t.unstable_requestPaint,qe=t.unstable_now,ft=t.unstable_getCurrentPriorityLevel,Y=t.unstable_ImmediatePriority,oe=t.unstable_UserBlockingPriority,Se=t.unstable_NormalPriority,Ue=t.unstable_LowPriority,ut=t.unstable_IdlePriority,oi=t.log,Ar=t.unstable_setDisableYieldValue,Ln=null,en=null;function qn(l){if(typeof oi=="function"&&Ar(l),en&&typeof en.setStrictMode=="function")try{en.setStrictMode(Ln,l)}catch{}}var xt=Math.clz32?Math.clz32:b2,cs=Math.log,Ki=Math.LN2;function b2(l){return l>>>=0,l===0?32:31-(cs(l)/Ki|0)|0}var df=256,hf=262144,pf=4194304;function dl(l){var a=l&42;if(a!==0)return a;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function mf(l,a,u){var h=l.pendingLanes;if(h===0)return 0;var g=0,x=l.suspendedLanes,w=l.pingedLanes;l=l.warmLanes;var C=h&134217727;return C!==0?(h=C&~x,h!==0?g=dl(h):(w&=C,w!==0?g=dl(w):u||(u=C&~l,u!==0&&(g=dl(u))))):(C=h&~x,C!==0?g=dl(C):w!==0?g=dl(w):u||(u=h&~l,u!==0&&(g=dl(u)))),g===0?0:a!==0&&a!==g&&(a&x)===0&&(x=g&-g,u=a&-a,x>=u||x===32&&(u&4194048)!==0)?a:g}function Ga(l,a){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&a)===0}function x2(l,a){switch(l){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 $x(){var l=pf;return pf<<=1,(pf&62914560)===0&&(pf=4194304),l}function mm(l){for(var a=[],u=0;31>u;u++)a.push(l);return a}function Za(l,a){l.pendingLanes|=a,a!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function S2(l,a,u,h,g,x){var w=l.pendingLanes;l.pendingLanes=u,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=u,l.entangledLanes&=u,l.errorRecoveryDisabledLanes&=u,l.shellSuspendCounter=0;var C=l.entanglements,D=l.expirationTimes,V=l.hiddenUpdates;for(u=w&~u;0<u;){var G=31-xt(u),X=1<<G;C[G]=0,D[G]=-1;var $=V[G];if($!==null)for(V[G]=null,G=0;G<$.length;G++){var q=$[G];q!==null&&(q.lane&=-536870913)}u&=~X}h!==0&&Fx(l,h,0),x!==0&&g===0&&l.tag!==0&&(l.suspendedLanes|=x&~(w&~a))}function Fx(l,a,u){l.pendingLanes|=a,l.suspendedLanes&=~a;var h=31-xt(a);l.entangledLanes|=a,l.entanglements[h]=l.entanglements[h]|1073741824|u&261930}function qx(l,a){var u=l.entangledLanes|=a;for(l=l.entanglements;u;){var h=31-xt(u),g=1<<h;g&a|l[h]&a&&(l[h]|=a),u&=~g}}function Yx(l,a){var u=a&-a;return u=(u&42)!==0?1:gm(u),(u&(l.suspendedLanes|a))!==0?0:u}function gm(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function ym(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function Kx(){var l=K.p;return l!==0?l:(l=window.event,l===void 0?32:Nk(l.type))}function Gx(l,a){var u=K.p;try{return K.p=l,a()}finally{K.p=u}}var us=Math.random().toString(36).slice(2),mn="__reactFiber$"+us,Yn="__reactProps$"+us,uo="__reactContainer$"+us,bm="__reactEvents$"+us,w2="__reactListeners$"+us,v2="__reactHandles$"+us,Zx="__reactResources$"+us,Ja="__reactMarker$"+us;function xm(l){delete l[mn],delete l[Yn],delete l[bm],delete l[w2],delete l[v2]}function fo(l){var a=l[mn];if(a)return a;for(var u=l.parentNode;u;){if(a=u[uo]||u[mn]){if(u=a.alternate,a.child!==null||u!==null&&u.child!==null)for(l=gk(l);l!==null;){if(u=l[mn])return u;l=gk(l)}return a}l=u,u=l.parentNode}return null}function ho(l){if(l=l[mn]||l[uo]){var a=l.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return l}return null}function Xa(l){var a=l.tag;if(a===5||a===26||a===27||a===6)return l.stateNode;throw Error(i(33))}function po(l){var a=l[Zx];return a||(a=l[Zx]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function rn(l){l[Ja]=!0}var Jx=new Set,Xx={};function hl(l,a){mo(l,a),mo(l+"Capture",a)}function mo(l,a){for(Xx[l]=a,l=0;l<a.length;l++)Jx.add(a[l])}var k2=RegExp("^[: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]*$"),Wx={},Qx={};function C2(l){return Yi.call(Qx,l)?!0:Yi.call(Wx,l)?!1:k2.test(l)?Qx[l]=!0:(Wx[l]=!0,!1)}function gf(l,a,u){if(C2(a))if(u===null)l.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":l.removeAttribute(a);return;case"boolean":var h=a.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){l.removeAttribute(a);return}}l.setAttribute(a,""+u)}}function yf(l,a,u){if(u===null)l.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(a);return}l.setAttribute(a,""+u)}}function Mr(l,a,u,h){if(h===null)l.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(u);return}l.setAttributeNS(a,u,""+h)}}function vi(l){switch(typeof l){case"bigint":case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function eS(l){var a=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function E2(l,a,u){var h=Object.getOwnPropertyDescriptor(l.constructor.prototype,a);if(!l.hasOwnProperty(a)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var g=h.get,x=h.set;return Object.defineProperty(l,a,{configurable:!0,get:function(){return g.call(this)},set:function(w){u=""+w,x.call(this,w)}}),Object.defineProperty(l,a,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(w){u=""+w},stopTracking:function(){l._valueTracker=null,delete l[a]}}}}function Sm(l){if(!l._valueTracker){var a=eS(l)?"checked":"value";l._valueTracker=E2(l,a,""+l[a])}}function tS(l){if(!l)return!1;var a=l._valueTracker;if(!a)return!0;var u=a.getValue(),h="";return l&&(h=eS(l)?l.checked?"true":"false":l.value),l=h,l!==u?(a.setValue(l),!0):!1}function bf(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var T2=/[\n"\\]/g;function ki(l){return l.replace(T2,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function wm(l,a,u,h,g,x,w,C){l.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?l.type=w:l.removeAttribute("type"),a!=null?w==="number"?(a===0&&l.value===""||l.value!=a)&&(l.value=""+vi(a)):l.value!==""+vi(a)&&(l.value=""+vi(a)):w!=="submit"&&w!=="reset"||l.removeAttribute("value"),a!=null?vm(l,w,vi(a)):u!=null?vm(l,w,vi(u)):h!=null&&l.removeAttribute("value"),g==null&&x!=null&&(l.defaultChecked=!!x),g!=null&&(l.checked=g&&typeof g!="function"&&typeof g!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?l.name=""+vi(C):l.removeAttribute("name")}function nS(l,a,u,h,g,x,w,C){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(l.type=x),a!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||a!=null)){Sm(l);return}u=u!=null?""+vi(u):"",a=a!=null?""+vi(a):u,C||a===l.value||(l.value=a),l.defaultValue=a}h=h??g,h=typeof h!="function"&&typeof h!="symbol"&&!!h,l.checked=C?l.checked:!!h,l.defaultChecked=!!h,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(l.name=w),Sm(l)}function vm(l,a,u){a==="number"&&bf(l.ownerDocument)===l||l.defaultValue===""+u||(l.defaultValue=""+u)}function go(l,a,u,h){if(l=l.options,a){a={};for(var g=0;g<u.length;g++)a["$"+u[g]]=!0;for(u=0;u<l.length;u++)g=a.hasOwnProperty("$"+l[u].value),l[u].selected!==g&&(l[u].selected=g),g&&h&&(l[u].defaultSelected=!0)}else{for(u=""+vi(u),a=null,g=0;g<l.length;g++){if(l[g].value===u){l[g].selected=!0,h&&(l[g].defaultSelected=!0);return}a!==null||l[g].disabled||(a=l[g])}a!==null&&(a.selected=!0)}}function iS(l,a,u){if(a!=null&&(a=""+vi(a),a!==l.value&&(l.value=a),u==null)){l.defaultValue!==a&&(l.defaultValue=a);return}l.defaultValue=u!=null?""+vi(u):""}function rS(l,a,u,h){if(a==null){if(h!=null){if(u!=null)throw Error(i(92));if(Z(h)){if(1<h.length)throw Error(i(93));h=h[0]}u=h}u==null&&(u=""),a=u}u=vi(a),l.defaultValue=u,h=l.textContent,h===u&&h!==""&&h!==null&&(l.value=h),Sm(l)}function yo(l,a){if(a){var u=l.firstChild;if(u&&u===l.lastChild&&u.nodeType===3){u.nodeValue=a;return}}l.textContent=a}var A2=new Set("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(" "));function sS(l,a,u){var h=a.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?l.setProperty(a,""):a==="float"?l.cssFloat="":l[a]="":h?l.setProperty(a,u):typeof u!="number"||u===0||A2.has(a)?a==="float"?l.cssFloat=u:l[a]=(""+u).trim():l[a]=u+"px"}function lS(l,a,u){if(a!=null&&typeof a!="object")throw Error(i(62));if(l=l.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||a!=null&&a.hasOwnProperty(h)||(h.indexOf("--")===0?l.setProperty(h,""):h==="float"?l.cssFloat="":l[h]="");for(var g in a)h=a[g],a.hasOwnProperty(g)&&u[g]!==h&&sS(l,g,h)}else for(var x in a)a.hasOwnProperty(x)&&sS(l,x,a[x])}function km(l){if(l.indexOf("-")===-1)return!1;switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var M2=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),O2=/^[\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;function xf(l){return O2.test(""+l)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":l}function Or(){}var Cm=null;function Em(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var bo=null,xo=null;function oS(l){var a=ho(l);if(a&&(l=a.stateNode)){var u=l[Yn]||null;e:switch(l=a.stateNode,a.type){case"input":if(wm(l,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),a=u.name,u.type==="radio"&&a!=null){for(u=l;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+ki(""+a)+'"][type="radio"]'),a=0;a<u.length;a++){var h=u[a];if(h!==l&&h.form===l.form){var g=h[Yn]||null;if(!g)throw Error(i(90));wm(h,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(a=0;a<u.length;a++)h=u[a],h.form===l.form&&tS(h)}break e;case"textarea":iS(l,u.value,u.defaultValue);break e;case"select":a=u.value,a!=null&&go(l,!!u.multiple,a,!1)}}}var Tm=!1;function aS(l,a,u){if(Tm)return l(a,u);Tm=!0;try{var h=l(a);return h}finally{if(Tm=!1,(bo!==null||xo!==null)&&(ld(),bo&&(a=bo,l=xo,xo=bo=null,oS(a),l)))for(a=0;a<l.length;a++)oS(l[a])}}function Wa(l,a){var u=l.stateNode;if(u===null)return null;var h=u[Yn]||null;if(h===null)return null;u=h[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(l=l.type,h=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!h;break e;default:l=!1}if(l)return null;if(u&&typeof u!="function")throw Error(i(231,a,typeof u));return u}var _r=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Am=!1;if(_r)try{var Qa={};Object.defineProperty(Qa,"passive",{get:function(){Am=!0}}),window.addEventListener("test",Qa,Qa),window.removeEventListener("test",Qa,Qa)}catch{Am=!1}var fs=null,Mm=null,Sf=null;function cS(){if(Sf)return Sf;var l,a=Mm,u=a.length,h,g="value"in fs?fs.value:fs.textContent,x=g.length;for(l=0;l<u&&a[l]===g[l];l++);var w=u-l;for(h=1;h<=w&&a[u-h]===g[x-h];h++);return Sf=g.slice(l,1<h?1-h:void 0)}function wf(l){var a=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&a===13&&(l=13)):l=a,l===10&&(l=13),32<=l||l===13?l:0}function vf(){return!0}function uS(){return!1}function Kn(l){function a(u,h,g,x,w){this._reactName=u,this._targetInst=g,this.type=h,this.nativeEvent=x,this.target=w,this.currentTarget=null;for(var C in l)l.hasOwnProperty(C)&&(u=l[C],this[C]=u?u(x):x[C]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?vf:uS,this.isPropagationStopped=uS,this}return m(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=vf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=vf)},persist:function(){},isPersistent:vf}),a}var pl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kf=Kn(pl),ec=m({},pl,{view:0,detail:0}),_2=Kn(ec),Om,_m,tc,Cf=m({},ec,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nm,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==tc&&(tc&&l.type==="mousemove"?(Om=l.screenX-tc.screenX,_m=l.screenY-tc.screenY):_m=Om=0,tc=l),Om)},movementY:function(l){return"movementY"in l?l.movementY:_m}}),fS=Kn(Cf),D2=m({},Cf,{dataTransfer:0}),N2=Kn(D2),R2=m({},ec,{relatedTarget:0}),Dm=Kn(R2),z2=m({},pl,{animationName:0,elapsedTime:0,pseudoElement:0}),L2=Kn(z2),I2=m({},pl,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),B2=Kn(I2),j2=m({},pl,{data:0}),dS=Kn(j2),U2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},H2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},V2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function P2(l){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(l):(l=V2[l])?!!a[l]:!1}function Nm(){return P2}var $2=m({},ec,{key:function(l){if(l.key){var a=U2[l.key]||l.key;if(a!=="Unidentified")return a}return l.type==="keypress"?(l=wf(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?H2[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nm,charCode:function(l){return l.type==="keypress"?wf(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?wf(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),F2=Kn($2),q2=m({},Cf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hS=Kn(q2),Y2=m({},ec,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nm}),K2=Kn(Y2),G2=m({},pl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Z2=Kn(G2),J2=m({},Cf,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),X2=Kn(J2),W2=m({},pl,{newState:0,oldState:0}),Q2=Kn(W2),eN=[9,13,27,32],Rm=_r&&"CompositionEvent"in window,nc=null;_r&&"documentMode"in document&&(nc=document.documentMode);var tN=_r&&"TextEvent"in window&&!nc,pS=_r&&(!Rm||nc&&8<nc&&11>=nc),mS=" ",gS=!1;function yS(l,a){switch(l){case"keyup":return eN.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bS(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var So=!1;function nN(l,a){switch(l){case"compositionend":return bS(a);case"keypress":return a.which!==32?null:(gS=!0,mS);case"textInput":return l=a.data,l===mS&&gS?null:l;default:return null}}function iN(l,a){if(So)return l==="compositionend"||!Rm&&yS(l,a)?(l=cS(),Sf=Mm=fs=null,So=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return pS&&a.locale!=="ko"?null:a.data;default:return null}}var rN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xS(l){var a=l&&l.nodeName&&l.nodeName.toLowerCase();return a==="input"?!!rN[l.type]:a==="textarea"}function SS(l,a,u,h){bo?xo?xo.push(h):xo=[h]:bo=h,a=hd(a,"onChange"),0<a.length&&(u=new kf("onChange","change",null,u,h),l.push({event:u,listeners:a}))}var ic=null,rc=null;function sN(l){nk(l,0)}function Ef(l){var a=Xa(l);if(tS(a))return l}function wS(l,a){if(l==="change")return a}var vS=!1;if(_r){var zm;if(_r){var Lm="oninput"in document;if(!Lm){var kS=document.createElement("div");kS.setAttribute("oninput","return;"),Lm=typeof kS.oninput=="function"}zm=Lm}else zm=!1;vS=zm&&(!document.documentMode||9<document.documentMode)}function CS(){ic&&(ic.detachEvent("onpropertychange",ES),rc=ic=null)}function ES(l){if(l.propertyName==="value"&&Ef(rc)){var a=[];SS(a,rc,l,Em(l)),aS(sN,a)}}function lN(l,a,u){l==="focusin"?(CS(),ic=a,rc=u,ic.attachEvent("onpropertychange",ES)):l==="focusout"&&CS()}function oN(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Ef(rc)}function aN(l,a){if(l==="click")return Ef(a)}function cN(l,a){if(l==="input"||l==="change")return Ef(a)}function uN(l,a){return l===a&&(l!==0||1/l===1/a)||l!==l&&a!==a}var ai=typeof Object.is=="function"?Object.is:uN;function sc(l,a){if(ai(l,a))return!0;if(typeof l!="object"||l===null||typeof a!="object"||a===null)return!1;var u=Object.keys(l),h=Object.keys(a);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var g=u[h];if(!Yi.call(a,g)||!ai(l[g],a[g]))return!1}return!0}function TS(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function AS(l,a){var u=TS(l);l=0;for(var h;u;){if(u.nodeType===3){if(h=l+u.textContent.length,l<=a&&h>=a)return{node:u,offset:a-l};l=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=TS(u)}}function MS(l,a){return l&&a?l===a?!0:l&&l.nodeType===3?!1:a&&a.nodeType===3?MS(l,a.parentNode):"contains"in l?l.contains(a):l.compareDocumentPosition?!!(l.compareDocumentPosition(a)&16):!1:!1}function OS(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var a=bf(l.document);a instanceof l.HTMLIFrameElement;){try{var u=typeof a.contentWindow.location.href=="string"}catch{u=!1}if(u)l=a.contentWindow;else break;a=bf(l.document)}return a}function Im(l){var a=l&&l.nodeName&&l.nodeName.toLowerCase();return a&&(a==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||a==="textarea"||l.contentEditable==="true")}var fN=_r&&"documentMode"in document&&11>=document.documentMode,wo=null,Bm=null,lc=null,jm=!1;function _S(l,a,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;jm||wo==null||wo!==bf(h)||(h=wo,"selectionStart"in h&&Im(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),lc&&sc(lc,h)||(lc=h,h=hd(Bm,"onSelect"),0<h.length&&(a=new kf("onSelect","select",null,a,u),l.push({event:a,listeners:h}),a.target=wo)))}function ml(l,a){var u={};return u[l.toLowerCase()]=a.toLowerCase(),u["Webkit"+l]="webkit"+a,u["Moz"+l]="moz"+a,u}var vo={animationend:ml("Animation","AnimationEnd"),animationiteration:ml("Animation","AnimationIteration"),animationstart:ml("Animation","AnimationStart"),transitionrun:ml("Transition","TransitionRun"),transitionstart:ml("Transition","TransitionStart"),transitioncancel:ml("Transition","TransitionCancel"),transitionend:ml("Transition","TransitionEnd")},Um={},DS={};_r&&(DS=document.createElement("div").style,"AnimationEvent"in window||(delete vo.animationend.animation,delete vo.animationiteration.animation,delete vo.animationstart.animation),"TransitionEvent"in window||delete vo.transitionend.transition);function gl(l){if(Um[l])return Um[l];if(!vo[l])return l;var a=vo[l],u;for(u in a)if(a.hasOwnProperty(u)&&u in DS)return Um[l]=a[u];return l}var NS=gl("animationend"),RS=gl("animationiteration"),zS=gl("animationstart"),dN=gl("transitionrun"),hN=gl("transitionstart"),pN=gl("transitioncancel"),LS=gl("transitionend"),IS=new Map,Hm="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(" ");Hm.push("scrollEnd");function Gi(l,a){IS.set(l,a),hl(a,[l])}var Tf=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},Ci=[],ko=0,Vm=0;function Af(){for(var l=ko,a=Vm=ko=0;a<l;){var u=Ci[a];Ci[a++]=null;var h=Ci[a];Ci[a++]=null;var g=Ci[a];Ci[a++]=null;var x=Ci[a];if(Ci[a++]=null,h!==null&&g!==null){var w=h.pending;w===null?g.next=g:(g.next=w.next,w.next=g),h.pending=g}x!==0&&BS(u,g,x)}}function Mf(l,a,u,h){Ci[ko++]=l,Ci[ko++]=a,Ci[ko++]=u,Ci[ko++]=h,Vm|=h,l.lanes|=h,l=l.alternate,l!==null&&(l.lanes|=h)}function Pm(l,a,u,h){return Mf(l,a,u,h),Of(l)}function yl(l,a){return Mf(l,null,null,a),Of(l)}function BS(l,a,u){l.lanes|=u;var h=l.alternate;h!==null&&(h.lanes|=u);for(var g=!1,x=l.return;x!==null;)x.childLanes|=u,h=x.alternate,h!==null&&(h.childLanes|=u),x.tag===22&&(l=x.stateNode,l===null||l._visibility&1||(g=!0)),l=x,x=x.return;return l.tag===3?(x=l.stateNode,g&&a!==null&&(g=31-xt(u),l=x.hiddenUpdates,h=l[g],h===null?l[g]=[a]:h.push(a),a.lane=u|536870912),x):null}function Of(l){if(50<Mc)throw Mc=0,Xg=null,Error(i(185));for(var a=l.return;a!==null;)l=a,a=l.return;return l.tag===3?l.stateNode:null}var Co={};function mN(l,a,u,h){this.tag=l,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(l,a,u,h){return new mN(l,a,u,h)}function $m(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Dr(l,a){var u=l.alternate;return u===null?(u=ci(l.tag,a,l.key,l.mode),u.elementType=l.elementType,u.type=l.type,u.stateNode=l.stateNode,u.alternate=l,l.alternate=u):(u.pendingProps=a,u.type=l.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=l.flags&65011712,u.childLanes=l.childLanes,u.lanes=l.lanes,u.child=l.child,u.memoizedProps=l.memoizedProps,u.memoizedState=l.memoizedState,u.updateQueue=l.updateQueue,a=l.dependencies,u.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},u.sibling=l.sibling,u.index=l.index,u.ref=l.ref,u.refCleanup=l.refCleanup,u}function jS(l,a){l.flags&=65011714;var u=l.alternate;return u===null?(l.childLanes=0,l.lanes=a,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=u.childLanes,l.lanes=u.lanes,l.child=u.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=u.memoizedProps,l.memoizedState=u.memoizedState,l.updateQueue=u.updateQueue,l.type=u.type,a=u.dependencies,l.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),l}function _f(l,a,u,h,g,x){var w=0;if(h=l,typeof l=="function")$m(l)&&(w=1);else if(typeof l=="string")w=SR(l,u,ne.current)?26:l==="html"||l==="head"||l==="body"?27:5;else e:switch(l){case se:return l=ci(31,u,a,g),l.elementType=se,l.lanes=x,l;case v:return bl(u.children,g,x,a);case k:w=8,g|=24;break;case E:return l=ci(12,u,a,g|2),l.elementType=E,l.lanes=x,l;case P:return l=ci(13,u,a,g),l.elementType=P,l.lanes=x,l;case O:return l=ci(19,u,a,g),l.elementType=O,l.lanes=x,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case L:w=10;break e;case j:w=9;break e;case re:w=11;break e;case z:w=14;break e;case F:w=16,h=null;break e}w=29,u=Error(i(130,l===null?"null":typeof l,"")),h=null}return a=ci(w,u,a,g),a.elementType=l,a.type=h,a.lanes=x,a}function bl(l,a,u,h){return l=ci(7,l,h,a),l.lanes=u,l}function Fm(l,a,u){return l=ci(6,l,null,a),l.lanes=u,l}function US(l){var a=ci(18,null,null,0);return a.stateNode=l,a}function qm(l,a,u){return a=ci(4,l.children!==null?l.children:[],l.key,a),a.lanes=u,a.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},a}var HS=new WeakMap;function Ei(l,a){if(typeof l=="object"&&l!==null){var u=HS.get(l);return u!==void 0?u:(a={value:l,source:a,stack:qi(a)},HS.set(l,a),a)}return{value:l,source:a,stack:qi(a)}}var Eo=[],To=0,Df=null,oc=0,Ti=[],Ai=0,ds=null,lr=1,or="";function Nr(l,a){Eo[To++]=oc,Eo[To++]=Df,Df=l,oc=a}function VS(l,a,u){Ti[Ai++]=lr,Ti[Ai++]=or,Ti[Ai++]=ds,ds=l;var h=lr;l=or;var g=32-xt(h)-1;h&=~(1<<g),u+=1;var x=32-xt(a)+g;if(30<x){var w=g-g%5;x=(h&(1<<w)-1).toString(32),h>>=w,g-=w,lr=1<<32-xt(a)+g|u<<g|h,or=x+l}else lr=1<<x|u<<g|h,or=l}function Ym(l){l.return!==null&&(Nr(l,1),VS(l,1,0))}function Km(l){for(;l===Df;)Df=Eo[--To],Eo[To]=null,oc=Eo[--To],Eo[To]=null;for(;l===ds;)ds=Ti[--Ai],Ti[Ai]=null,or=Ti[--Ai],Ti[Ai]=null,lr=Ti[--Ai],Ti[Ai]=null}function PS(l,a){Ti[Ai++]=lr,Ti[Ai++]=or,Ti[Ai++]=ds,lr=a.id,or=a.overflow,ds=l}var gn=null,At=null,tt=!1,hs=null,Mi=!1,Gm=Error(i(519));function ps(l){var a=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ac(Ei(a,l)),Gm}function $S(l){var a=l.stateNode,u=l.type,h=l.memoizedProps;switch(a[mn]=l,a[Yn]=h,u){case"dialog":Je("cancel",a),Je("close",a);break;case"iframe":case"object":case"embed":Je("load",a);break;case"video":case"audio":for(u=0;u<_c.length;u++)Je(_c[u],a);break;case"source":Je("error",a);break;case"img":case"image":case"link":Je("error",a),Je("load",a);break;case"details":Je("toggle",a);break;case"input":Je("invalid",a),nS(a,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Je("invalid",a);break;case"textarea":Je("invalid",a),rS(a,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||a.textContent===""+u||h.suppressHydrationWarning===!0||lk(a.textContent,u)?(h.popover!=null&&(Je("beforetoggle",a),Je("toggle",a)),h.onScroll!=null&&Je("scroll",a),h.onScrollEnd!=null&&Je("scrollend",a),h.onClick!=null&&(a.onclick=Or),a=!0):a=!1,a||ps(l,!0)}function FS(l){for(gn=l.return;gn;)switch(gn.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:gn=gn.return}}function Ao(l){if(l!==gn)return!1;if(!tt)return FS(l),tt=!0,!1;var a=l.tag,u;if((u=a!==3&&a!==27)&&((u=a===5)&&(u=l.type,u=!(u!=="form"&&u!=="button")||dy(l.type,l.memoizedProps)),u=!u),u&&At&&ps(l),FS(l),a===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));At=mk(l)}else if(a===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));At=mk(l)}else a===27?(a=At,Ms(l.type)?(l=yy,yy=null,At=l):At=a):At=gn?_i(l.stateNode.nextSibling):null;return!0}function xl(){At=gn=null,tt=!1}function Zm(){var l=hs;return l!==null&&(Xn===null?Xn=l:Xn.push.apply(Xn,l),hs=null),l}function ac(l){hs===null?hs=[l]:hs.push(l)}var Jm=_(null),Sl=null,Rr=null;function ms(l,a,u){T(Jm,a._currentValue),a._currentValue=u}function zr(l){l._currentValue=Jm.current,U(Jm)}function Xm(l,a,u){for(;l!==null;){var h=l.alternate;if((l.childLanes&a)!==a?(l.childLanes|=a,h!==null&&(h.childLanes|=a)):h!==null&&(h.childLanes&a)!==a&&(h.childLanes|=a),l===u)break;l=l.return}}function Wm(l,a,u,h){var g=l.child;for(g!==null&&(g.return=l);g!==null;){var x=g.dependencies;if(x!==null){var w=g.child;x=x.firstContext;e:for(;x!==null;){var C=x;x=g;for(var D=0;D<a.length;D++)if(C.context===a[D]){x.lanes|=u,C=x.alternate,C!==null&&(C.lanes|=u),Xm(x.return,u,l),h||(w=null);break e}x=C.next}}else if(g.tag===18){if(w=g.return,w===null)throw Error(i(341));w.lanes|=u,x=w.alternate,x!==null&&(x.lanes|=u),Xm(w,u,l),w=null}else w=g.child;if(w!==null)w.return=g;else for(w=g;w!==null;){if(w===l){w=null;break}if(g=w.sibling,g!==null){g.return=w.return,w=g;break}w=w.return}g=w}}function Mo(l,a,u,h){l=null;for(var g=a,x=!1;g!==null;){if(!x){if((g.flags&524288)!==0)x=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var w=g.alternate;if(w===null)throw Error(i(387));if(w=w.memoizedProps,w!==null){var C=g.type;ai(g.pendingProps.value,w.value)||(l!==null?l.push(C):l=[C])}}else if(g===Oe.current){if(w=g.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(l!==null?l.push(Lc):l=[Lc])}g=g.return}l!==null&&Wm(a,l,u,h),a.flags|=262144}function Nf(l){for(l=l.firstContext;l!==null;){if(!ai(l.context._currentValue,l.memoizedValue))return!0;l=l.next}return!1}function wl(l){Sl=l,Rr=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function yn(l){return qS(Sl,l)}function Rf(l,a){return Sl===null&&wl(l),qS(l,a)}function qS(l,a){var u=a._currentValue;if(a={context:a,memoizedValue:u,next:null},Rr===null){if(l===null)throw Error(i(308));Rr=a,l.dependencies={lanes:0,firstContext:a},l.flags|=524288}else Rr=Rr.next=a;return u}var gN=typeof AbortController<"u"?AbortController:function(){var l=[],a=this.signal={aborted:!1,addEventListener:function(u,h){l.push(h)}};this.abort=function(){a.aborted=!0,l.forEach(function(u){return u()})}},yN=t.unstable_scheduleCallback,bN=t.unstable_NormalPriority,Ft={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qm(){return{controller:new gN,data:new Map,refCount:0}}function cc(l){l.refCount--,l.refCount===0&&yN(bN,function(){l.controller.abort()})}var uc=null,eg=0,Oo=0,_o=null;function xN(l,a){if(uc===null){var u=uc=[];eg=0,Oo=iy(),_o={status:"pending",value:void 0,then:function(h){u.push(h)}}}return eg++,a.then(YS,YS),a}function YS(){if(--eg===0&&uc!==null){_o!==null&&(_o.status="fulfilled");var l=uc;uc=null,Oo=0,_o=null;for(var a=0;a<l.length;a++)(0,l[a])()}}function SN(l,a){var u=[],h={status:"pending",value:null,reason:null,then:function(g){u.push(g)}};return l.then(function(){h.status="fulfilled",h.value=a;for(var g=0;g<u.length;g++)(0,u[g])(a)},function(g){for(h.status="rejected",h.reason=g,g=0;g<u.length;g++)(0,u[g])(void 0)}),h}var KS=I.S;I.S=function(l,a){_v=qe(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&xN(l,a),KS!==null&&KS(l,a)};var vl=_(null);function tg(){var l=vl.current;return l!==null?l:St.pooledCache}function zf(l,a){a===null?T(vl,vl.current):T(vl,a.pool)}function GS(){var l=tg();return l===null?null:{parent:Ft._currentValue,pool:l}}var Do=Error(i(460)),ng=Error(i(474)),Lf=Error(i(542)),If={then:function(){}};function ZS(l){return l=l.status,l==="fulfilled"||l==="rejected"}function JS(l,a,u){switch(u=l[u],u===void 0?l.push(a):u!==a&&(a.then(Or,Or),a=u),a.status){case"fulfilled":return a.value;case"rejected":throw l=a.reason,WS(l),l;default:if(typeof a.status=="string")a.then(Or,Or);else{if(l=St,l!==null&&100<l.shellSuspendCounter)throw Error(i(482));l=a,l.status="pending",l.then(function(h){if(a.status==="pending"){var g=a;g.status="fulfilled",g.value=h}},function(h){if(a.status==="pending"){var g=a;g.status="rejected",g.reason=h}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw l=a.reason,WS(l),l}throw Cl=a,Do}}function kl(l){try{var a=l._init;return a(l._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Cl=u,Do):u}}var Cl=null;function XS(){if(Cl===null)throw Error(i(459));var l=Cl;return Cl=null,l}function WS(l){if(l===Do||l===Lf)throw Error(i(483))}var No=null,fc=0;function Bf(l){var a=fc;return fc+=1,No===null&&(No=[]),JS(No,l,a)}function dc(l,a){a=a.props.ref,l.ref=a!==void 0?a:null}function jf(l,a){throw a.$$typeof===y?Error(i(525)):(l=Object.prototype.toString.call(a),Error(i(31,l==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":l)))}function QS(l){function a(B,R){if(l){var H=B.deletions;H===null?(B.deletions=[R],B.flags|=16):H.push(R)}}function u(B,R){if(!l)return null;for(;R!==null;)a(B,R),R=R.sibling;return null}function h(B){for(var R=new Map;B!==null;)B.key!==null?R.set(B.key,B):R.set(B.index,B),B=B.sibling;return R}function g(B,R){return B=Dr(B,R),B.index=0,B.sibling=null,B}function x(B,R,H){return B.index=H,l?(H=B.alternate,H!==null?(H=H.index,H<R?(B.flags|=67108866,R):H):(B.flags|=67108866,R)):(B.flags|=1048576,R)}function w(B){return l&&B.alternate===null&&(B.flags|=67108866),B}function C(B,R,H,J){return R===null||R.tag!==6?(R=Fm(H,B.mode,J),R.return=B,R):(R=g(R,H),R.return=B,R)}function D(B,R,H,J){var Te=H.type;return Te===v?G(B,R,H.props.children,J,H.key):R!==null&&(R.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===F&&kl(Te)===R.type)?(R=g(R,H.props),dc(R,H),R.return=B,R):(R=_f(H.type,H.key,H.props,null,B.mode,J),dc(R,H),R.return=B,R)}function V(B,R,H,J){return R===null||R.tag!==4||R.stateNode.containerInfo!==H.containerInfo||R.stateNode.implementation!==H.implementation?(R=qm(H,B.mode,J),R.return=B,R):(R=g(R,H.children||[]),R.return=B,R)}function G(B,R,H,J,Te){return R===null||R.tag!==7?(R=bl(H,B.mode,J,Te),R.return=B,R):(R=g(R,H),R.return=B,R)}function X(B,R,H){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Fm(""+R,B.mode,H),R.return=B,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case b:return H=_f(R.type,R.key,R.props,null,B.mode,H),dc(H,R),H.return=B,H;case S:return R=qm(R,B.mode,H),R.return=B,R;case F:return R=kl(R),X(B,R,H)}if(Z(R)||ce(R))return R=bl(R,B.mode,H,null),R.return=B,R;if(typeof R.then=="function")return X(B,Bf(R),H);if(R.$$typeof===L)return X(B,Rf(B,R),H);jf(B,R)}return null}function $(B,R,H,J){var Te=R!==null?R.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Te!==null?null:C(B,R,""+H,J);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return H.key===Te?D(B,R,H,J):null;case S:return H.key===Te?V(B,R,H,J):null;case F:return H=kl(H),$(B,R,H,J)}if(Z(H)||ce(H))return Te!==null?null:G(B,R,H,J,null);if(typeof H.then=="function")return $(B,R,Bf(H),J);if(H.$$typeof===L)return $(B,R,Rf(B,H),J);jf(B,H)}return null}function q(B,R,H,J,Te){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return B=B.get(H)||null,C(R,B,""+J,Te);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return B=B.get(J.key===null?H:J.key)||null,D(R,B,J,Te);case S:return B=B.get(J.key===null?H:J.key)||null,V(R,B,J,Te);case F:return J=kl(J),q(B,R,H,J,Te)}if(Z(J)||ce(J))return B=B.get(H)||null,G(R,B,J,Te,null);if(typeof J.then=="function")return q(B,R,H,Bf(J),Te);if(J.$$typeof===L)return q(B,R,H,Rf(R,J),Te);jf(R,J)}return null}function be(B,R,H,J){for(var Te=null,rt=null,ve=R,He=R=0,Qe=null;ve!==null&&He<H.length;He++){ve.index>He?(Qe=ve,ve=null):Qe=ve.sibling;var st=$(B,ve,H[He],J);if(st===null){ve===null&&(ve=Qe);break}l&&ve&&st.alternate===null&&a(B,ve),R=x(st,R,He),rt===null?Te=st:rt.sibling=st,rt=st,ve=Qe}if(He===H.length)return u(B,ve),tt&&Nr(B,He),Te;if(ve===null){for(;He<H.length;He++)ve=X(B,H[He],J),ve!==null&&(R=x(ve,R,He),rt===null?Te=ve:rt.sibling=ve,rt=ve);return tt&&Nr(B,He),Te}for(ve=h(ve);He<H.length;He++)Qe=q(ve,B,He,H[He],J),Qe!==null&&(l&&Qe.alternate!==null&&ve.delete(Qe.key===null?He:Qe.key),R=x(Qe,R,He),rt===null?Te=Qe:rt.sibling=Qe,rt=Qe);return l&&ve.forEach(function(Rs){return a(B,Rs)}),tt&&Nr(B,He),Te}function Me(B,R,H,J){if(H==null)throw Error(i(151));for(var Te=null,rt=null,ve=R,He=R=0,Qe=null,st=H.next();ve!==null&&!st.done;He++,st=H.next()){ve.index>He?(Qe=ve,ve=null):Qe=ve.sibling;var Rs=$(B,ve,st.value,J);if(Rs===null){ve===null&&(ve=Qe);break}l&&ve&&Rs.alternate===null&&a(B,ve),R=x(Rs,R,He),rt===null?Te=Rs:rt.sibling=Rs,rt=Rs,ve=Qe}if(st.done)return u(B,ve),tt&&Nr(B,He),Te;if(ve===null){for(;!st.done;He++,st=H.next())st=X(B,st.value,J),st!==null&&(R=x(st,R,He),rt===null?Te=st:rt.sibling=st,rt=st);return tt&&Nr(B,He),Te}for(ve=h(ve);!st.done;He++,st=H.next())st=q(ve,B,He,st.value,J),st!==null&&(l&&st.alternate!==null&&ve.delete(st.key===null?He:st.key),R=x(st,R,He),rt===null?Te=st:rt.sibling=st,rt=st);return l&&ve.forEach(function(DR){return a(B,DR)}),tt&&Nr(B,He),Te}function yt(B,R,H,J){if(typeof H=="object"&&H!==null&&H.type===v&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case b:e:{for(var Te=H.key;R!==null;){if(R.key===Te){if(Te=H.type,Te===v){if(R.tag===7){u(B,R.sibling),J=g(R,H.props.children),J.return=B,B=J;break e}}else if(R.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===F&&kl(Te)===R.type){u(B,R.sibling),J=g(R,H.props),dc(J,H),J.return=B,B=J;break e}u(B,R);break}else a(B,R);R=R.sibling}H.type===v?(J=bl(H.props.children,B.mode,J,H.key),J.return=B,B=J):(J=_f(H.type,H.key,H.props,null,B.mode,J),dc(J,H),J.return=B,B=J)}return w(B);case S:e:{for(Te=H.key;R!==null;){if(R.key===Te)if(R.tag===4&&R.stateNode.containerInfo===H.containerInfo&&R.stateNode.implementation===H.implementation){u(B,R.sibling),J=g(R,H.children||[]),J.return=B,B=J;break e}else{u(B,R);break}else a(B,R);R=R.sibling}J=qm(H,B.mode,J),J.return=B,B=J}return w(B);case F:return H=kl(H),yt(B,R,H,J)}if(Z(H))return be(B,R,H,J);if(ce(H)){if(Te=ce(H),typeof Te!="function")throw Error(i(150));return H=Te.call(H),Me(B,R,H,J)}if(typeof H.then=="function")return yt(B,R,Bf(H),J);if(H.$$typeof===L)return yt(B,R,Rf(B,H),J);jf(B,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,R!==null&&R.tag===6?(u(B,R.sibling),J=g(R,H),J.return=B,B=J):(u(B,R),J=Fm(H,B.mode,J),J.return=B,B=J),w(B)):u(B,R)}return function(B,R,H,J){try{fc=0;var Te=yt(B,R,H,J);return No=null,Te}catch(ve){if(ve===Do||ve===Lf)throw ve;var rt=ci(29,ve,null,B.mode);return rt.lanes=J,rt.return=B,rt}finally{}}}var El=QS(!0),ew=QS(!1),gs=!1;function ig(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rg(l,a){l=l.updateQueue,a.updateQueue===l&&(a.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function ys(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function bs(l,a,u){var h=l.updateQueue;if(h===null)return null;if(h=h.shared,(ot&2)!==0){var g=h.pending;return g===null?a.next=a:(a.next=g.next,g.next=a),h.pending=a,a=Of(l),BS(l,null,u),a}return Mf(l,h,a,u),Of(l)}function hc(l,a,u){if(a=a.updateQueue,a!==null&&(a=a.shared,(u&4194048)!==0)){var h=a.lanes;h&=l.pendingLanes,u|=h,a.lanes=u,qx(l,u)}}function sg(l,a){var u=l.updateQueue,h=l.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var g=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var w={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?g=x=w:x=x.next=w,u=u.next}while(u!==null);x===null?g=x=a:x=x.next=a}else g=x=a;u={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:x,shared:h.shared,callbacks:h.callbacks},l.updateQueue=u;return}l=u.lastBaseUpdate,l===null?u.firstBaseUpdate=a:l.next=a,u.lastBaseUpdate=a}var lg=!1;function pc(){if(lg){var l=_o;if(l!==null)throw l}}function mc(l,a,u,h){lg=!1;var g=l.updateQueue;gs=!1;var x=g.firstBaseUpdate,w=g.lastBaseUpdate,C=g.shared.pending;if(C!==null){g.shared.pending=null;var D=C,V=D.next;D.next=null,w===null?x=V:w.next=V,w=D;var G=l.alternate;G!==null&&(G=G.updateQueue,C=G.lastBaseUpdate,C!==w&&(C===null?G.firstBaseUpdate=V:C.next=V,G.lastBaseUpdate=D))}if(x!==null){var X=g.baseState;w=0,G=V=D=null,C=x;do{var $=C.lane&-536870913,q=$!==C.lane;if(q?(We&$)===$:(h&$)===$){$!==0&&$===Oo&&(lg=!0),G!==null&&(G=G.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var be=l,Me=C;$=a;var yt=u;switch(Me.tag){case 1:if(be=Me.payload,typeof be=="function"){X=be.call(yt,X,$);break e}X=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Me.payload,$=typeof be=="function"?be.call(yt,X,$):be,$==null)break e;X=m({},X,$);break e;case 2:gs=!0}}$=C.callback,$!==null&&(l.flags|=64,q&&(l.flags|=8192),q=g.callbacks,q===null?g.callbacks=[$]:q.push($))}else q={lane:$,tag:C.tag,payload:C.payload,callback:C.callback,next:null},G===null?(V=G=q,D=X):G=G.next=q,w|=$;if(C=C.next,C===null){if(C=g.shared.pending,C===null)break;q=C,C=q.next,q.next=null,g.lastBaseUpdate=q,g.shared.pending=null}}while(!0);G===null&&(D=X),g.baseState=D,g.firstBaseUpdate=V,g.lastBaseUpdate=G,x===null&&(g.shared.lanes=0),ks|=w,l.lanes=w,l.memoizedState=X}}function tw(l,a){if(typeof l!="function")throw Error(i(191,l));l.call(a)}function nw(l,a){var u=l.callbacks;if(u!==null)for(l.callbacks=null,l=0;l<u.length;l++)tw(u[l],a)}var Ro=_(null),Uf=_(0);function iw(l,a){l=$r,T(Uf,l),T(Ro,a),$r=l|a.baseLanes}function og(){T(Uf,$r),T(Ro,Ro.current)}function ag(){$r=Uf.current,U(Ro),U(Uf)}var ui=_(null),Oi=null;function xs(l){var a=l.alternate;T(Vt,Vt.current&1),T(ui,l),Oi===null&&(a===null||Ro.current!==null||a.memoizedState!==null)&&(Oi=l)}function cg(l){T(Vt,Vt.current),T(ui,l),Oi===null&&(Oi=l)}function rw(l){l.tag===22?(T(Vt,Vt.current),T(ui,l),Oi===null&&(Oi=l)):Ss()}function Ss(){T(Vt,Vt.current),T(ui,ui.current)}function fi(l){U(ui),Oi===l&&(Oi=null),U(Vt)}var Vt=_(0);function Hf(l){for(var a=l;a!==null;){if(a.tag===13){var u=a.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||my(u)||gy(u)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break;for(;a.sibling===null;){if(a.return===null||a.return===l)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Lr=0,Be=null,mt=null,qt=null,Vf=!1,zo=!1,Tl=!1,Pf=0,gc=0,Lo=null,wN=0;function zt(){throw Error(i(321))}function ug(l,a){if(a===null)return!1;for(var u=0;u<a.length&&u<l.length;u++)if(!ai(l[u],a[u]))return!1;return!0}function fg(l,a,u,h,g,x){return Lr=x,Be=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,I.H=l===null||l.memoizedState===null?Vw:Tg,Tl=!1,x=u(h,g),Tl=!1,zo&&(x=lw(a,u,h,g)),sw(l),x}function sw(l){I.H=xc;var a=mt!==null&&mt.next!==null;if(Lr=0,qt=mt=Be=null,Vf=!1,gc=0,Lo=null,a)throw Error(i(300));l===null||Yt||(l=l.dependencies,l!==null&&Nf(l)&&(Yt=!0))}function lw(l,a,u,h){Be=l;var g=0;do{if(zo&&(Lo=null),gc=0,zo=!1,25<=g)throw Error(i(301));if(g+=1,qt=mt=null,l.updateQueue!=null){var x=l.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}I.H=Pw,x=a(u,h)}while(zo);return x}function vN(){var l=I.H,a=l.useState()[0];return a=typeof a.then=="function"?yc(a):a,l=l.useState()[0],(mt!==null?mt.memoizedState:null)!==l&&(Be.flags|=1024),a}function dg(){var l=Pf!==0;return Pf=0,l}function hg(l,a,u){a.updateQueue=l.updateQueue,a.flags&=-2053,l.lanes&=~u}function pg(l){if(Vf){for(l=l.memoizedState;l!==null;){var a=l.queue;a!==null&&(a.pending=null),l=l.next}Vf=!1}Lr=0,qt=mt=Be=null,zo=!1,gc=Pf=0,Lo=null}function In(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?Be.memoizedState=qt=l:qt=qt.next=l,qt}function Pt(){if(mt===null){var l=Be.alternate;l=l!==null?l.memoizedState:null}else l=mt.next;var a=qt===null?Be.memoizedState:qt.next;if(a!==null)qt=a,mt=l;else{if(l===null)throw Be.alternate===null?Error(i(467)):Error(i(310));mt=l,l={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},qt===null?Be.memoizedState=qt=l:qt=qt.next=l}return qt}function $f(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yc(l){var a=gc;return gc+=1,Lo===null&&(Lo=[]),l=JS(Lo,l,a),a=Be,(qt===null?a.memoizedState:qt.next)===null&&(a=a.alternate,I.H=a===null||a.memoizedState===null?Vw:Tg),l}function Ff(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return yc(l);if(l.$$typeof===L)return yn(l)}throw Error(i(438,String(l)))}function mg(l){var a=null,u=Be.updateQueue;if(u!==null&&(a=u.memoCache),a==null){var h=Be.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(a={data:h.data.map(function(g){return g.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),u===null&&(u=$f(),Be.updateQueue=u),u.memoCache=a,u=a.data[a.index],u===void 0)for(u=a.data[a.index]=Array(l),h=0;h<l;h++)u[h]=te;return a.index++,u}function Ir(l,a){return typeof a=="function"?a(l):a}function qf(l){var a=Pt();return gg(a,mt,l)}function gg(l,a,u){var h=l.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=u;var g=l.baseQueue,x=h.pending;if(x!==null){if(g!==null){var w=g.next;g.next=x.next,x.next=w}a.baseQueue=g=x,h.pending=null}if(x=l.baseState,g===null)l.memoizedState=x;else{a=g.next;var C=w=null,D=null,V=a,G=!1;do{var X=V.lane&-536870913;if(X!==V.lane?(We&X)===X:(Lr&X)===X){var $=V.revertLane;if($===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),X===Oo&&(G=!0);else if((Lr&$)===$){V=V.next,$===Oo&&(G=!0);continue}else X={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(C=D=X,w=x):D=D.next=X,Be.lanes|=$,ks|=$;X=V.action,Tl&&u(x,X),x=V.hasEagerState?V.eagerState:u(x,X)}else $={lane:X,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(C=D=$,w=x):D=D.next=$,Be.lanes|=X,ks|=X;V=V.next}while(V!==null&&V!==a);if(D===null?w=x:D.next=C,!ai(x,l.memoizedState)&&(Yt=!0,G&&(u=_o,u!==null)))throw u;l.memoizedState=x,l.baseState=w,l.baseQueue=D,h.lastRenderedState=x}return g===null&&(h.lanes=0),[l.memoizedState,h.dispatch]}function yg(l){var a=Pt(),u=a.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=l;var h=u.dispatch,g=u.pending,x=a.memoizedState;if(g!==null){u.pending=null;var w=g=g.next;do x=l(x,w.action),w=w.next;while(w!==g);ai(x,a.memoizedState)||(Yt=!0),a.memoizedState=x,a.baseQueue===null&&(a.baseState=x),u.lastRenderedState=x}return[x,h]}function ow(l,a,u){var h=Be,g=Pt(),x=tt;if(x){if(u===void 0)throw Error(i(407));u=u()}else u=a();var w=!ai((mt||g).memoizedState,u);if(w&&(g.memoizedState=u,Yt=!0),g=g.queue,Sg(uw.bind(null,h,g,l),[l]),g.getSnapshot!==a||w||qt!==null&&qt.memoizedState.tag&1){if(h.flags|=2048,Io(9,{destroy:void 0},cw.bind(null,h,g,u,a),null),St===null)throw Error(i(349));x||(Lr&127)!==0||aw(h,a,u)}return u}function aw(l,a,u){l.flags|=16384,l={getSnapshot:a,value:u},a=Be.updateQueue,a===null?(a=$f(),Be.updateQueue=a,a.stores=[l]):(u=a.stores,u===null?a.stores=[l]:u.push(l))}function cw(l,a,u,h){a.value=u,a.getSnapshot=h,fw(a)&&dw(l)}function uw(l,a,u){return u(function(){fw(a)&&dw(l)})}function fw(l){var a=l.getSnapshot;l=l.value;try{var u=a();return!ai(l,u)}catch{return!0}}function dw(l){var a=yl(l,2);a!==null&&Wn(a,l,2)}function bg(l){var a=In();if(typeof l=="function"){var u=l;if(l=u(),Tl){qn(!0);try{u()}finally{qn(!1)}}}return a.memoizedState=a.baseState=l,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:l},a}function hw(l,a,u,h){return l.baseState=u,gg(l,mt,typeof h=="function"?h:Ir)}function kN(l,a,u,h,g){if(Gf(l))throw Error(i(485));if(l=a.action,l!==null){var x={payload:g,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){x.listeners.push(w)}};I.T!==null?u(!0):x.isTransition=!1,h(x),u=a.pending,u===null?(x.next=a.pending=x,pw(a,x)):(x.next=u.next,a.pending=u.next=x)}}function pw(l,a){var u=a.action,h=a.payload,g=l.state;if(a.isTransition){var x=I.T,w={};I.T=w;try{var C=u(g,h),D=I.S;D!==null&&D(w,C),mw(l,a,C)}catch(V){xg(l,a,V)}finally{x!==null&&w.types!==null&&(x.types=w.types),I.T=x}}else try{x=u(g,h),mw(l,a,x)}catch(V){xg(l,a,V)}}function mw(l,a,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){gw(l,a,h)},function(h){return xg(l,a,h)}):gw(l,a,u)}function gw(l,a,u){a.status="fulfilled",a.value=u,yw(a),l.state=u,a=l.pending,a!==null&&(u=a.next,u===a?l.pending=null:(u=u.next,a.next=u,pw(l,u)))}function xg(l,a,u){var h=l.pending;if(l.pending=null,h!==null){h=h.next;do a.status="rejected",a.reason=u,yw(a),a=a.next;while(a!==h)}l.action=null}function yw(l){l=l.listeners;for(var a=0;a<l.length;a++)(0,l[a])()}function bw(l,a){return a}function xw(l,a){if(tt){var u=St.formState;if(u!==null){e:{var h=Be;if(tt){if(At){t:{for(var g=At,x=Mi;g.nodeType!==8;){if(!x){g=null;break t}if(g=_i(g.nextSibling),g===null){g=null;break t}}x=g.data,g=x==="F!"||x==="F"?g:null}if(g){At=_i(g.nextSibling),h=g.data==="F!";break e}}ps(h)}h=!1}h&&(a=u[0])}}return u=In(),u.memoizedState=u.baseState=a,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bw,lastRenderedState:a},u.queue=h,u=jw.bind(null,Be,h),h.dispatch=u,h=bg(!1),x=Eg.bind(null,Be,!1,h.queue),h=In(),g={state:a,dispatch:null,action:l,pending:null},h.queue=g,u=kN.bind(null,Be,g,x,u),g.dispatch=u,h.memoizedState=l,[a,u,!1]}function Sw(l){var a=Pt();return ww(a,mt,l)}function ww(l,a,u){if(a=gg(l,a,bw)[0],l=qf(Ir)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var h=yc(a)}catch(w){throw w===Do?Lf:w}else h=a;a=Pt();var g=a.queue,x=g.dispatch;return u!==a.memoizedState&&(Be.flags|=2048,Io(9,{destroy:void 0},CN.bind(null,g,u),null)),[h,x,l]}function CN(l,a){l.action=a}function vw(l){var a=Pt(),u=mt;if(u!==null)return ww(a,u,l);Pt(),a=a.memoizedState,u=Pt();var h=u.queue.dispatch;return u.memoizedState=l,[a,h,!1]}function Io(l,a,u,h){return l={tag:l,create:u,deps:h,inst:a,next:null},a=Be.updateQueue,a===null&&(a=$f(),Be.updateQueue=a),u=a.lastEffect,u===null?a.lastEffect=l.next=l:(h=u.next,u.next=l,l.next=h,a.lastEffect=l),l}function kw(){return Pt().memoizedState}function Yf(l,a,u,h){var g=In();Be.flags|=l,g.memoizedState=Io(1|a,{destroy:void 0},u,h===void 0?null:h)}function Kf(l,a,u,h){var g=Pt();h=h===void 0?null:h;var x=g.memoizedState.inst;mt!==null&&h!==null&&ug(h,mt.memoizedState.deps)?g.memoizedState=Io(a,x,u,h):(Be.flags|=l,g.memoizedState=Io(1|a,x,u,h))}function Cw(l,a){Yf(8390656,8,l,a)}function Sg(l,a){Kf(2048,8,l,a)}function EN(l){Be.flags|=4;var a=Be.updateQueue;if(a===null)a=$f(),Be.updateQueue=a,a.events=[l];else{var u=a.events;u===null?a.events=[l]:u.push(l)}}function Ew(l){var a=Pt().memoizedState;return EN({ref:a,nextImpl:l}),function(){if((ot&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}function Tw(l,a){return Kf(4,2,l,a)}function Aw(l,a){return Kf(4,4,l,a)}function Mw(l,a){if(typeof a=="function"){l=l();var u=a(l);return function(){typeof u=="function"?u():a(null)}}if(a!=null)return l=l(),a.current=l,function(){a.current=null}}function Ow(l,a,u){u=u!=null?u.concat([l]):null,Kf(4,4,Mw.bind(null,a,l),u)}function wg(){}function _w(l,a){var u=Pt();a=a===void 0?null:a;var h=u.memoizedState;return a!==null&&ug(a,h[1])?h[0]:(u.memoizedState=[l,a],l)}function Dw(l,a){var u=Pt();a=a===void 0?null:a;var h=u.memoizedState;if(a!==null&&ug(a,h[1]))return h[0];if(h=l(),Tl){qn(!0);try{l()}finally{qn(!1)}}return u.memoizedState=[h,a],h}function vg(l,a,u){return u===void 0||(Lr&1073741824)!==0&&(We&261930)===0?l.memoizedState=a:(l.memoizedState=u,l=Nv(),Be.lanes|=l,ks|=l,u)}function Nw(l,a,u,h){return ai(u,a)?u:Ro.current!==null?(l=vg(l,u,h),ai(l,a)||(Yt=!0),l):(Lr&42)===0||(Lr&1073741824)!==0&&(We&261930)===0?(Yt=!0,l.memoizedState=u):(l=Nv(),Be.lanes|=l,ks|=l,a)}function Rw(l,a,u,h,g){var x=K.p;K.p=x!==0&&8>x?x:8;var w=I.T,C={};I.T=C,Eg(l,!1,a,u);try{var D=g(),V=I.S;if(V!==null&&V(C,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var G=SN(D,h);bc(l,a,G,pi(l))}else bc(l,a,h,pi(l))}catch(X){bc(l,a,{then:function(){},status:"rejected",reason:X},pi())}finally{K.p=x,w!==null&&C.types!==null&&(w.types=C.types),I.T=w}}function TN(){}function kg(l,a,u,h){if(l.tag!==5)throw Error(i(476));var g=zw(l).queue;Rw(l,g,a,pe,u===null?TN:function(){return Lw(l),u(h)})}function zw(l){var a=l.memoizedState;if(a!==null)return a;a={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:pe},next:null};var u={};return a.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:u},next:null},l.memoizedState=a,l=l.alternate,l!==null&&(l.memoizedState=a),a}function Lw(l){var a=zw(l);a.next===null&&(a=l.alternate.memoizedState),bc(l,a.next.queue,{},pi())}function Cg(){return yn(Lc)}function Iw(){return Pt().memoizedState}function Bw(){return Pt().memoizedState}function AN(l){for(var a=l.return;a!==null;){switch(a.tag){case 24:case 3:var u=pi();l=ys(u);var h=bs(a,l,u);h!==null&&(Wn(h,a,u),hc(h,a,u)),a={cache:Qm()},l.payload=a;return}a=a.return}}function MN(l,a,u){var h=pi();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Gf(l)?Uw(a,u):(u=Pm(l,a,u,h),u!==null&&(Wn(u,l,h),Hw(u,a,h)))}function jw(l,a,u){var h=pi();bc(l,a,u,h)}function bc(l,a,u,h){var g={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Gf(l))Uw(a,g);else{var x=l.alternate;if(l.lanes===0&&(x===null||x.lanes===0)&&(x=a.lastRenderedReducer,x!==null))try{var w=a.lastRenderedState,C=x(w,u);if(g.hasEagerState=!0,g.eagerState=C,ai(C,w))return Mf(l,a,g,0),St===null&&Af(),!1}catch{}finally{}if(u=Pm(l,a,g,h),u!==null)return Wn(u,l,h),Hw(u,a,h),!0}return!1}function Eg(l,a,u,h){if(h={lane:2,revertLane:iy(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Gf(l)){if(a)throw Error(i(479))}else a=Pm(l,u,h,2),a!==null&&Wn(a,l,2)}function Gf(l){var a=l.alternate;return l===Be||a!==null&&a===Be}function Uw(l,a){zo=Vf=!0;var u=l.pending;u===null?a.next=a:(a.next=u.next,u.next=a),l.pending=a}function Hw(l,a,u){if((u&4194048)!==0){var h=a.lanes;h&=l.pendingLanes,u|=h,a.lanes=u,qx(l,u)}}var xc={readContext:yn,use:Ff,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt};xc.useEffectEvent=zt;var Vw={readContext:yn,use:Ff,useCallback:function(l,a){return In().memoizedState=[l,a===void 0?null:a],l},useContext:yn,useEffect:Cw,useImperativeHandle:function(l,a,u){u=u!=null?u.concat([l]):null,Yf(4194308,4,Mw.bind(null,a,l),u)},useLayoutEffect:function(l,a){return Yf(4194308,4,l,a)},useInsertionEffect:function(l,a){Yf(4,2,l,a)},useMemo:function(l,a){var u=In();a=a===void 0?null:a;var h=l();if(Tl){qn(!0);try{l()}finally{qn(!1)}}return u.memoizedState=[h,a],h},useReducer:function(l,a,u){var h=In();if(u!==void 0){var g=u(a);if(Tl){qn(!0);try{u(a)}finally{qn(!1)}}}else g=a;return h.memoizedState=h.baseState=g,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:g},h.queue=l,l=l.dispatch=MN.bind(null,Be,l),[h.memoizedState,l]},useRef:function(l){var a=In();return l={current:l},a.memoizedState=l},useState:function(l){l=bg(l);var a=l.queue,u=jw.bind(null,Be,a);return a.dispatch=u,[l.memoizedState,u]},useDebugValue:wg,useDeferredValue:function(l,a){var u=In();return vg(u,l,a)},useTransition:function(){var l=bg(!1);return l=Rw.bind(null,Be,l.queue,!0,!1),In().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,a,u){var h=Be,g=In();if(tt){if(u===void 0)throw Error(i(407));u=u()}else{if(u=a(),St===null)throw Error(i(349));(We&127)!==0||aw(h,a,u)}g.memoizedState=u;var x={value:u,getSnapshot:a};return g.queue=x,Cw(uw.bind(null,h,x,l),[l]),h.flags|=2048,Io(9,{destroy:void 0},cw.bind(null,h,x,u,a),null),u},useId:function(){var l=In(),a=St.identifierPrefix;if(tt){var u=or,h=lr;u=(h&~(1<<32-xt(h)-1)).toString(32)+u,a="_"+a+"R_"+u,u=Pf++,0<u&&(a+="H"+u.toString(32)),a+="_"}else u=wN++,a="_"+a+"r_"+u.toString(32)+"_";return l.memoizedState=a},useHostTransitionStatus:Cg,useFormState:xw,useActionState:xw,useOptimistic:function(l){var a=In();a.memoizedState=a.baseState=l;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=u,a=Eg.bind(null,Be,!0,u),u.dispatch=a,[l,a]},useMemoCache:mg,useCacheRefresh:function(){return In().memoizedState=AN.bind(null,Be)},useEffectEvent:function(l){var a=In(),u={impl:l};return a.memoizedState=u,function(){if((ot&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}},Tg={readContext:yn,use:Ff,useCallback:_w,useContext:yn,useEffect:Sg,useImperativeHandle:Ow,useInsertionEffect:Tw,useLayoutEffect:Aw,useMemo:Dw,useReducer:qf,useRef:kw,useState:function(){return qf(Ir)},useDebugValue:wg,useDeferredValue:function(l,a){var u=Pt();return Nw(u,mt.memoizedState,l,a)},useTransition:function(){var l=qf(Ir)[0],a=Pt().memoizedState;return[typeof l=="boolean"?l:yc(l),a]},useSyncExternalStore:ow,useId:Iw,useHostTransitionStatus:Cg,useFormState:Sw,useActionState:Sw,useOptimistic:function(l,a){var u=Pt();return hw(u,mt,l,a)},useMemoCache:mg,useCacheRefresh:Bw};Tg.useEffectEvent=Ew;var Pw={readContext:yn,use:Ff,useCallback:_w,useContext:yn,useEffect:Sg,useImperativeHandle:Ow,useInsertionEffect:Tw,useLayoutEffect:Aw,useMemo:Dw,useReducer:yg,useRef:kw,useState:function(){return yg(Ir)},useDebugValue:wg,useDeferredValue:function(l,a){var u=Pt();return mt===null?vg(u,l,a):Nw(u,mt.memoizedState,l,a)},useTransition:function(){var l=yg(Ir)[0],a=Pt().memoizedState;return[typeof l=="boolean"?l:yc(l),a]},useSyncExternalStore:ow,useId:Iw,useHostTransitionStatus:Cg,useFormState:vw,useActionState:vw,useOptimistic:function(l,a){var u=Pt();return mt!==null?hw(u,mt,l,a):(u.baseState=l,[l,u.queue.dispatch])},useMemoCache:mg,useCacheRefresh:Bw};Pw.useEffectEvent=Ew;function Ag(l,a,u,h){a=l.memoizedState,u=u(h,a),u=u==null?a:m({},a,u),l.memoizedState=u,l.lanes===0&&(l.updateQueue.baseState=u)}var Mg={enqueueSetState:function(l,a,u){l=l._reactInternals;var h=pi(),g=ys(h);g.payload=a,u!=null&&(g.callback=u),a=bs(l,g,h),a!==null&&(Wn(a,l,h),hc(a,l,h))},enqueueReplaceState:function(l,a,u){l=l._reactInternals;var h=pi(),g=ys(h);g.tag=1,g.payload=a,u!=null&&(g.callback=u),a=bs(l,g,h),a!==null&&(Wn(a,l,h),hc(a,l,h))},enqueueForceUpdate:function(l,a){l=l._reactInternals;var u=pi(),h=ys(u);h.tag=2,a!=null&&(h.callback=a),a=bs(l,h,u),a!==null&&(Wn(a,l,u),hc(a,l,u))}};function $w(l,a,u,h,g,x,w){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(h,x,w):a.prototype&&a.prototype.isPureReactComponent?!sc(u,h)||!sc(g,x):!0}function Fw(l,a,u,h){l=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(u,h),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(u,h),a.state!==l&&Mg.enqueueReplaceState(a,a.state,null)}function Al(l,a){var u=a;if("ref"in a){u={};for(var h in a)h!=="ref"&&(u[h]=a[h])}if(l=l.defaultProps){u===a&&(u=m({},u));for(var g in l)u[g]===void 0&&(u[g]=l[g])}return u}function qw(l){Tf(l)}function Yw(l){console.error(l)}function Kw(l){Tf(l)}function Zf(l,a){try{var u=l.onUncaughtError;u(a.value,{componentStack:a.stack})}catch(h){setTimeout(function(){throw h})}}function Gw(l,a,u){try{var h=l.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Og(l,a,u){return u=ys(u),u.tag=3,u.payload={element:null},u.callback=function(){Zf(l,a)},u}function Zw(l){return l=ys(l),l.tag=3,l}function Jw(l,a,u,h){var g=u.type.getDerivedStateFromError;if(typeof g=="function"){var x=h.value;l.payload=function(){return g(x)},l.callback=function(){Gw(a,u,h)}}var w=u.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(l.callback=function(){Gw(a,u,h),typeof g!="function"&&(Cs===null?Cs=new Set([this]):Cs.add(this));var C=h.stack;this.componentDidCatch(h.value,{componentStack:C!==null?C:""})})}function ON(l,a,u,h,g){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(a=u.alternate,a!==null&&Mo(a,u,g,!0),u=ui.current,u!==null){switch(u.tag){case 31:case 13:return Oi===null?od():u.alternate===null&&Lt===0&&(Lt=3),u.flags&=-257,u.flags|=65536,u.lanes=g,h===If?u.flags|=16384:(a=u.updateQueue,a===null?u.updateQueue=new Set([h]):a.add(h),ey(l,h,g)),!1;case 22:return u.flags|=65536,h===If?u.flags|=16384:(a=u.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=a):(u=a.retryQueue,u===null?a.retryQueue=new Set([h]):u.add(h)),ey(l,h,g)),!1}throw Error(i(435,u.tag))}return ey(l,h,g),od(),!1}if(tt)return a=ui.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=g,h!==Gm&&(l=Error(i(422),{cause:h}),ac(Ei(l,u)))):(h!==Gm&&(a=Error(i(423),{cause:h}),ac(Ei(a,u))),l=l.current.alternate,l.flags|=65536,g&=-g,l.lanes|=g,h=Ei(h,u),g=Og(l.stateNode,h,g),sg(l,g),Lt!==4&&(Lt=2)),!1;var x=Error(i(520),{cause:h});if(x=Ei(x,u),Ac===null?Ac=[x]:Ac.push(x),Lt!==4&&(Lt=2),a===null)return!0;h=Ei(h,u),u=a;do{switch(u.tag){case 3:return u.flags|=65536,l=g&-g,u.lanes|=l,l=Og(u.stateNode,h,l),sg(u,l),!1;case 1:if(a=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Cs===null||!Cs.has(x))))return u.flags|=65536,g&=-g,u.lanes|=g,g=Zw(g),Jw(g,l,u,h),sg(u,g),!1}u=u.return}while(u!==null);return!1}var _g=Error(i(461)),Yt=!1;function bn(l,a,u,h){a.child=l===null?ew(a,null,u,h):El(a,l.child,u,h)}function Xw(l,a,u,h,g){u=u.render;var x=a.ref;if("ref"in h){var w={};for(var C in h)C!=="ref"&&(w[C]=h[C])}else w=h;return wl(a),h=fg(l,a,u,w,x,g),C=dg(),l!==null&&!Yt?(hg(l,a,g),Br(l,a,g)):(tt&&C&&Ym(a),a.flags|=1,bn(l,a,h,g),a.child)}function Ww(l,a,u,h,g){if(l===null){var x=u.type;return typeof x=="function"&&!$m(x)&&x.defaultProps===void 0&&u.compare===null?(a.tag=15,a.type=x,Qw(l,a,x,h,g)):(l=_f(u.type,null,h,a,a.mode,g),l.ref=a.ref,l.return=a,a.child=l)}if(x=l.child,!jg(l,g)){var w=x.memoizedProps;if(u=u.compare,u=u!==null?u:sc,u(w,h)&&l.ref===a.ref)return Br(l,a,g)}return a.flags|=1,l=Dr(x,h),l.ref=a.ref,l.return=a,a.child=l}function Qw(l,a,u,h,g){if(l!==null){var x=l.memoizedProps;if(sc(x,h)&&l.ref===a.ref)if(Yt=!1,a.pendingProps=h=x,jg(l,g))(l.flags&131072)!==0&&(Yt=!0);else return a.lanes=l.lanes,Br(l,a,g)}return Dg(l,a,u,h,g)}function ev(l,a,u,h){var g=h.children,x=l!==null?l.memoizedState:null;if(l===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((a.flags&128)!==0){if(x=x!==null?x.baseLanes|u:u,l!==null){for(h=a.child=l.child,g=0;h!==null;)g=g|h.lanes|h.childLanes,h=h.sibling;h=g&~x}else h=0,a.child=null;return tv(l,a,x,u,h)}if((u&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},l!==null&&zf(a,x!==null?x.cachePool:null),x!==null?iw(a,x):og(),rw(a);else return h=a.lanes=536870912,tv(l,a,x!==null?x.baseLanes|u:u,u,h)}else x!==null?(zf(a,x.cachePool),iw(a,x),Ss(),a.memoizedState=null):(l!==null&&zf(a,null),og(),Ss());return bn(l,a,g,u),a.child}function Sc(l,a){return l!==null&&l.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function tv(l,a,u,h,g){var x=tg();return x=x===null?null:{parent:Ft._currentValue,pool:x},a.memoizedState={baseLanes:u,cachePool:x},l!==null&&zf(a,null),og(),rw(a),l!==null&&Mo(l,a,h,!0),a.childLanes=g,null}function Jf(l,a){return a=Wf({mode:a.mode,children:a.children},l.mode),a.ref=l.ref,l.child=a,a.return=l,a}function nv(l,a,u){return El(a,l.child,null,u),l=Jf(a,a.pendingProps),l.flags|=2,fi(a),a.memoizedState=null,l}function _N(l,a,u){var h=a.pendingProps,g=(a.flags&128)!==0;if(a.flags&=-129,l===null){if(tt){if(h.mode==="hidden")return l=Jf(a,h),a.lanes=536870912,Sc(null,l);if(cg(a),(l=At)?(l=pk(l,Mi),l=l!==null&&l.data==="&"?l:null,l!==null&&(a.memoizedState={dehydrated:l,treeContext:ds!==null?{id:lr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},u=US(l),u.return=a,a.child=u,gn=a,At=null)):l=null,l===null)throw ps(a);return a.lanes=536870912,null}return Jf(a,h)}var x=l.memoizedState;if(x!==null){var w=x.dehydrated;if(cg(a),g)if(a.flags&256)a.flags&=-257,a=nv(l,a,u);else if(a.memoizedState!==null)a.child=l.child,a.flags|=128,a=null;else throw Error(i(558));else if(Yt||Mo(l,a,u,!1),g=(u&l.childLanes)!==0,Yt||g){if(h=St,h!==null&&(w=Yx(h,u),w!==0&&w!==x.retryLane))throw x.retryLane=w,yl(l,w),Wn(h,l,w),_g;od(),a=nv(l,a,u)}else l=x.treeContext,At=_i(w.nextSibling),gn=a,tt=!0,hs=null,Mi=!1,l!==null&&PS(a,l),a=Jf(a,h),a.flags|=4096;return a}return l=Dr(l.child,{mode:h.mode,children:h.children}),l.ref=a.ref,a.child=l,l.return=a,l}function Xf(l,a){var u=a.ref;if(u===null)l!==null&&l.ref!==null&&(a.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(i(284));(l===null||l.ref!==u)&&(a.flags|=4194816)}}function Dg(l,a,u,h,g){return wl(a),u=fg(l,a,u,h,void 0,g),h=dg(),l!==null&&!Yt?(hg(l,a,g),Br(l,a,g)):(tt&&h&&Ym(a),a.flags|=1,bn(l,a,u,g),a.child)}function iv(l,a,u,h,g,x){return wl(a),a.updateQueue=null,u=lw(a,h,u,g),sw(l),h=dg(),l!==null&&!Yt?(hg(l,a,x),Br(l,a,x)):(tt&&h&&Ym(a),a.flags|=1,bn(l,a,u,x),a.child)}function rv(l,a,u,h,g){if(wl(a),a.stateNode===null){var x=Co,w=u.contextType;typeof w=="object"&&w!==null&&(x=yn(w)),x=new u(h,x),a.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Mg,a.stateNode=x,x._reactInternals=a,x=a.stateNode,x.props=h,x.state=a.memoizedState,x.refs={},ig(a),w=u.contextType,x.context=typeof w=="object"&&w!==null?yn(w):Co,x.state=a.memoizedState,w=u.getDerivedStateFromProps,typeof w=="function"&&(Ag(a,u,w,h),x.state=a.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(w=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),w!==x.state&&Mg.enqueueReplaceState(x,x.state,null),mc(a,h,x,g),pc(),x.state=a.memoizedState),typeof x.componentDidMount=="function"&&(a.flags|=4194308),h=!0}else if(l===null){x=a.stateNode;var C=a.memoizedProps,D=Al(u,C);x.props=D;var V=x.context,G=u.contextType;w=Co,typeof G=="object"&&G!==null&&(w=yn(G));var X=u.getDerivedStateFromProps;G=typeof X=="function"||typeof x.getSnapshotBeforeUpdate=="function",C=a.pendingProps!==C,G||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(C||V!==w)&&Fw(a,x,h,w),gs=!1;var $=a.memoizedState;x.state=$,mc(a,h,x,g),pc(),V=a.memoizedState,C||$!==V||gs?(typeof X=="function"&&(Ag(a,u,X,h),V=a.memoizedState),(D=gs||$w(a,u,D,h,$,V,w))?(G||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(a.flags|=4194308)):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=h,a.memoizedState=V),x.props=h,x.state=V,x.context=w,h=D):(typeof x.componentDidMount=="function"&&(a.flags|=4194308),h=!1)}else{x=a.stateNode,rg(l,a),w=a.memoizedProps,G=Al(u,w),x.props=G,X=a.pendingProps,$=x.context,V=u.contextType,D=Co,typeof V=="object"&&V!==null&&(D=yn(V)),C=u.getDerivedStateFromProps,(V=typeof C=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(w!==X||$!==D)&&Fw(a,x,h,D),gs=!1,$=a.memoizedState,x.state=$,mc(a,h,x,g),pc();var q=a.memoizedState;w!==X||$!==q||gs||l!==null&&l.dependencies!==null&&Nf(l.dependencies)?(typeof C=="function"&&(Ag(a,u,C,h),q=a.memoizedState),(G=gs||$w(a,u,G,h,$,q,D)||l!==null&&l.dependencies!==null&&Nf(l.dependencies))?(V||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(h,q,D),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(h,q,D)),typeof x.componentDidUpdate=="function"&&(a.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof x.componentDidUpdate!="function"||w===l.memoizedProps&&$===l.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===l.memoizedProps&&$===l.memoizedState||(a.flags|=1024),a.memoizedProps=h,a.memoizedState=q),x.props=h,x.state=q,x.context=D,h=G):(typeof x.componentDidUpdate!="function"||w===l.memoizedProps&&$===l.memoizedState||(a.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===l.memoizedProps&&$===l.memoizedState||(a.flags|=1024),h=!1)}return x=h,Xf(l,a),h=(a.flags&128)!==0,x||h?(x=a.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:x.render(),a.flags|=1,l!==null&&h?(a.child=El(a,l.child,null,g),a.child=El(a,null,u,g)):bn(l,a,u,g),a.memoizedState=x.state,l=a.child):l=Br(l,a,g),l}function sv(l,a,u,h){return xl(),a.flags|=256,bn(l,a,u,h),a.child}var Ng={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rg(l){return{baseLanes:l,cachePool:GS()}}function zg(l,a,u){return l=l!==null?l.childLanes&~u:0,a&&(l|=hi),l}function lv(l,a,u){var h=a.pendingProps,g=!1,x=(a.flags&128)!==0,w;if((w=x)||(w=l!==null&&l.memoizedState===null?!1:(Vt.current&2)!==0),w&&(g=!0,a.flags&=-129),w=(a.flags&32)!==0,a.flags&=-33,l===null){if(tt){if(g?xs(a):Ss(),(l=At)?(l=pk(l,Mi),l=l!==null&&l.data!=="&"?l:null,l!==null&&(a.memoizedState={dehydrated:l,treeContext:ds!==null?{id:lr,overflow:or}:null,retryLane:536870912,hydrationErrors:null},u=US(l),u.return=a,a.child=u,gn=a,At=null)):l=null,l===null)throw ps(a);return gy(l)?a.lanes=32:a.lanes=536870912,null}var C=h.children;return h=h.fallback,g?(Ss(),g=a.mode,C=Wf({mode:"hidden",children:C},g),h=bl(h,g,u,null),C.return=a,h.return=a,C.sibling=h,a.child=C,h=a.child,h.memoizedState=Rg(u),h.childLanes=zg(l,w,u),a.memoizedState=Ng,Sc(null,h)):(xs(a),Lg(a,C))}var D=l.memoizedState;if(D!==null&&(C=D.dehydrated,C!==null)){if(x)a.flags&256?(xs(a),a.flags&=-257,a=Ig(l,a,u)):a.memoizedState!==null?(Ss(),a.child=l.child,a.flags|=128,a=null):(Ss(),C=h.fallback,g=a.mode,h=Wf({mode:"visible",children:h.children},g),C=bl(C,g,u,null),C.flags|=2,h.return=a,C.return=a,h.sibling=C,a.child=h,El(a,l.child,null,u),h=a.child,h.memoizedState=Rg(u),h.childLanes=zg(l,w,u),a.memoizedState=Ng,a=Sc(null,h));else if(xs(a),gy(C)){if(w=C.nextSibling&&C.nextSibling.dataset,w)var V=w.dgst;w=V,h=Error(i(419)),h.stack="",h.digest=w,ac({value:h,source:null,stack:null}),a=Ig(l,a,u)}else if(Yt||Mo(l,a,u,!1),w=(u&l.childLanes)!==0,Yt||w){if(w=St,w!==null&&(h=Yx(w,u),h!==0&&h!==D.retryLane))throw D.retryLane=h,yl(l,h),Wn(w,l,h),_g;my(C)||od(),a=Ig(l,a,u)}else my(C)?(a.flags|=192,a.child=l.child,a=null):(l=D.treeContext,At=_i(C.nextSibling),gn=a,tt=!0,hs=null,Mi=!1,l!==null&&PS(a,l),a=Lg(a,h.children),a.flags|=4096);return a}return g?(Ss(),C=h.fallback,g=a.mode,D=l.child,V=D.sibling,h=Dr(D,{mode:"hidden",children:h.children}),h.subtreeFlags=D.subtreeFlags&65011712,V!==null?C=Dr(V,C):(C=bl(C,g,u,null),C.flags|=2),C.return=a,h.return=a,h.sibling=C,a.child=h,Sc(null,h),h=a.child,C=l.child.memoizedState,C===null?C=Rg(u):(g=C.cachePool,g!==null?(D=Ft._currentValue,g=g.parent!==D?{parent:D,pool:D}:g):g=GS(),C={baseLanes:C.baseLanes|u,cachePool:g}),h.memoizedState=C,h.childLanes=zg(l,w,u),a.memoizedState=Ng,Sc(l.child,h)):(xs(a),u=l.child,l=u.sibling,u=Dr(u,{mode:"visible",children:h.children}),u.return=a,u.sibling=null,l!==null&&(w=a.deletions,w===null?(a.deletions=[l],a.flags|=16):w.push(l)),a.child=u,a.memoizedState=null,u)}function Lg(l,a){return a=Wf({mode:"visible",children:a},l.mode),a.return=l,l.child=a}function Wf(l,a){return l=ci(22,l,null,a),l.lanes=0,l}function Ig(l,a,u){return El(a,l.child,null,u),l=Lg(a,a.pendingProps.children),l.flags|=2,a.memoizedState=null,l}function ov(l,a,u){l.lanes|=a;var h=l.alternate;h!==null&&(h.lanes|=a),Xm(l.return,a,u)}function Bg(l,a,u,h,g,x){var w=l.memoizedState;w===null?l.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:g,treeForkCount:x}:(w.isBackwards=a,w.rendering=null,w.renderingStartTime=0,w.last=h,w.tail=u,w.tailMode=g,w.treeForkCount=x)}function av(l,a,u){var h=a.pendingProps,g=h.revealOrder,x=h.tail;h=h.children;var w=Vt.current,C=(w&2)!==0;if(C?(w=w&1|2,a.flags|=128):w&=1,T(Vt,w),bn(l,a,h,u),h=tt?oc:0,!C&&l!==null&&(l.flags&128)!==0)e:for(l=a.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&ov(l,u,a);else if(l.tag===19)ov(l,u,a);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(g){case"forwards":for(u=a.child,g=null;u!==null;)l=u.alternate,l!==null&&Hf(l)===null&&(g=u),u=u.sibling;u=g,u===null?(g=a.child,a.child=null):(g=u.sibling,u.sibling=null),Bg(a,!1,g,u,x,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,g=a.child,a.child=null;g!==null;){if(l=g.alternate,l!==null&&Hf(l)===null){a.child=g;break}l=g.sibling,g.sibling=u,u=g,g=l}Bg(a,!0,u,null,x,h);break;case"together":Bg(a,!1,null,null,void 0,h);break;default:a.memoizedState=null}return a.child}function Br(l,a,u){if(l!==null&&(a.dependencies=l.dependencies),ks|=a.lanes,(u&a.childLanes)===0)if(l!==null){if(Mo(l,a,u,!1),(u&a.childLanes)===0)return null}else return null;if(l!==null&&a.child!==l.child)throw Error(i(153));if(a.child!==null){for(l=a.child,u=Dr(l,l.pendingProps),a.child=u,u.return=a;l.sibling!==null;)l=l.sibling,u=u.sibling=Dr(l,l.pendingProps),u.return=a;u.sibling=null}return a.child}function jg(l,a){return(l.lanes&a)!==0?!0:(l=l.dependencies,!!(l!==null&&Nf(l)))}function DN(l,a,u){switch(a.tag){case 3:Ge(a,a.stateNode.containerInfo),ms(a,Ft,l.memoizedState.cache),xl();break;case 27:case 5:ct(a);break;case 4:Ge(a,a.stateNode.containerInfo);break;case 10:ms(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,cg(a),null;break;case 13:var h=a.memoizedState;if(h!==null)return h.dehydrated!==null?(xs(a),a.flags|=128,null):(u&a.child.childLanes)!==0?lv(l,a,u):(xs(a),l=Br(l,a,u),l!==null?l.sibling:null);xs(a);break;case 19:var g=(l.flags&128)!==0;if(h=(u&a.childLanes)!==0,h||(Mo(l,a,u,!1),h=(u&a.childLanes)!==0),g){if(h)return av(l,a,u);a.flags|=128}if(g=a.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),T(Vt,Vt.current),h)break;return null;case 22:return a.lanes=0,ev(l,a,u,a.pendingProps);case 24:ms(a,Ft,l.memoizedState.cache)}return Br(l,a,u)}function cv(l,a,u){if(l!==null)if(l.memoizedProps!==a.pendingProps)Yt=!0;else{if(!jg(l,u)&&(a.flags&128)===0)return Yt=!1,DN(l,a,u);Yt=(l.flags&131072)!==0}else Yt=!1,tt&&(a.flags&1048576)!==0&&VS(a,oc,a.index);switch(a.lanes=0,a.tag){case 16:e:{var h=a.pendingProps;if(l=kl(a.elementType),a.type=l,typeof l=="function")$m(l)?(h=Al(l,h),a.tag=1,a=rv(null,a,l,h,u)):(a.tag=0,a=Dg(null,a,l,h,u));else{if(l!=null){var g=l.$$typeof;if(g===re){a.tag=11,a=Xw(null,a,l,h,u);break e}else if(g===z){a.tag=14,a=Ww(null,a,l,h,u);break e}}throw a=ie(l)||l,Error(i(306,a,""))}}return a;case 0:return Dg(l,a,a.type,a.pendingProps,u);case 1:return h=a.type,g=Al(h,a.pendingProps),rv(l,a,h,g,u);case 3:e:{if(Ge(a,a.stateNode.containerInfo),l===null)throw Error(i(387));h=a.pendingProps;var x=a.memoizedState;g=x.element,rg(l,a),mc(a,h,null,u);var w=a.memoizedState;if(h=w.cache,ms(a,Ft,h),h!==x.cache&&Wm(a,[Ft],u,!0),pc(),h=w.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:w.cache},a.updateQueue.baseState=x,a.memoizedState=x,a.flags&256){a=sv(l,a,h,u);break e}else if(h!==g){g=Ei(Error(i(424)),a),ac(g),a=sv(l,a,h,u);break e}else{switch(l=a.stateNode.containerInfo,l.nodeType){case 9:l=l.body;break;default:l=l.nodeName==="HTML"?l.ownerDocument.body:l}for(At=_i(l.firstChild),gn=a,tt=!0,hs=null,Mi=!0,u=ew(a,null,h,u),a.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(xl(),h===g){a=Br(l,a,u);break e}bn(l,a,h,u)}a=a.child}return a;case 26:return Xf(l,a),l===null?(u=Sk(a.type,null,a.pendingProps,null))?a.memoizedState=u:tt||(u=a.type,l=a.pendingProps,h=pd(ge.current).createElement(u),h[mn]=a,h[Yn]=l,xn(h,u,l),rn(h),a.stateNode=h):a.memoizedState=Sk(a.type,l.memoizedProps,a.pendingProps,l.memoizedState),null;case 27:return ct(a),l===null&&tt&&(h=a.stateNode=yk(a.type,a.pendingProps,ge.current),gn=a,Mi=!0,g=At,Ms(a.type)?(yy=g,At=_i(h.firstChild)):At=g),bn(l,a,a.pendingProps.children,u),Xf(l,a),l===null&&(a.flags|=4194304),a.child;case 5:return l===null&&tt&&((g=h=At)&&(h=oR(h,a.type,a.pendingProps,Mi),h!==null?(a.stateNode=h,gn=a,At=_i(h.firstChild),Mi=!1,g=!0):g=!1),g||ps(a)),ct(a),g=a.type,x=a.pendingProps,w=l!==null?l.memoizedProps:null,h=x.children,dy(g,x)?h=null:w!==null&&dy(g,w)&&(a.flags|=32),a.memoizedState!==null&&(g=fg(l,a,vN,null,null,u),Lc._currentValue=g),Xf(l,a),bn(l,a,h,u),a.child;case 6:return l===null&&tt&&((l=u=At)&&(u=aR(u,a.pendingProps,Mi),u!==null?(a.stateNode=u,gn=a,At=null,l=!0):l=!1),l||ps(a)),null;case 13:return lv(l,a,u);case 4:return Ge(a,a.stateNode.containerInfo),h=a.pendingProps,l===null?a.child=El(a,null,h,u):bn(l,a,h,u),a.child;case 11:return Xw(l,a,a.type,a.pendingProps,u);case 7:return bn(l,a,a.pendingProps,u),a.child;case 8:return bn(l,a,a.pendingProps.children,u),a.child;case 12:return bn(l,a,a.pendingProps.children,u),a.child;case 10:return h=a.pendingProps,ms(a,a.type,h.value),bn(l,a,h.children,u),a.child;case 9:return g=a.type._context,h=a.pendingProps.children,wl(a),g=yn(g),h=h(g),a.flags|=1,bn(l,a,h,u),a.child;case 14:return Ww(l,a,a.type,a.pendingProps,u);case 15:return Qw(l,a,a.type,a.pendingProps,u);case 19:return av(l,a,u);case 31:return _N(l,a,u);case 22:return ev(l,a,u,a.pendingProps);case 24:return wl(a),h=yn(Ft),l===null?(g=tg(),g===null&&(g=St,x=Qm(),g.pooledCache=x,x.refCount++,x!==null&&(g.pooledCacheLanes|=u),g=x),a.memoizedState={parent:h,cache:g},ig(a),ms(a,Ft,g)):((l.lanes&u)!==0&&(rg(l,a),mc(a,null,null,u),pc()),g=l.memoizedState,x=a.memoizedState,g.parent!==h?(g={parent:h,cache:h},a.memoizedState=g,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=g),ms(a,Ft,h)):(h=x.cache,ms(a,Ft,h),h!==g.cache&&Wm(a,[Ft],u,!0))),bn(l,a,a.pendingProps.children,u),a.child;case 29:throw a.pendingProps}throw Error(i(156,a.tag))}function jr(l){l.flags|=4}function Ug(l,a,u,h,g){if((a=(l.mode&32)!==0)&&(a=!1),a){if(l.flags|=16777216,(g&335544128)===g)if(l.stateNode.complete)l.flags|=8192;else if(Iv())l.flags|=8192;else throw Cl=If,ng}else l.flags&=-16777217}function uv(l,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!Ek(a))if(Iv())l.flags|=8192;else throw Cl=If,ng}function Qf(l,a){a!==null&&(l.flags|=4),l.flags&16384&&(a=l.tag!==22?$x():536870912,l.lanes|=a,Ho|=a)}function wc(l,a){if(!tt)switch(l.tailMode){case"hidden":a=l.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?l.tail=null:u.sibling=null;break;case"collapsed":u=l.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?a||l.tail===null?l.tail=null:l.tail.sibling=null:h.sibling=null}}function Mt(l){var a=l.alternate!==null&&l.alternate.child===l.child,u=0,h=0;if(a)for(var g=l.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags&65011712,h|=g.flags&65011712,g.return=l,g=g.sibling;else for(g=l.child;g!==null;)u|=g.lanes|g.childLanes,h|=g.subtreeFlags,h|=g.flags,g.return=l,g=g.sibling;return l.subtreeFlags|=h,l.childLanes=u,a}function NN(l,a,u){var h=a.pendingProps;switch(Km(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(a),null;case 1:return Mt(a),null;case 3:return u=a.stateNode,h=null,l!==null&&(h=l.memoizedState.cache),a.memoizedState.cache!==h&&(a.flags|=2048),zr(Ft),Fe(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(l===null||l.child===null)&&(Ao(a)?jr(a):l===null||l.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Zm())),Mt(a),null;case 26:var g=a.type,x=a.memoizedState;return l===null?(jr(a),x!==null?(Mt(a),uv(a,x)):(Mt(a),Ug(a,g,null,h,u))):x?x!==l.memoizedState?(jr(a),Mt(a),uv(a,x)):(Mt(a),a.flags&=-16777217):(l=l.memoizedProps,l!==h&&jr(a),Mt(a),Ug(a,g,l,h,u)),null;case 27:if(Ce(a),u=ge.current,g=a.type,l!==null&&a.stateNode!=null)l.memoizedProps!==h&&jr(a);else{if(!h){if(a.stateNode===null)throw Error(i(166));return Mt(a),null}l=ne.current,Ao(a)?$S(a):(l=yk(g,h,u),a.stateNode=l,jr(a))}return Mt(a),null;case 5:if(Ce(a),g=a.type,l!==null&&a.stateNode!=null)l.memoizedProps!==h&&jr(a);else{if(!h){if(a.stateNode===null)throw Error(i(166));return Mt(a),null}if(x=ne.current,Ao(a))$S(a);else{var w=pd(ge.current);switch(x){case 1:x=w.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:x=w.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":x=w.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":x=w.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":x=w.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof h.is=="string"?w.createElement("select",{is:h.is}):w.createElement("select"),h.multiple?x.multiple=!0:h.size&&(x.size=h.size);break;default:x=typeof h.is=="string"?w.createElement(g,{is:h.is}):w.createElement(g)}}x[mn]=a,x[Yn]=h;e:for(w=a.child;w!==null;){if(w.tag===5||w.tag===6)x.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===a)break e;for(;w.sibling===null;){if(w.return===null||w.return===a)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}a.stateNode=x;e:switch(xn(x,g,h),g){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&jr(a)}}return Mt(a),Ug(a,a.type,l===null?null:l.memoizedProps,a.pendingProps,u),null;case 6:if(l&&a.stateNode!=null)l.memoizedProps!==h&&jr(a);else{if(typeof h!="string"&&a.stateNode===null)throw Error(i(166));if(l=ge.current,Ao(a)){if(l=a.stateNode,u=a.memoizedProps,h=null,g=gn,g!==null)switch(g.tag){case 27:case 5:h=g.memoizedProps}l[mn]=a,l=!!(l.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||lk(l.nodeValue,u)),l||ps(a,!0)}else l=pd(l).createTextNode(h),l[mn]=a,a.stateNode=l}return Mt(a),null;case 31:if(u=a.memoizedState,l===null||l.memoizedState!==null){if(h=Ao(a),u!==null){if(l===null){if(!h)throw Error(i(318));if(l=a.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(557));l[mn]=a}else xl(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Mt(a),l=!1}else u=Zm(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=u),l=!0;if(!l)return a.flags&256?(fi(a),a):(fi(a),null);if((a.flags&128)!==0)throw Error(i(558))}return Mt(a),null;case 13:if(h=a.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(g=Ao(a),h!==null&&h.dehydrated!==null){if(l===null){if(!g)throw Error(i(318));if(g=a.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[mn]=a}else xl(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Mt(a),g=!1}else g=Zm(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),g=!0;if(!g)return a.flags&256?(fi(a),a):(fi(a),null)}return fi(a),(a.flags&128)!==0?(a.lanes=u,a):(u=h!==null,l=l!==null&&l.memoizedState!==null,u&&(h=a.child,g=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(g=h.alternate.memoizedState.cachePool.pool),x=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(x=h.memoizedState.cachePool.pool),x!==g&&(h.flags|=2048)),u!==l&&u&&(a.child.flags|=8192),Qf(a,a.updateQueue),Mt(a),null);case 4:return Fe(),l===null&&oy(a.stateNode.containerInfo),Mt(a),null;case 10:return zr(a.type),Mt(a),null;case 19:if(U(Vt),h=a.memoizedState,h===null)return Mt(a),null;if(g=(a.flags&128)!==0,x=h.rendering,x===null)if(g)wc(h,!1);else{if(Lt!==0||l!==null&&(l.flags&128)!==0)for(l=a.child;l!==null;){if(x=Hf(l),x!==null){for(a.flags|=128,wc(h,!1),l=x.updateQueue,a.updateQueue=l,Qf(a,l),a.subtreeFlags=0,l=u,u=a.child;u!==null;)jS(u,l),u=u.sibling;return T(Vt,Vt.current&1|2),tt&&Nr(a,h.treeForkCount),a.child}l=l.sibling}h.tail!==null&&qe()>rd&&(a.flags|=128,g=!0,wc(h,!1),a.lanes=4194304)}else{if(!g)if(l=Hf(x),l!==null){if(a.flags|=128,g=!0,l=l.updateQueue,a.updateQueue=l,Qf(a,l),wc(h,!0),h.tail===null&&h.tailMode==="hidden"&&!x.alternate&&!tt)return Mt(a),null}else 2*qe()-h.renderingStartTime>rd&&u!==536870912&&(a.flags|=128,g=!0,wc(h,!1),a.lanes=4194304);h.isBackwards?(x.sibling=a.child,a.child=x):(l=h.last,l!==null?l.sibling=x:a.child=x,h.last=x)}return h.tail!==null?(l=h.tail,h.rendering=l,h.tail=l.sibling,h.renderingStartTime=qe(),l.sibling=null,u=Vt.current,T(Vt,g?u&1|2:u&1),tt&&Nr(a,h.treeForkCount),l):(Mt(a),null);case 22:case 23:return fi(a),ag(),h=a.memoizedState!==null,l!==null?l.memoizedState!==null!==h&&(a.flags|=8192):h&&(a.flags|=8192),h?(u&536870912)!==0&&(a.flags&128)===0&&(Mt(a),a.subtreeFlags&6&&(a.flags|=8192)):Mt(a),u=a.updateQueue,u!==null&&Qf(a,u.retryQueue),u=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),h=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(h=a.memoizedState.cachePool.pool),h!==u&&(a.flags|=2048),l!==null&&U(vl),null;case 24:return u=null,l!==null&&(u=l.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),zr(Ft),Mt(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function RN(l,a){switch(Km(a),a.tag){case 1:return l=a.flags,l&65536?(a.flags=l&-65537|128,a):null;case 3:return zr(Ft),Fe(),l=a.flags,(l&65536)!==0&&(l&128)===0?(a.flags=l&-65537|128,a):null;case 26:case 27:case 5:return Ce(a),null;case 31:if(a.memoizedState!==null){if(fi(a),a.alternate===null)throw Error(i(340));xl()}return l=a.flags,l&65536?(a.flags=l&-65537|128,a):null;case 13:if(fi(a),l=a.memoizedState,l!==null&&l.dehydrated!==null){if(a.alternate===null)throw Error(i(340));xl()}return l=a.flags,l&65536?(a.flags=l&-65537|128,a):null;case 19:return U(Vt),null;case 4:return Fe(),null;case 10:return zr(a.type),null;case 22:case 23:return fi(a),ag(),l!==null&&U(vl),l=a.flags,l&65536?(a.flags=l&-65537|128,a):null;case 24:return zr(Ft),null;case 25:return null;default:return null}}function fv(l,a){switch(Km(a),a.tag){case 3:zr(Ft),Fe();break;case 26:case 27:case 5:Ce(a);break;case 4:Fe();break;case 31:a.memoizedState!==null&&fi(a);break;case 13:fi(a);break;case 19:U(Vt);break;case 10:zr(a.type);break;case 22:case 23:fi(a),ag(),l!==null&&U(vl);break;case 24:zr(Ft)}}function vc(l,a){try{var u=a.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var g=h.next;u=g;do{if((u.tag&l)===l){h=void 0;var x=u.create,w=u.inst;h=x(),w.destroy=h}u=u.next}while(u!==g)}}catch(C){ht(a,a.return,C)}}function ws(l,a,u){try{var h=a.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var x=g.next;h=x;do{if((h.tag&l)===l){var w=h.inst,C=w.destroy;if(C!==void 0){w.destroy=void 0,g=a;var D=u,V=C;try{V()}catch(G){ht(g,D,G)}}}h=h.next}while(h!==x)}}catch(G){ht(a,a.return,G)}}function dv(l){var a=l.updateQueue;if(a!==null){var u=l.stateNode;try{nw(a,u)}catch(h){ht(l,l.return,h)}}}function hv(l,a,u){u.props=Al(l.type,l.memoizedProps),u.state=l.memoizedState;try{u.componentWillUnmount()}catch(h){ht(l,a,h)}}function kc(l,a){try{var u=l.ref;if(u!==null){switch(l.tag){case 26:case 27:case 5:var h=l.stateNode;break;case 30:h=l.stateNode;break;default:h=l.stateNode}typeof u=="function"?l.refCleanup=u(h):u.current=h}}catch(g){ht(l,a,g)}}function ar(l,a){var u=l.ref,h=l.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(g){ht(l,a,g)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(g){ht(l,a,g)}else u.current=null}function pv(l){var a=l.type,u=l.memoizedProps,h=l.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(g){ht(l,l.return,g)}}function Hg(l,a,u){try{var h=l.stateNode;tR(h,l.type,u,a),h[Yn]=a}catch(g){ht(l,l.return,g)}}function mv(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&Ms(l.type)||l.tag===4}function Vg(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||mv(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&Ms(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Pg(l,a,u){var h=l.tag;if(h===5||h===6)l=l.stateNode,a?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(l,a):(a=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,a.appendChild(l),u=u._reactRootContainer,u!=null||a.onclick!==null||(a.onclick=Or));else if(h!==4&&(h===27&&Ms(l.type)&&(u=l.stateNode,a=null),l=l.child,l!==null))for(Pg(l,a,u),l=l.sibling;l!==null;)Pg(l,a,u),l=l.sibling}function ed(l,a,u){var h=l.tag;if(h===5||h===6)l=l.stateNode,a?u.insertBefore(l,a):u.appendChild(l);else if(h!==4&&(h===27&&Ms(l.type)&&(u=l.stateNode),l=l.child,l!==null))for(ed(l,a,u),l=l.sibling;l!==null;)ed(l,a,u),l=l.sibling}function gv(l){var a=l.stateNode,u=l.memoizedProps;try{for(var h=l.type,g=a.attributes;g.length;)a.removeAttributeNode(g[0]);xn(a,h,u),a[mn]=l,a[Yn]=u}catch(x){ht(l,l.return,x)}}var Ur=!1,Kt=!1,$g=!1,yv=typeof WeakSet=="function"?WeakSet:Set,sn=null;function zN(l,a){if(l=l.containerInfo,uy=wd,l=OS(l),Im(l)){if("selectionStart"in l)var u={start:l.selectionStart,end:l.selectionEnd};else e:{u=(u=l.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var g=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var w=0,C=-1,D=-1,V=0,G=0,X=l,$=null;t:for(;;){for(var q;X!==u||g!==0&&X.nodeType!==3||(C=w+g),X!==x||h!==0&&X.nodeType!==3||(D=w+h),X.nodeType===3&&(w+=X.nodeValue.length),(q=X.firstChild)!==null;)$=X,X=q;for(;;){if(X===l)break t;if($===u&&++V===g&&(C=w),$===x&&++G===h&&(D=w),(q=X.nextSibling)!==null)break;X=$,$=X.parentNode}X=q}u=C===-1||D===-1?null:{start:C,end:D}}else u=null}u=u||{start:0,end:0}}else u=null;for(fy={focusedElem:l,selectionRange:u},wd=!1,sn=a;sn!==null;)if(a=sn,l=a.child,(a.subtreeFlags&1028)!==0&&l!==null)l.return=a,sn=l;else for(;sn!==null;){switch(a=sn,x=a.alternate,l=a.flags,a.tag){case 0:if((l&4)!==0&&(l=a.updateQueue,l=l!==null?l.events:null,l!==null))for(u=0;u<l.length;u++)g=l[u],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((l&1024)!==0&&x!==null){l=void 0,u=a,g=x.memoizedProps,x=x.memoizedState,h=u.stateNode;try{var be=Al(u.type,g);l=h.getSnapshotBeforeUpdate(be,x),h.__reactInternalSnapshotBeforeUpdate=l}catch(Me){ht(u,u.return,Me)}}break;case 3:if((l&1024)!==0){if(l=a.stateNode.containerInfo,u=l.nodeType,u===9)py(l);else if(u===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":py(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((l&1024)!==0)throw Error(i(163))}if(l=a.sibling,l!==null){l.return=a.return,sn=l;break}sn=a.return}}function bv(l,a,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Vr(l,u),h&4&&vc(5,u);break;case 1:if(Vr(l,u),h&4)if(l=u.stateNode,a===null)try{l.componentDidMount()}catch(w){ht(u,u.return,w)}else{var g=Al(u.type,a.memoizedProps);a=a.memoizedState;try{l.componentDidUpdate(g,a,l.__reactInternalSnapshotBeforeUpdate)}catch(w){ht(u,u.return,w)}}h&64&&dv(u),h&512&&kc(u,u.return);break;case 3:if(Vr(l,u),h&64&&(l=u.updateQueue,l!==null)){if(a=null,u.child!==null)switch(u.child.tag){case 27:case 5:a=u.child.stateNode;break;case 1:a=u.child.stateNode}try{nw(l,a)}catch(w){ht(u,u.return,w)}}break;case 27:a===null&&h&4&&gv(u);case 26:case 5:Vr(l,u),a===null&&h&4&&pv(u),h&512&&kc(u,u.return);break;case 12:Vr(l,u);break;case 31:Vr(l,u),h&4&&wv(l,u);break;case 13:Vr(l,u),h&4&&vv(l,u),h&64&&(l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null&&(u=$N.bind(null,u),cR(l,u))));break;case 22:if(h=u.memoizedState!==null||Ur,!h){a=a!==null&&a.memoizedState!==null||Kt,g=Ur;var x=Kt;Ur=h,(Kt=a)&&!x?Pr(l,u,(u.subtreeFlags&8772)!==0):Vr(l,u),Ur=g,Kt=x}break;case 30:break;default:Vr(l,u)}}function xv(l){var a=l.alternate;a!==null&&(l.alternate=null,xv(a)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(a=l.stateNode,a!==null&&xm(a)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}var _t=null,Gn=!1;function Hr(l,a,u){for(u=u.child;u!==null;)Sv(l,a,u),u=u.sibling}function Sv(l,a,u){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(Ln,u)}catch{}switch(u.tag){case 26:Kt||ar(u,a),Hr(l,a,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Kt||ar(u,a);var h=_t,g=Gn;Ms(u.type)&&(_t=u.stateNode,Gn=!1),Hr(l,a,u),Nc(u.stateNode),_t=h,Gn=g;break;case 5:Kt||ar(u,a);case 6:if(h=_t,g=Gn,_t=null,Hr(l,a,u),_t=h,Gn=g,_t!==null)if(Gn)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(u.stateNode)}catch(x){ht(u,a,x)}else try{_t.removeChild(u.stateNode)}catch(x){ht(u,a,x)}break;case 18:_t!==null&&(Gn?(l=_t,dk(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,u.stateNode),Go(l)):dk(_t,u.stateNode));break;case 4:h=_t,g=Gn,_t=u.stateNode.containerInfo,Gn=!0,Hr(l,a,u),_t=h,Gn=g;break;case 0:case 11:case 14:case 15:ws(2,u,a),Kt||ws(4,u,a),Hr(l,a,u);break;case 1:Kt||(ar(u,a),h=u.stateNode,typeof h.componentWillUnmount=="function"&&hv(u,a,h)),Hr(l,a,u);break;case 21:Hr(l,a,u);break;case 22:Kt=(h=Kt)||u.memoizedState!==null,Hr(l,a,u),Kt=h;break;default:Hr(l,a,u)}}function wv(l,a){if(a.memoizedState===null&&(l=a.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{Go(l)}catch(u){ht(a,a.return,u)}}}function vv(l,a){if(a.memoizedState===null&&(l=a.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{Go(l)}catch(u){ht(a,a.return,u)}}function LN(l){switch(l.tag){case 31:case 13:case 19:var a=l.stateNode;return a===null&&(a=l.stateNode=new yv),a;case 22:return l=l.stateNode,a=l._retryCache,a===null&&(a=l._retryCache=new yv),a;default:throw Error(i(435,l.tag))}}function td(l,a){var u=LN(l);a.forEach(function(h){if(!u.has(h)){u.add(h);var g=FN.bind(null,l,h);h.then(g,g)}})}function Zn(l,a){var u=a.deletions;if(u!==null)for(var h=0;h<u.length;h++){var g=u[h],x=l,w=a,C=w;e:for(;C!==null;){switch(C.tag){case 27:if(Ms(C.type)){_t=C.stateNode,Gn=!1;break e}break;case 5:_t=C.stateNode,Gn=!1;break e;case 3:case 4:_t=C.stateNode.containerInfo,Gn=!0;break e}C=C.return}if(_t===null)throw Error(i(160));Sv(x,w,g),_t=null,Gn=!1,x=g.alternate,x!==null&&(x.return=null),g.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)kv(a,l),a=a.sibling}var Zi=null;function kv(l,a){var u=l.alternate,h=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:Zn(a,l),Jn(l),h&4&&(ws(3,l,l.return),vc(3,l),ws(5,l,l.return));break;case 1:Zn(a,l),Jn(l),h&512&&(Kt||u===null||ar(u,u.return)),h&64&&Ur&&(l=l.updateQueue,l!==null&&(h=l.callbacks,h!==null&&(u=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var g=Zi;if(Zn(a,l),Jn(l),h&512&&(Kt||u===null||ar(u,u.return)),h&4){var x=u!==null?u.memoizedState:null;if(h=l.memoizedState,u===null)if(h===null)if(l.stateNode===null){e:{h=l.type,u=l.memoizedProps,g=g.ownerDocument||g;t:switch(h){case"title":x=g.getElementsByTagName("title")[0],(!x||x[Ja]||x[mn]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=g.createElement(h),g.head.insertBefore(x,g.querySelector("head > title"))),xn(x,h,u),x[mn]=l,rn(x),h=x;break e;case"link":var w=kk("link","href",g).get(h+(u.href||""));if(w){for(var C=0;C<w.length;C++)if(x=w[C],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){w.splice(C,1);break t}}x=g.createElement(h),xn(x,h,u),g.head.appendChild(x);break;case"meta":if(w=kk("meta","content",g).get(h+(u.content||""))){for(C=0;C<w.length;C++)if(x=w[C],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){w.splice(C,1);break t}}x=g.createElement(h),xn(x,h,u),g.head.appendChild(x);break;default:throw Error(i(468,h))}x[mn]=l,rn(x),h=x}l.stateNode=h}else Ck(g,l.type,l.stateNode);else l.stateNode=vk(g,h,l.memoizedProps);else x!==h?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,h===null?Ck(g,l.type,l.stateNode):vk(g,h,l.memoizedProps)):h===null&&l.stateNode!==null&&Hg(l,l.memoizedProps,u.memoizedProps)}break;case 27:Zn(a,l),Jn(l),h&512&&(Kt||u===null||ar(u,u.return)),u!==null&&h&4&&Hg(l,l.memoizedProps,u.memoizedProps);break;case 5:if(Zn(a,l),Jn(l),h&512&&(Kt||u===null||ar(u,u.return)),l.flags&32){g=l.stateNode;try{yo(g,"")}catch(be){ht(l,l.return,be)}}h&4&&l.stateNode!=null&&(g=l.memoizedProps,Hg(l,g,u!==null?u.memoizedProps:g)),h&1024&&($g=!0);break;case 6:if(Zn(a,l),Jn(l),h&4){if(l.stateNode===null)throw Error(i(162));h=l.memoizedProps,u=l.stateNode;try{u.nodeValue=h}catch(be){ht(l,l.return,be)}}break;case 3:if(yd=null,g=Zi,Zi=md(a.containerInfo),Zn(a,l),Zi=g,Jn(l),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Go(a.containerInfo)}catch(be){ht(l,l.return,be)}$g&&($g=!1,Cv(l));break;case 4:h=Zi,Zi=md(l.stateNode.containerInfo),Zn(a,l),Jn(l),Zi=h;break;case 12:Zn(a,l),Jn(l);break;case 31:Zn(a,l),Jn(l),h&4&&(h=l.updateQueue,h!==null&&(l.updateQueue=null,td(l,h)));break;case 13:Zn(a,l),Jn(l),l.child.flags&8192&&l.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(id=qe()),h&4&&(h=l.updateQueue,h!==null&&(l.updateQueue=null,td(l,h)));break;case 22:g=l.memoizedState!==null;var D=u!==null&&u.memoizedState!==null,V=Ur,G=Kt;if(Ur=V||g,Kt=G||D,Zn(a,l),Kt=G,Ur=V,Jn(l),h&8192)e:for(a=l.stateNode,a._visibility=g?a._visibility&-2:a._visibility|1,g&&(u===null||D||Ur||Kt||Ml(l)),u=null,a=l;;){if(a.tag===5||a.tag===26){if(u===null){D=u=a;try{if(x=D.stateNode,g)w=x.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{C=D.stateNode;var X=D.memoizedProps.style,$=X!=null&&X.hasOwnProperty("display")?X.display:null;C.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(be){ht(D,D.return,be)}}}else if(a.tag===6){if(u===null){D=a;try{D.stateNode.nodeValue=g?"":D.memoizedProps}catch(be){ht(D,D.return,be)}}}else if(a.tag===18){if(u===null){D=a;try{var q=D.stateNode;g?hk(q,!0):hk(D.stateNode,!1)}catch(be){ht(D,D.return,be)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===l)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;u===a&&(u=null),a=a.return}u===a&&(u=null),a.sibling.return=a.return,a=a.sibling}h&4&&(h=l.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,td(l,u))));break;case 19:Zn(a,l),Jn(l),h&4&&(h=l.updateQueue,h!==null&&(l.updateQueue=null,td(l,h)));break;case 30:break;case 21:break;default:Zn(a,l),Jn(l)}}function Jn(l){var a=l.flags;if(a&2){try{for(var u,h=l.return;h!==null;){if(mv(h)){u=h;break}h=h.return}if(u==null)throw Error(i(160));switch(u.tag){case 27:var g=u.stateNode,x=Vg(l);ed(l,x,g);break;case 5:var w=u.stateNode;u.flags&32&&(yo(w,""),u.flags&=-33);var C=Vg(l);ed(l,C,w);break;case 3:case 4:var D=u.stateNode.containerInfo,V=Vg(l);Pg(l,V,D);break;default:throw Error(i(161))}}catch(G){ht(l,l.return,G)}l.flags&=-3}a&4096&&(l.flags&=-4097)}function Cv(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var a=l;Cv(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),l=l.sibling}}function Vr(l,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)bv(l,a.alternate,a),a=a.sibling}function Ml(l){for(l=l.child;l!==null;){var a=l;switch(a.tag){case 0:case 11:case 14:case 15:ws(4,a,a.return),Ml(a);break;case 1:ar(a,a.return);var u=a.stateNode;typeof u.componentWillUnmount=="function"&&hv(a,a.return,u),Ml(a);break;case 27:Nc(a.stateNode);case 26:case 5:ar(a,a.return),Ml(a);break;case 22:a.memoizedState===null&&Ml(a);break;case 30:Ml(a);break;default:Ml(a)}l=l.sibling}}function Pr(l,a,u){for(u=u&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var h=a.alternate,g=l,x=a,w=x.flags;switch(x.tag){case 0:case 11:case 15:Pr(g,x,u),vc(4,x);break;case 1:if(Pr(g,x,u),h=x,g=h.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(V){ht(h,h.return,V)}if(h=x,g=h.updateQueue,g!==null){var C=h.stateNode;try{var D=g.shared.hiddenCallbacks;if(D!==null)for(g.shared.hiddenCallbacks=null,g=0;g<D.length;g++)tw(D[g],C)}catch(V){ht(h,h.return,V)}}u&&w&64&&dv(x),kc(x,x.return);break;case 27:gv(x);case 26:case 5:Pr(g,x,u),u&&h===null&&w&4&&pv(x),kc(x,x.return);break;case 12:Pr(g,x,u);break;case 31:Pr(g,x,u),u&&w&4&&wv(g,x);break;case 13:Pr(g,x,u),u&&w&4&&vv(g,x);break;case 22:x.memoizedState===null&&Pr(g,x,u),kc(x,x.return);break;case 30:break;default:Pr(g,x,u)}a=a.sibling}}function Fg(l,a){var u=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),l=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),l!==u&&(l!=null&&l.refCount++,u!=null&&cc(u))}function qg(l,a){l=null,a.alternate!==null&&(l=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==l&&(a.refCount++,l!=null&&cc(l))}function Ji(l,a,u,h){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Ev(l,a,u,h),a=a.sibling}function Ev(l,a,u,h){var g=a.flags;switch(a.tag){case 0:case 11:case 15:Ji(l,a,u,h),g&2048&&vc(9,a);break;case 1:Ji(l,a,u,h);break;case 3:Ji(l,a,u,h),g&2048&&(l=null,a.alternate!==null&&(l=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==l&&(a.refCount++,l!=null&&cc(l)));break;case 12:if(g&2048){Ji(l,a,u,h),l=a.stateNode;try{var x=a.memoizedProps,w=x.id,C=x.onPostCommit;typeof C=="function"&&C(w,a.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(D){ht(a,a.return,D)}}else Ji(l,a,u,h);break;case 31:Ji(l,a,u,h);break;case 13:Ji(l,a,u,h);break;case 23:break;case 22:x=a.stateNode,w=a.alternate,a.memoizedState!==null?x._visibility&2?Ji(l,a,u,h):Cc(l,a):x._visibility&2?Ji(l,a,u,h):(x._visibility|=2,Bo(l,a,u,h,(a.subtreeFlags&10256)!==0||!1)),g&2048&&Fg(w,a);break;case 24:Ji(l,a,u,h),g&2048&&qg(a.alternate,a);break;default:Ji(l,a,u,h)}}function Bo(l,a,u,h,g){for(g=g&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var x=l,w=a,C=u,D=h,V=w.flags;switch(w.tag){case 0:case 11:case 15:Bo(x,w,C,D,g),vc(8,w);break;case 23:break;case 22:var G=w.stateNode;w.memoizedState!==null?G._visibility&2?Bo(x,w,C,D,g):Cc(x,w):(G._visibility|=2,Bo(x,w,C,D,g)),g&&V&2048&&Fg(w.alternate,w);break;case 24:Bo(x,w,C,D,g),g&&V&2048&&qg(w.alternate,w);break;default:Bo(x,w,C,D,g)}a=a.sibling}}function Cc(l,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var u=l,h=a,g=h.flags;switch(h.tag){case 22:Cc(u,h),g&2048&&Fg(h.alternate,h);break;case 24:Cc(u,h),g&2048&&qg(h.alternate,h);break;default:Cc(u,h)}a=a.sibling}}var Ec=8192;function jo(l,a,u){if(l.subtreeFlags&Ec)for(l=l.child;l!==null;)Tv(l,a,u),l=l.sibling}function Tv(l,a,u){switch(l.tag){case 26:jo(l,a,u),l.flags&Ec&&l.memoizedState!==null&&wR(u,Zi,l.memoizedState,l.memoizedProps);break;case 5:jo(l,a,u);break;case 3:case 4:var h=Zi;Zi=md(l.stateNode.containerInfo),jo(l,a,u),Zi=h;break;case 22:l.memoizedState===null&&(h=l.alternate,h!==null&&h.memoizedState!==null?(h=Ec,Ec=16777216,jo(l,a,u),Ec=h):jo(l,a,u));break;default:jo(l,a,u)}}function Av(l){var a=l.alternate;if(a!==null&&(l=a.child,l!==null)){a.child=null;do a=l.sibling,l.sibling=null,l=a;while(l!==null)}}function Tc(l){var a=l.deletions;if((l.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];sn=h,Ov(h,l)}Av(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Mv(l),l=l.sibling}function Mv(l){switch(l.tag){case 0:case 11:case 15:Tc(l),l.flags&2048&&ws(9,l,l.return);break;case 3:Tc(l);break;case 12:Tc(l);break;case 22:var a=l.stateNode;l.memoizedState!==null&&a._visibility&2&&(l.return===null||l.return.tag!==13)?(a._visibility&=-3,nd(l)):Tc(l);break;default:Tc(l)}}function nd(l){var a=l.deletions;if((l.flags&16)!==0){if(a!==null)for(var u=0;u<a.length;u++){var h=a[u];sn=h,Ov(h,l)}Av(l)}for(l=l.child;l!==null;){switch(a=l,a.tag){case 0:case 11:case 15:ws(8,a,a.return),nd(a);break;case 22:u=a.stateNode,u._visibility&2&&(u._visibility&=-3,nd(a));break;default:nd(a)}l=l.sibling}}function Ov(l,a){for(;sn!==null;){var u=sn;switch(u.tag){case 0:case 11:case 15:ws(8,u,a);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:cc(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,sn=h;else e:for(u=l;sn!==null;){h=sn;var g=h.sibling,x=h.return;if(xv(h),h===u){sn=null;break e}if(g!==null){g.return=x,sn=g;break e}sn=x}}}var IN={getCacheForType:function(l){var a=yn(Ft),u=a.data.get(l);return u===void 0&&(u=l(),a.data.set(l,u)),u},cacheSignal:function(){return yn(Ft).controller.signal}},BN=typeof WeakMap=="function"?WeakMap:Map,ot=0,St=null,Ze=null,We=0,dt=0,di=null,vs=!1,Uo=!1,Yg=!1,$r=0,Lt=0,ks=0,Ol=0,Kg=0,hi=0,Ho=0,Ac=null,Xn=null,Gg=!1,id=0,_v=0,rd=1/0,sd=null,Cs=null,tn=0,Es=null,Vo=null,Fr=0,Zg=0,Jg=null,Dv=null,Mc=0,Xg=null;function pi(){return(ot&2)!==0&&We!==0?We&-We:I.T!==null?iy():Kx()}function Nv(){if(hi===0)if((We&536870912)===0||tt){var l=hf;hf<<=1,(hf&3932160)===0&&(hf=262144),hi=l}else hi=536870912;return l=ui.current,l!==null&&(l.flags|=32),hi}function Wn(l,a,u){(l===St&&(dt===2||dt===9)||l.cancelPendingCommit!==null)&&(Po(l,0),Ts(l,We,hi,!1)),Za(l,u),((ot&2)===0||l!==St)&&(l===St&&((ot&2)===0&&(Ol|=u),Lt===4&&Ts(l,We,hi,!1)),cr(l))}function Rv(l,a,u){if((ot&6)!==0)throw Error(i(327));var h=!u&&(a&127)===0&&(a&l.expiredLanes)===0||Ga(l,a),g=h?HN(l,a):Qg(l,a,!0),x=h;do{if(g===0){Uo&&!h&&Ts(l,a,0,!1);break}else{if(u=l.current.alternate,x&&!jN(u)){g=Qg(l,a,!1),x=!1;continue}if(g===2){if(x=a,l.errorRecoveryDisabledLanes&x)var w=0;else w=l.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){a=w;e:{var C=l;g=Ac;var D=C.current.memoizedState.isDehydrated;if(D&&(Po(C,w).flags|=256),w=Qg(C,w,!1),w!==2){if(Yg&&!D){C.errorRecoveryDisabledLanes|=x,Ol|=x,g=4;break e}x=Xn,Xn=g,x!==null&&(Xn===null?Xn=x:Xn.push.apply(Xn,x))}g=w}if(x=!1,g!==2)continue}}if(g===1){Po(l,0),Ts(l,a,0,!0);break}e:{switch(h=l,x=g,x){case 0:case 1:throw Error(i(345));case 4:if((a&4194048)!==a)break;case 6:Ts(h,a,hi,!vs);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((a&62914560)===a&&(g=id+300-qe(),10<g)){if(Ts(h,a,hi,!vs),mf(h,0,!0)!==0)break e;Fr=a,h.timeoutHandle=uk(zv.bind(null,h,u,Xn,sd,Gg,a,hi,Ol,Ho,vs,x,"Throttled",-0,0),g);break e}zv(h,u,Xn,sd,Gg,a,hi,Ol,Ho,vs,x,null,-0,0)}}break}while(!0);cr(l)}function zv(l,a,u,h,g,x,w,C,D,V,G,X,$,q){if(l.timeoutHandle=-1,X=a.subtreeFlags,X&8192||(X&16785408)===16785408){X={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Or},Tv(a,x,X);var be=(x&62914560)===x?id-qe():(x&4194048)===x?_v-qe():0;if(be=vR(X,be),be!==null){Fr=x,l.cancelPendingCommit=be(Pv.bind(null,l,a,x,u,h,g,w,C,D,G,X,null,$,q)),Ts(l,x,w,!V);return}}Pv(l,a,x,u,h,g,w,C,D)}function jN(l){for(var a=l;;){var u=a.tag;if((u===0||u===11||u===15)&&a.flags&16384&&(u=a.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var g=u[h],x=g.getSnapshot;g=g.value;try{if(!ai(x(),g))return!1}catch{return!1}}if(u=a.child,a.subtreeFlags&16384&&u!==null)u.return=a,a=u;else{if(a===l)break;for(;a.sibling===null;){if(a.return===null||a.return===l)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ts(l,a,u,h){a&=~Kg,a&=~Ol,l.suspendedLanes|=a,l.pingedLanes&=~a,h&&(l.warmLanes|=a),h=l.expirationTimes;for(var g=a;0<g;){var x=31-xt(g),w=1<<x;h[x]=-1,g&=~w}u!==0&&Fx(l,u,a)}function ld(){return(ot&6)===0?(Oc(0),!1):!0}function Wg(){if(Ze!==null){if(dt===0)var l=Ze.return;else l=Ze,Rr=Sl=null,pg(l),No=null,fc=0,l=Ze;for(;l!==null;)fv(l.alternate,l),l=l.return;Ze=null}}function Po(l,a){var u=l.timeoutHandle;u!==-1&&(l.timeoutHandle=-1,rR(u)),u=l.cancelPendingCommit,u!==null&&(l.cancelPendingCommit=null,u()),Fr=0,Wg(),St=l,Ze=u=Dr(l.current,null),We=a,dt=0,di=null,vs=!1,Uo=Ga(l,a),Yg=!1,Ho=hi=Kg=Ol=ks=Lt=0,Xn=Ac=null,Gg=!1,(a&8)!==0&&(a|=a&32);var h=l.entangledLanes;if(h!==0)for(l=l.entanglements,h&=a;0<h;){var g=31-xt(h),x=1<<g;a|=l[g],h&=~x}return $r=a,Af(),u}function Lv(l,a){Be=null,I.H=xc,a===Do||a===Lf?(a=XS(),dt=3):a===ng?(a=XS(),dt=4):dt=a===_g?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,di=a,Ze===null&&(Lt=1,Zf(l,Ei(a,l.current)))}function Iv(){var l=ui.current;return l===null?!0:(We&4194048)===We?Oi===null:(We&62914560)===We||(We&536870912)!==0?l===Oi:!1}function Bv(){var l=I.H;return I.H=xc,l===null?xc:l}function jv(){var l=I.A;return I.A=IN,l}function od(){Lt=4,vs||(We&4194048)!==We&&ui.current!==null||(Uo=!0),(ks&134217727)===0&&(Ol&134217727)===0||St===null||Ts(St,We,hi,!1)}function Qg(l,a,u){var h=ot;ot|=2;var g=Bv(),x=jv();(St!==l||We!==a)&&(sd=null,Po(l,a)),a=!1;var w=Lt;e:do try{if(dt!==0&&Ze!==null){var C=Ze,D=di;switch(dt){case 8:Wg(),w=6;break e;case 3:case 2:case 9:case 6:ui.current===null&&(a=!0);var V=dt;if(dt=0,di=null,$o(l,C,D,V),u&&Uo){w=0;break e}break;default:V=dt,dt=0,di=null,$o(l,C,D,V)}}UN(),w=Lt;break}catch(G){Lv(l,G)}while(!0);return a&&l.shellSuspendCounter++,Rr=Sl=null,ot=h,I.H=g,I.A=x,Ze===null&&(St=null,We=0,Af()),w}function UN(){for(;Ze!==null;)Uv(Ze)}function HN(l,a){var u=ot;ot|=2;var h=Bv(),g=jv();St!==l||We!==a?(sd=null,rd=qe()+500,Po(l,a)):Uo=Ga(l,a);e:do try{if(dt!==0&&Ze!==null){a=Ze;var x=di;t:switch(dt){case 1:dt=0,di=null,$o(l,a,x,1);break;case 2:case 9:if(ZS(x)){dt=0,di=null,Hv(a);break}a=function(){dt!==2&&dt!==9||St!==l||(dt=7),cr(l)},x.then(a,a);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:ZS(x)?(dt=0,di=null,Hv(a)):(dt=0,di=null,$o(l,a,x,7));break;case 5:var w=null;switch(Ze.tag){case 26:w=Ze.memoizedState;case 5:case 27:var C=Ze;if(w?Ek(w):C.stateNode.complete){dt=0,di=null;var D=C.sibling;if(D!==null)Ze=D;else{var V=C.return;V!==null?(Ze=V,ad(V)):Ze=null}break t}}dt=0,di=null,$o(l,a,x,5);break;case 6:dt=0,di=null,$o(l,a,x,6);break;case 8:Wg(),Lt=6;break e;default:throw Error(i(462))}}VN();break}catch(G){Lv(l,G)}while(!0);return Rr=Sl=null,I.H=h,I.A=g,ot=u,Ze!==null?0:(St=null,We=0,Af(),Lt)}function VN(){for(;Ze!==null&&!Le();)Uv(Ze)}function Uv(l){var a=cv(l.alternate,l,$r);l.memoizedProps=l.pendingProps,a===null?ad(l):Ze=a}function Hv(l){var a=l,u=a.alternate;switch(a.tag){case 15:case 0:a=iv(u,a,a.pendingProps,a.type,void 0,We);break;case 11:a=iv(u,a,a.pendingProps,a.type.render,a.ref,We);break;case 5:pg(a);default:fv(u,a),a=Ze=jS(a,$r),a=cv(u,a,$r)}l.memoizedProps=l.pendingProps,a===null?ad(l):Ze=a}function $o(l,a,u,h){Rr=Sl=null,pg(a),No=null,fc=0;var g=a.return;try{if(ON(l,g,a,u,We)){Lt=1,Zf(l,Ei(u,l.current)),Ze=null;return}}catch(x){if(g!==null)throw Ze=g,x;Lt=1,Zf(l,Ei(u,l.current)),Ze=null;return}a.flags&32768?(tt||h===1?l=!0:Uo||(We&536870912)!==0?l=!1:(vs=l=!0,(h===2||h===9||h===3||h===6)&&(h=ui.current,h!==null&&h.tag===13&&(h.flags|=16384))),Vv(a,l)):ad(a)}function ad(l){var a=l;do{if((a.flags&32768)!==0){Vv(a,vs);return}l=a.return;var u=NN(a.alternate,a,$r);if(u!==null){Ze=u;return}if(a=a.sibling,a!==null){Ze=a;return}Ze=a=l}while(a!==null);Lt===0&&(Lt=5)}function Vv(l,a){do{var u=RN(l.alternate,l);if(u!==null){u.flags&=32767,Ze=u;return}if(u=l.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!a&&(l=l.sibling,l!==null)){Ze=l;return}Ze=l=u}while(l!==null);Lt=6,Ze=null}function Pv(l,a,u,h,g,x,w,C,D){l.cancelPendingCommit=null;do cd();while(tn!==0);if((ot&6)!==0)throw Error(i(327));if(a!==null){if(a===l.current)throw Error(i(177));if(x=a.lanes|a.childLanes,x|=Vm,S2(l,u,x,w,C,D),l===St&&(Ze=St=null,We=0),Vo=a,Es=l,Fr=u,Zg=x,Jg=g,Dv=h,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,qN(Se,function(){return Kv(),null})):(l.callbackNode=null,l.callbackPriority=0),h=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||h){h=I.T,I.T=null,g=K.p,K.p=2,w=ot,ot|=4;try{zN(l,a,u)}finally{ot=w,K.p=g,I.T=h}}tn=1,$v(),Fv(),qv()}}function $v(){if(tn===1){tn=0;var l=Es,a=Vo,u=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var h=K.p;K.p=2;var g=ot;ot|=4;try{kv(a,l);var x=fy,w=OS(l.containerInfo),C=x.focusedElem,D=x.selectionRange;if(w!==C&&C&&C.ownerDocument&&MS(C.ownerDocument.documentElement,C)){if(D!==null&&Im(C)){var V=D.start,G=D.end;if(G===void 0&&(G=V),"selectionStart"in C)C.selectionStart=V,C.selectionEnd=Math.min(G,C.value.length);else{var X=C.ownerDocument||document,$=X&&X.defaultView||window;if($.getSelection){var q=$.getSelection(),be=C.textContent.length,Me=Math.min(D.start,be),yt=D.end===void 0?Me:Math.min(D.end,be);!q.extend&&Me>yt&&(w=yt,yt=Me,Me=w);var B=AS(C,Me),R=AS(C,yt);if(B&&R&&(q.rangeCount!==1||q.anchorNode!==B.node||q.anchorOffset!==B.offset||q.focusNode!==R.node||q.focusOffset!==R.offset)){var H=X.createRange();H.setStart(B.node,B.offset),q.removeAllRanges(),Me>yt?(q.addRange(H),q.extend(R.node,R.offset)):(H.setEnd(R.node,R.offset),q.addRange(H))}}}}for(X=[],q=C;q=q.parentNode;)q.nodeType===1&&X.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<X.length;C++){var J=X[C];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}wd=!!uy,fy=uy=null}finally{ot=g,K.p=h,I.T=u}}l.current=a,tn=2}}function Fv(){if(tn===2){tn=0;var l=Es,a=Vo,u=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var h=K.p;K.p=2;var g=ot;ot|=4;try{bv(l,a.alternate,a)}finally{ot=g,K.p=h,I.T=u}}tn=3}}function qv(){if(tn===4||tn===3){tn=0,it();var l=Es,a=Vo,u=Fr,h=Dv;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?tn=5:(tn=0,Vo=Es=null,Yv(l,l.pendingLanes));var g=l.pendingLanes;if(g===0&&(Cs=null),ym(u),a=a.stateNode,en&&typeof en.onCommitFiberRoot=="function")try{en.onCommitFiberRoot(Ln,a,void 0,(a.current.flags&128)===128)}catch{}if(h!==null){a=I.T,g=K.p,K.p=2,I.T=null;try{for(var x=l.onRecoverableError,w=0;w<h.length;w++){var C=h[w];x(C.value,{componentStack:C.stack})}}finally{I.T=a,K.p=g}}(Fr&3)!==0&&cd(),cr(l),g=l.pendingLanes,(u&261930)!==0&&(g&42)!==0?l===Xg?Mc++:(Mc=0,Xg=l):Mc=0,Oc(0)}}function Yv(l,a){(l.pooledCacheLanes&=a)===0&&(a=l.pooledCache,a!=null&&(l.pooledCache=null,cc(a)))}function cd(){return $v(),Fv(),qv(),Kv()}function Kv(){if(tn!==5)return!1;var l=Es,a=Zg;Zg=0;var u=ym(Fr),h=I.T,g=K.p;try{K.p=32>u?32:u,I.T=null,u=Jg,Jg=null;var x=Es,w=Fr;if(tn=0,Vo=Es=null,Fr=0,(ot&6)!==0)throw Error(i(331));var C=ot;if(ot|=4,Mv(x.current),Ev(x,x.current,w,u),ot=C,Oc(0,!1),en&&typeof en.onPostCommitFiberRoot=="function")try{en.onPostCommitFiberRoot(Ln,x)}catch{}return!0}finally{K.p=g,I.T=h,Yv(l,a)}}function Gv(l,a,u){a=Ei(u,a),a=Og(l.stateNode,a,2),l=bs(l,a,2),l!==null&&(Za(l,2),cr(l))}function ht(l,a,u){if(l.tag===3)Gv(l,l,u);else for(;a!==null;){if(a.tag===3){Gv(a,l,u);break}else if(a.tag===1){var h=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Cs===null||!Cs.has(h))){l=Ei(u,l),u=Zw(2),h=bs(a,u,2),h!==null&&(Jw(u,h,a,l),Za(h,2),cr(h));break}}a=a.return}}function ey(l,a,u){var h=l.pingCache;if(h===null){h=l.pingCache=new BN;var g=new Set;h.set(a,g)}else g=h.get(a),g===void 0&&(g=new Set,h.set(a,g));g.has(u)||(Yg=!0,g.add(u),l=PN.bind(null,l,a,u),a.then(l,l))}function PN(l,a,u){var h=l.pingCache;h!==null&&h.delete(a),l.pingedLanes|=l.suspendedLanes&u,l.warmLanes&=~u,St===l&&(We&u)===u&&(Lt===4||Lt===3&&(We&62914560)===We&&300>qe()-id?(ot&2)===0&&Po(l,0):Kg|=u,Ho===We&&(Ho=0)),cr(l)}function Zv(l,a){a===0&&(a=$x()),l=yl(l,a),l!==null&&(Za(l,a),cr(l))}function $N(l){var a=l.memoizedState,u=0;a!==null&&(u=a.retryLane),Zv(l,u)}function FN(l,a){var u=0;switch(l.tag){case 31:case 13:var h=l.stateNode,g=l.memoizedState;g!==null&&(u=g.retryLane);break;case 19:h=l.stateNode;break;case 22:h=l.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(a),Zv(l,u)}function qN(l,a){return li(l,a)}var ud=null,Fo=null,ty=!1,fd=!1,ny=!1,As=0;function cr(l){l!==Fo&&l.next===null&&(Fo===null?ud=Fo=l:Fo=Fo.next=l),fd=!0,ty||(ty=!0,KN())}function Oc(l,a){if(!ny&&fd){ny=!0;do for(var u=!1,h=ud;h!==null;){if(l!==0){var g=h.pendingLanes;if(g===0)var x=0;else{var w=h.suspendedLanes,C=h.pingedLanes;x=(1<<31-xt(42|l)+1)-1,x&=g&~(w&~C),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,Qv(h,x))}else x=We,x=mf(h,h===St?x:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(x&3)===0||Ga(h,x)||(u=!0,Qv(h,x));h=h.next}while(u);ny=!1}}function YN(){Jv()}function Jv(){fd=ty=!1;var l=0;As!==0&&iR()&&(l=As);for(var a=qe(),u=null,h=ud;h!==null;){var g=h.next,x=Xv(h,a);x===0?(h.next=null,u===null?ud=g:u.next=g,g===null&&(Fo=u)):(u=h,(l!==0||(x&3)!==0)&&(fd=!0)),h=g}tn!==0&&tn!==5||Oc(l),As!==0&&(As=0)}function Xv(l,a){for(var u=l.suspendedLanes,h=l.pingedLanes,g=l.expirationTimes,x=l.pendingLanes&-62914561;0<x;){var w=31-xt(x),C=1<<w,D=g[w];D===-1?((C&u)===0||(C&h)!==0)&&(g[w]=x2(C,a)):D<=a&&(l.expiredLanes|=C),x&=~C}if(a=St,u=We,u=mf(l,l===a?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),h=l.callbackNode,u===0||l===a&&(dt===2||dt===9)||l.cancelPendingCommit!==null)return h!==null&&h!==null&&ee(h),l.callbackNode=null,l.callbackPriority=0;if((u&3)===0||Ga(l,u)){if(a=u&-u,a===l.callbackPriority)return a;switch(h!==null&&ee(h),ym(u)){case 2:case 8:u=oe;break;case 32:u=Se;break;case 268435456:u=ut;break;default:u=Se}return h=Wv.bind(null,l),u=li(u,h),l.callbackPriority=a,l.callbackNode=u,a}return h!==null&&h!==null&&ee(h),l.callbackPriority=2,l.callbackNode=null,2}function Wv(l,a){if(tn!==0&&tn!==5)return l.callbackNode=null,l.callbackPriority=0,null;var u=l.callbackNode;if(cd()&&l.callbackNode!==u)return null;var h=We;return h=mf(l,l===St?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),h===0?null:(Rv(l,h,a),Xv(l,qe()),l.callbackNode!=null&&l.callbackNode===u?Wv.bind(null,l):null)}function Qv(l,a){if(cd())return null;Rv(l,a,!0)}function KN(){sR(function(){(ot&6)!==0?li(Y,YN):Jv()})}function iy(){if(As===0){var l=Oo;l===0&&(l=df,df<<=1,(df&261888)===0&&(df=256)),As=l}return As}function ek(l){return l==null||typeof l=="symbol"||typeof l=="boolean"?null:typeof l=="function"?l:xf(""+l)}function tk(l,a){var u=a.ownerDocument.createElement("input");return u.name=a.name,u.value=a.value,l.id&&u.setAttribute("form",l.id),a.parentNode.insertBefore(u,a),l=new FormData(l),u.parentNode.removeChild(u),l}function GN(l,a,u,h,g){if(a==="submit"&&u&&u.stateNode===g){var x=ek((g[Yn]||null).action),w=h.submitter;w&&(a=(a=w[Yn]||null)?ek(a.formAction):w.getAttribute("formAction"),a!==null&&(x=a,w=null));var C=new kf("action","action",null,h,g);l.push({event:C,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(As!==0){var D=w?tk(g,w):new FormData(g);kg(u,{pending:!0,data:D,method:g.method,action:x},null,D)}}else typeof x=="function"&&(C.preventDefault(),D=w?tk(g,w):new FormData(g),kg(u,{pending:!0,data:D,method:g.method,action:x},x,D))},currentTarget:g}]})}}for(var ry=0;ry<Hm.length;ry++){var sy=Hm[ry],ZN=sy.toLowerCase(),JN=sy[0].toUpperCase()+sy.slice(1);Gi(ZN,"on"+JN)}Gi(NS,"onAnimationEnd"),Gi(RS,"onAnimationIteration"),Gi(zS,"onAnimationStart"),Gi("dblclick","onDoubleClick"),Gi("focusin","onFocus"),Gi("focusout","onBlur"),Gi(dN,"onTransitionRun"),Gi(hN,"onTransitionStart"),Gi(pN,"onTransitionCancel"),Gi(LS,"onTransitionEnd"),mo("onMouseEnter",["mouseout","mouseover"]),mo("onMouseLeave",["mouseout","mouseover"]),mo("onPointerEnter",["pointerout","pointerover"]),mo("onPointerLeave",["pointerout","pointerover"]),hl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),hl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),hl("onBeforeInput",["compositionend","keypress","textInput","paste"]),hl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),hl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),hl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _c="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),XN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_c));function nk(l,a){a=(a&4)!==0;for(var u=0;u<l.length;u++){var h=l[u],g=h.event;h=h.listeners;e:{var x=void 0;if(a)for(var w=h.length-1;0<=w;w--){var C=h[w],D=C.instance,V=C.currentTarget;if(C=C.listener,D!==x&&g.isPropagationStopped())break e;x=C,g.currentTarget=V;try{x(g)}catch(G){Tf(G)}g.currentTarget=null,x=D}else for(w=0;w<h.length;w++){if(C=h[w],D=C.instance,V=C.currentTarget,C=C.listener,D!==x&&g.isPropagationStopped())break e;x=C,g.currentTarget=V;try{x(g)}catch(G){Tf(G)}g.currentTarget=null,x=D}}}}function Je(l,a){var u=a[bm];u===void 0&&(u=a[bm]=new Set);var h=l+"__bubble";u.has(h)||(ik(a,l,2,!1),u.add(h))}function ly(l,a,u){var h=0;a&&(h|=4),ik(u,l,h,a)}var dd="_reactListening"+Math.random().toString(36).slice(2);function oy(l){if(!l[dd]){l[dd]=!0,Jx.forEach(function(u){u!=="selectionchange"&&(XN.has(u)||ly(u,!1,l),ly(u,!0,l))});var a=l.nodeType===9?l:l.ownerDocument;a===null||a[dd]||(a[dd]=!0,ly("selectionchange",!1,a))}}function ik(l,a,u,h){switch(Nk(a)){case 2:var g=ER;break;case 8:g=TR;break;default:g=vy}u=g.bind(null,a,u,l),g=void 0,!Am||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(g=!0),h?g!==void 0?l.addEventListener(a,u,{capture:!0,passive:g}):l.addEventListener(a,u,!0):g!==void 0?l.addEventListener(a,u,{passive:g}):l.addEventListener(a,u,!1)}function ay(l,a,u,h,g){var x=h;if((a&1)===0&&(a&2)===0&&h!==null)e:for(;;){if(h===null)return;var w=h.tag;if(w===3||w===4){var C=h.stateNode.containerInfo;if(C===g)break;if(w===4)for(w=h.return;w!==null;){var D=w.tag;if((D===3||D===4)&&w.stateNode.containerInfo===g)return;w=w.return}for(;C!==null;){if(w=fo(C),w===null)return;if(D=w.tag,D===5||D===6||D===26||D===27){h=x=w;continue e}C=C.parentNode}}h=h.return}aS(function(){var V=x,G=Em(u),X=[];e:{var $=IS.get(l);if($!==void 0){var q=kf,be=l;switch(l){case"keypress":if(wf(u)===0)break e;case"keydown":case"keyup":q=F2;break;case"focusin":be="focus",q=Dm;break;case"focusout":be="blur",q=Dm;break;case"beforeblur":case"afterblur":q=Dm;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=fS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=N2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=K2;break;case NS:case RS:case zS:q=L2;break;case LS:q=Z2;break;case"scroll":case"scrollend":q=_2;break;case"wheel":q=X2;break;case"copy":case"cut":case"paste":q=B2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=hS;break;case"toggle":case"beforetoggle":q=Q2}var Me=(a&4)!==0,yt=!Me&&(l==="scroll"||l==="scrollend"),B=Me?$!==null?$+"Capture":null:$;Me=[];for(var R=V,H;R!==null;){var J=R;if(H=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||H===null||B===null||(J=Wa(R,B),J!=null&&Me.push(Dc(R,J,H))),yt)break;R=R.return}0<Me.length&&($=new q($,be,null,u,G),X.push({event:$,listeners:Me}))}}if((a&7)===0){e:{if($=l==="mouseover"||l==="pointerover",q=l==="mouseout"||l==="pointerout",$&&u!==Cm&&(be=u.relatedTarget||u.fromElement)&&(fo(be)||be[uo]))break e;if((q||$)&&($=G.window===G?G:($=G.ownerDocument)?$.defaultView||$.parentWindow:window,q?(be=u.relatedTarget||u.toElement,q=V,be=be?fo(be):null,be!==null&&(yt=s(be),Me=be.tag,be!==yt||Me!==5&&Me!==27&&Me!==6)&&(be=null)):(q=null,be=V),q!==be)){if(Me=fS,J="onMouseLeave",B="onMouseEnter",R="mouse",(l==="pointerout"||l==="pointerover")&&(Me=hS,J="onPointerLeave",B="onPointerEnter",R="pointer"),yt=q==null?$:Xa(q),H=be==null?$:Xa(be),$=new Me(J,R+"leave",q,u,G),$.target=yt,$.relatedTarget=H,J=null,fo(G)===V&&(Me=new Me(B,R+"enter",be,u,G),Me.target=H,Me.relatedTarget=yt,J=Me),yt=J,q&&be)t:{for(Me=WN,B=q,R=be,H=0,J=B;J;J=Me(J))H++;J=0;for(var Te=R;Te;Te=Me(Te))J++;for(;0<H-J;)B=Me(B),H--;for(;0<J-H;)R=Me(R),J--;for(;H--;){if(B===R||R!==null&&B===R.alternate){Me=B;break t}B=Me(B),R=Me(R)}Me=null}else Me=null;q!==null&&rk(X,$,q,Me,!1),be!==null&&yt!==null&&rk(X,yt,be,Me,!0)}}e:{if($=V?Xa(V):window,q=$.nodeName&&$.nodeName.toLowerCase(),q==="select"||q==="input"&&$.type==="file")var rt=wS;else if(xS($))if(vS)rt=cN;else{rt=oN;var ve=lN}else q=$.nodeName,!q||q.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?V&&km(V.elementType)&&(rt=wS):rt=aN;if(rt&&(rt=rt(l,V))){SS(X,rt,u,G);break e}ve&&ve(l,$,V),l==="focusout"&&V&&$.type==="number"&&V.memoizedProps.value!=null&&vm($,"number",$.value)}switch(ve=V?Xa(V):window,l){case"focusin":(xS(ve)||ve.contentEditable==="true")&&(wo=ve,Bm=V,lc=null);break;case"focusout":lc=Bm=wo=null;break;case"mousedown":jm=!0;break;case"contextmenu":case"mouseup":case"dragend":jm=!1,_S(X,u,G);break;case"selectionchange":if(fN)break;case"keydown":case"keyup":_S(X,u,G)}var He;if(Rm)e:{switch(l){case"compositionstart":var Qe="onCompositionStart";break e;case"compositionend":Qe="onCompositionEnd";break e;case"compositionupdate":Qe="onCompositionUpdate";break e}Qe=void 0}else So?yS(l,u)&&(Qe="onCompositionEnd"):l==="keydown"&&u.keyCode===229&&(Qe="onCompositionStart");Qe&&(pS&&u.locale!=="ko"&&(So||Qe!=="onCompositionStart"?Qe==="onCompositionEnd"&&So&&(He=cS()):(fs=G,Mm="value"in fs?fs.value:fs.textContent,So=!0)),ve=hd(V,Qe),0<ve.length&&(Qe=new dS(Qe,l,null,u,G),X.push({event:Qe,listeners:ve}),He?Qe.data=He:(He=bS(u),He!==null&&(Qe.data=He)))),(He=tN?nN(l,u):iN(l,u))&&(Qe=hd(V,"onBeforeInput"),0<Qe.length&&(ve=new dS("onBeforeInput","beforeinput",null,u,G),X.push({event:ve,listeners:Qe}),ve.data=He)),GN(X,l,V,u,G)}nk(X,a)})}function Dc(l,a,u){return{instance:l,listener:a,currentTarget:u}}function hd(l,a){for(var u=a+"Capture",h=[];l!==null;){var g=l,x=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||x===null||(g=Wa(l,u),g!=null&&h.unshift(Dc(l,g,x)),g=Wa(l,a),g!=null&&h.push(Dc(l,g,x))),l.tag===3)return h;l=l.return}return[]}function WN(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5&&l.tag!==27);return l||null}function rk(l,a,u,h,g){for(var x=a._reactName,w=[];u!==null&&u!==h;){var C=u,D=C.alternate,V=C.stateNode;if(C=C.tag,D!==null&&D===h)break;C!==5&&C!==26&&C!==27||V===null||(D=V,g?(V=Wa(u,x),V!=null&&w.unshift(Dc(u,V,D))):g||(V=Wa(u,x),V!=null&&w.push(Dc(u,V,D)))),u=u.return}w.length!==0&&l.push({event:a,listeners:w})}var QN=/\r\n?/g,eR=/\u0000|\uFFFD/g;function sk(l){return(typeof l=="string"?l:""+l).replace(QN,`
|
|
49
|
+
`).replace(eR,"")}function lk(l,a){return a=sk(a),sk(l)===a}function gt(l,a,u,h,g,x){switch(u){case"children":typeof h=="string"?a==="body"||a==="textarea"&&h===""||yo(l,h):(typeof h=="number"||typeof h=="bigint")&&a!=="body"&&yo(l,""+h);break;case"className":yf(l,"class",h);break;case"tabIndex":yf(l,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":yf(l,u,h);break;case"style":lS(l,h,x);break;case"data":if(a!=="object"){yf(l,"data",h);break}case"src":case"href":if(h===""&&(a!=="a"||u!=="href")){l.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){l.removeAttribute(u);break}h=xf(""+h),l.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){l.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(u==="formAction"?(a!=="input"&>(l,a,"name",g.name,g,null),gt(l,a,"formEncType",g.formEncType,g,null),gt(l,a,"formMethod",g.formMethod,g,null),gt(l,a,"formTarget",g.formTarget,g,null)):(gt(l,a,"encType",g.encType,g,null),gt(l,a,"method",g.method,g,null),gt(l,a,"target",g.target,g,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){l.removeAttribute(u);break}h=xf(""+h),l.setAttribute(u,h);break;case"onClick":h!=null&&(l.onclick=Or);break;case"onScroll":h!=null&&Je("scroll",l);break;case"onScrollEnd":h!=null&&Je("scrollend",l);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(g.children!=null)throw Error(i(60));l.innerHTML=u}}break;case"multiple":l.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":l.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){l.removeAttribute("xlink:href");break}u=xf(""+h),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?l.setAttribute(u,""+h):l.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?l.setAttribute(u,""):l.removeAttribute(u);break;case"capture":case"download":h===!0?l.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?l.setAttribute(u,h):l.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?l.setAttribute(u,h):l.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?l.removeAttribute(u):l.setAttribute(u,h);break;case"popover":Je("beforetoggle",l),Je("toggle",l),gf(l,"popover",h);break;case"xlinkActuate":Mr(l,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Mr(l,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Mr(l,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Mr(l,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Mr(l,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Mr(l,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Mr(l,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Mr(l,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Mr(l,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":gf(l,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=M2.get(u)||u,gf(l,u,h))}}function cy(l,a,u,h,g,x){switch(u){case"style":lS(l,h,x);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(u=h.__html,u!=null){if(g.children!=null)throw Error(i(60));l.innerHTML=u}}break;case"children":typeof h=="string"?yo(l,h):(typeof h=="number"||typeof h=="bigint")&&yo(l,""+h);break;case"onScroll":h!=null&&Je("scroll",l);break;case"onScrollEnd":h!=null&&Je("scrollend",l);break;case"onClick":h!=null&&(l.onclick=Or);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xx.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(g=u.endsWith("Capture"),a=u.slice(2,g?u.length-7:void 0),x=l[Yn]||null,x=x!=null?x[u]:null,typeof x=="function"&&l.removeEventListener(a,x,g),typeof h=="function")){typeof x!="function"&&x!==null&&(u in l?l[u]=null:l.hasAttribute(u)&&l.removeAttribute(u)),l.addEventListener(a,h,g);break e}u in l?l[u]=h:h===!0?l.setAttribute(u,""):gf(l,u,h)}}}function xn(l,a,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",l),Je("load",l);var h=!1,g=!1,x;for(x in u)if(u.hasOwnProperty(x)){var w=u[x];if(w!=null)switch(x){case"src":h=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:gt(l,a,x,w,u,null)}}g&>(l,a,"srcSet",u.srcSet,u,null),h&>(l,a,"src",u.src,u,null);return;case"input":Je("invalid",l);var C=x=w=g=null,D=null,V=null;for(h in u)if(u.hasOwnProperty(h)){var G=u[h];if(G!=null)switch(h){case"name":g=G;break;case"type":w=G;break;case"checked":D=G;break;case"defaultChecked":V=G;break;case"value":x=G;break;case"defaultValue":C=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(i(137,a));break;default:gt(l,a,h,G,u,null)}}nS(l,x,C,D,V,w,g,!1);return;case"select":Je("invalid",l),h=w=x=null;for(g in u)if(u.hasOwnProperty(g)&&(C=u[g],C!=null))switch(g){case"value":x=C;break;case"defaultValue":w=C;break;case"multiple":h=C;default:gt(l,a,g,C,u,null)}a=x,u=w,l.multiple=!!h,a!=null?go(l,!!h,a,!1):u!=null&&go(l,!!h,u,!0);return;case"textarea":Je("invalid",l),x=g=h=null;for(w in u)if(u.hasOwnProperty(w)&&(C=u[w],C!=null))switch(w){case"value":h=C;break;case"defaultValue":g=C;break;case"children":x=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(i(91));break;default:gt(l,a,w,C,u,null)}rS(l,h,g,x);return;case"option":for(D in u)if(u.hasOwnProperty(D)&&(h=u[D],h!=null))switch(D){case"selected":l.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:gt(l,a,D,h,u,null)}return;case"dialog":Je("beforetoggle",l),Je("toggle",l),Je("cancel",l),Je("close",l);break;case"iframe":case"object":Je("load",l);break;case"video":case"audio":for(h=0;h<_c.length;h++)Je(_c[h],l);break;case"image":Je("error",l),Je("load",l);break;case"details":Je("toggle",l);break;case"embed":case"source":case"link":Je("error",l),Je("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in u)if(u.hasOwnProperty(V)&&(h=u[V],h!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,a));default:gt(l,a,V,h,u,null)}return;default:if(km(a)){for(G in u)u.hasOwnProperty(G)&&(h=u[G],h!==void 0&&cy(l,a,G,h,u,void 0));return}}for(C in u)u.hasOwnProperty(C)&&(h=u[C],h!=null&>(l,a,C,h,u,null))}function tR(l,a,u,h){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,x=null,w=null,C=null,D=null,V=null,G=null;for(q in u){var X=u[q];if(u.hasOwnProperty(q)&&X!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":D=X;default:h.hasOwnProperty(q)||gt(l,a,q,null,h,X)}}for(var $ in h){var q=h[$];if(X=u[$],h.hasOwnProperty($)&&(q!=null||X!=null))switch($){case"type":x=q;break;case"name":g=q;break;case"checked":V=q;break;case"defaultChecked":G=q;break;case"value":w=q;break;case"defaultValue":C=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(137,a));break;default:q!==X&>(l,a,$,q,h,X)}}wm(l,w,C,D,V,G,x,g);return;case"select":q=w=C=$=null;for(x in u)if(D=u[x],u.hasOwnProperty(x)&&D!=null)switch(x){case"value":break;case"multiple":q=D;default:h.hasOwnProperty(x)||gt(l,a,x,null,h,D)}for(g in h)if(x=h[g],D=u[g],h.hasOwnProperty(g)&&(x!=null||D!=null))switch(g){case"value":$=x;break;case"defaultValue":C=x;break;case"multiple":w=x;default:x!==D&>(l,a,g,x,h,D)}a=C,u=w,h=q,$!=null?go(l,!!u,$,!1):!!h!=!!u&&(a!=null?go(l,!!u,a,!0):go(l,!!u,u?[]:"",!1));return;case"textarea":q=$=null;for(C in u)if(g=u[C],u.hasOwnProperty(C)&&g!=null&&!h.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:gt(l,a,C,null,h,g)}for(w in h)if(g=h[w],x=u[w],h.hasOwnProperty(w)&&(g!=null||x!=null))switch(w){case"value":$=g;break;case"defaultValue":q=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(i(91));break;default:g!==x&>(l,a,w,g,h,x)}iS(l,$,q);return;case"option":for(var be in u)if($=u[be],u.hasOwnProperty(be)&&$!=null&&!h.hasOwnProperty(be))switch(be){case"selected":l.selected=!1;break;default:gt(l,a,be,null,h,$)}for(D in h)if($=h[D],q=u[D],h.hasOwnProperty(D)&&$!==q&&($!=null||q!=null))switch(D){case"selected":l.selected=$&&typeof $!="function"&&typeof $!="symbol";break;default:gt(l,a,D,$,h,q)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in u)$=u[Me],u.hasOwnProperty(Me)&&$!=null&&!h.hasOwnProperty(Me)&>(l,a,Me,null,h,$);for(V in h)if($=h[V],q=u[V],h.hasOwnProperty(V)&&$!==q&&($!=null||q!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(i(137,a));break;default:gt(l,a,V,$,h,q)}return;default:if(km(a)){for(var yt in u)$=u[yt],u.hasOwnProperty(yt)&&$!==void 0&&!h.hasOwnProperty(yt)&&cy(l,a,yt,void 0,h,$);for(G in h)$=h[G],q=u[G],!h.hasOwnProperty(G)||$===q||$===void 0&&q===void 0||cy(l,a,G,$,h,q);return}}for(var B in u)$=u[B],u.hasOwnProperty(B)&&$!=null&&!h.hasOwnProperty(B)&>(l,a,B,null,h,$);for(X in h)$=h[X],q=u[X],!h.hasOwnProperty(X)||$===q||$==null&&q==null||gt(l,a,X,$,h,q)}function ok(l){switch(l){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function nR(){if(typeof performance.getEntriesByType=="function"){for(var l=0,a=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var g=u[h],x=g.transferSize,w=g.initiatorType,C=g.duration;if(x&&C&&ok(w)){for(w=0,C=g.responseEnd,h+=1;h<u.length;h++){var D=u[h],V=D.startTime;if(V>C)break;var G=D.transferSize,X=D.initiatorType;G&&ok(X)&&(D=D.responseEnd,w+=G*(D<C?1:(C-V)/(D-V)))}if(--h,a+=8*(x+w)/(g.duration/1e3),l++,10<l)break}}if(0<l)return a/l/1e6}return navigator.connection&&(l=navigator.connection.downlink,typeof l=="number")?l:5}var uy=null,fy=null;function pd(l){return l.nodeType===9?l:l.ownerDocument}function ak(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ck(l,a){if(l===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&a==="foreignObject"?0:l}function dy(l,a){return l==="textarea"||l==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var hy=null;function iR(){var l=window.event;return l&&l.type==="popstate"?l===hy?!1:(hy=l,!0):(hy=null,!1)}var uk=typeof setTimeout=="function"?setTimeout:void 0,rR=typeof clearTimeout=="function"?clearTimeout:void 0,fk=typeof Promise=="function"?Promise:void 0,sR=typeof queueMicrotask=="function"?queueMicrotask:typeof fk<"u"?function(l){return fk.resolve(null).then(l).catch(lR)}:uk;function lR(l){setTimeout(function(){throw l})}function Ms(l){return l==="head"}function dk(l,a){var u=a,h=0;do{var g=u.nextSibling;if(l.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"||u==="/&"){if(h===0){l.removeChild(g),Go(a);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Nc(l.ownerDocument.documentElement);else if(u==="head"){u=l.ownerDocument.head,Nc(u);for(var x=u.firstChild;x;){var w=x.nextSibling,C=x.nodeName;x[Ja]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=w}}else u==="body"&&Nc(l.ownerDocument.body);u=g}while(u);Go(a)}function hk(l,a){var u=l;l=0;do{var h=u.nextSibling;if(u.nodeType===1?a?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(a?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(l===0)break;l--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||l++;u=h}while(u)}function py(l){var a=l.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var u=a;switch(a=a.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":py(u),xm(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}l.removeChild(u)}}function oR(l,a,u,h){for(;l.nodeType===1;){var g=u;if(l.nodeName.toLowerCase()!==a.toLowerCase()){if(!h&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(h){if(!l[Ja])switch(a){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(x=l.getAttribute("rel"),x==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(x!==g.rel||l.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||l.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||l.getAttribute("title")!==(g.title==null?null:g.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(x=l.getAttribute("src"),(x!==(g.src==null?null:g.src)||l.getAttribute("type")!==(g.type==null?null:g.type)||l.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&x&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(a==="input"&&l.type==="hidden"){var x=g.name==null?null:""+g.name;if(g.type==="hidden"&&l.getAttribute("name")===x)return l}else return l;if(l=_i(l.nextSibling),l===null)break}return null}function aR(l,a,u){if(a==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!u||(l=_i(l.nextSibling),l===null))return null;return l}function pk(l,a){for(;l.nodeType!==8;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!a||(l=_i(l.nextSibling),l===null))return null;return l}function my(l){return l.data==="$?"||l.data==="$~"}function gy(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState!=="loading"}function cR(l,a){var u=l.ownerDocument;if(l.data==="$~")l._reactRetry=a;else if(l.data!=="$?"||u.readyState!=="loading")a();else{var h=function(){a(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),l._reactRetry=h}}function _i(l){for(;l!=null;l=l.nextSibling){var a=l.nodeType;if(a===1||a===3)break;if(a===8){if(a=l.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return l}var yy=null;function mk(l){l=l.nextSibling;for(var a=0;l;){if(l.nodeType===8){var u=l.data;if(u==="/$"||u==="/&"){if(a===0)return _i(l.nextSibling);a--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||a++}l=l.nextSibling}return null}function gk(l){l=l.previousSibling;for(var a=0;l;){if(l.nodeType===8){var u=l.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(a===0)return l;a--}else u!=="/$"&&u!=="/&"||a++}l=l.previousSibling}return null}function yk(l,a,u){switch(a=pd(u),l){case"html":if(l=a.documentElement,!l)throw Error(i(452));return l;case"head":if(l=a.head,!l)throw Error(i(453));return l;case"body":if(l=a.body,!l)throw Error(i(454));return l;default:throw Error(i(451))}}function Nc(l){for(var a=l.attributes;a.length;)l.removeAttributeNode(a[0]);xm(l)}var Di=new Map,bk=new Set;function md(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var qr=K.d;K.d={f:uR,r:fR,D:dR,C:hR,L:pR,m:mR,X:yR,S:gR,M:bR};function uR(){var l=qr.f(),a=ld();return l||a}function fR(l){var a=ho(l);a!==null&&a.tag===5&&a.type==="form"?Lw(a):qr.r(l)}var qo=typeof document>"u"?null:document;function xk(l,a,u){var h=qo;if(h&&typeof a=="string"&&a){var g=ki(a);g='link[rel="'+l+'"][href="'+g+'"]',typeof u=="string"&&(g+='[crossorigin="'+u+'"]'),bk.has(g)||(bk.add(g),l={rel:l,crossOrigin:u,href:a},h.querySelector(g)===null&&(a=h.createElement("link"),xn(a,"link",l),rn(a),h.head.appendChild(a)))}}function dR(l){qr.D(l),xk("dns-prefetch",l,null)}function hR(l,a){qr.C(l,a),xk("preconnect",l,a)}function pR(l,a,u){qr.L(l,a,u);var h=qo;if(h&&l&&a){var g='link[rel="preload"][as="'+ki(a)+'"]';a==="image"&&u&&u.imageSrcSet?(g+='[imagesrcset="'+ki(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(g+='[imagesizes="'+ki(u.imageSizes)+'"]')):g+='[href="'+ki(l)+'"]';var x=g;switch(a){case"style":x=Yo(l);break;case"script":x=Ko(l)}Di.has(x)||(l=m({rel:"preload",href:a==="image"&&u&&u.imageSrcSet?void 0:l,as:a},u),Di.set(x,l),h.querySelector(g)!==null||a==="style"&&h.querySelector(Rc(x))||a==="script"&&h.querySelector(zc(x))||(a=h.createElement("link"),xn(a,"link",l),rn(a),h.head.appendChild(a)))}}function mR(l,a){qr.m(l,a);var u=qo;if(u&&l){var h=a&&typeof a.as=="string"?a.as:"script",g='link[rel="modulepreload"][as="'+ki(h)+'"][href="'+ki(l)+'"]',x=g;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ko(l)}if(!Di.has(x)&&(l=m({rel:"modulepreload",href:l},a),Di.set(x,l),u.querySelector(g)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(zc(x)))return}h=u.createElement("link"),xn(h,"link",l),rn(h),u.head.appendChild(h)}}}function gR(l,a,u){qr.S(l,a,u);var h=qo;if(h&&l){var g=po(h).hoistableStyles,x=Yo(l);a=a||"default";var w=g.get(x);if(!w){var C={loading:0,preload:null};if(w=h.querySelector(Rc(x)))C.loading=5;else{l=m({rel:"stylesheet",href:l,"data-precedence":a},u),(u=Di.get(x))&&by(l,u);var D=w=h.createElement("link");rn(D),xn(D,"link",l),D._p=new Promise(function(V,G){D.onload=V,D.onerror=G}),D.addEventListener("load",function(){C.loading|=1}),D.addEventListener("error",function(){C.loading|=2}),C.loading|=4,gd(w,a,h)}w={type:"stylesheet",instance:w,count:1,state:C},g.set(x,w)}}}function yR(l,a){qr.X(l,a);var u=qo;if(u&&l){var h=po(u).hoistableScripts,g=Ko(l),x=h.get(g);x||(x=u.querySelector(zc(g)),x||(l=m({src:l,async:!0},a),(a=Di.get(g))&&xy(l,a),x=u.createElement("script"),rn(x),xn(x,"link",l),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(g,x))}}function bR(l,a){qr.M(l,a);var u=qo;if(u&&l){var h=po(u).hoistableScripts,g=Ko(l),x=h.get(g);x||(x=u.querySelector(zc(g)),x||(l=m({src:l,async:!0,type:"module"},a),(a=Di.get(g))&&xy(l,a),x=u.createElement("script"),rn(x),xn(x,"link",l),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(g,x))}}function Sk(l,a,u,h){var g=(g=ge.current)?md(g):null;if(!g)throw Error(i(446));switch(l){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(a=Yo(u.href),u=po(g).hoistableStyles,h=u.get(a),h||(h={type:"style",instance:null,count:0,state:null},u.set(a,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){l=Yo(u.href);var x=po(g).hoistableStyles,w=x.get(l);if(w||(g=g.ownerDocument||g,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(l,w),(x=g.querySelector(Rc(l)))&&!x._p&&(w.instance=x,w.state.loading=5),Di.has(l)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Di.set(l,u),x||xR(g,l,u,w.state))),a&&h===null)throw Error(i(528,""));return w}if(a&&h!==null)throw Error(i(529,""));return null;case"script":return a=u.async,u=u.src,typeof u=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Ko(u),u=po(g).hoistableScripts,h=u.get(a),h||(h={type:"script",instance:null,count:0,state:null},u.set(a,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,l))}}function Yo(l){return'href="'+ki(l)+'"'}function Rc(l){return'link[rel="stylesheet"]['+l+"]"}function wk(l){return m({},l,{"data-precedence":l.precedence,precedence:null})}function xR(l,a,u,h){l.querySelector('link[rel="preload"][as="style"]['+a+"]")?h.loading=1:(a=l.createElement("link"),h.preload=a,a.addEventListener("load",function(){return h.loading|=1}),a.addEventListener("error",function(){return h.loading|=2}),xn(a,"link",u),rn(a),l.head.appendChild(a))}function Ko(l){return'[src="'+ki(l)+'"]'}function zc(l){return"script[async]"+l}function vk(l,a,u){if(a.count++,a.instance===null)switch(a.type){case"style":var h=l.querySelector('style[data-href~="'+ki(u.href)+'"]');if(h)return a.instance=h,rn(h),h;var g=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(l.ownerDocument||l).createElement("style"),rn(h),xn(h,"style",g),gd(h,u.precedence,l),a.instance=h;case"stylesheet":g=Yo(u.href);var x=l.querySelector(Rc(g));if(x)return a.state.loading|=4,a.instance=x,rn(x),x;h=wk(u),(g=Di.get(g))&&by(h,g),x=(l.ownerDocument||l).createElement("link"),rn(x);var w=x;return w._p=new Promise(function(C,D){w.onload=C,w.onerror=D}),xn(x,"link",h),a.state.loading|=4,gd(x,u.precedence,l),a.instance=x;case"script":return x=Ko(u.src),(g=l.querySelector(zc(x)))?(a.instance=g,rn(g),g):(h=u,(g=Di.get(x))&&(h=m({},u),xy(h,g)),l=l.ownerDocument||l,g=l.createElement("script"),rn(g),xn(g,"link",h),l.head.appendChild(g),a.instance=g);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(h=a.instance,a.state.loading|=4,gd(h,u.precedence,l));return a.instance}function gd(l,a,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=h.length?h[h.length-1]:null,x=g,w=0;w<h.length;w++){var C=h[w];if(C.dataset.precedence===a)x=C;else if(x!==g)break}x?x.parentNode.insertBefore(l,x.nextSibling):(a=u.nodeType===9?u.head:u,a.insertBefore(l,a.firstChild))}function by(l,a){l.crossOrigin==null&&(l.crossOrigin=a.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=a.referrerPolicy),l.title==null&&(l.title=a.title)}function xy(l,a){l.crossOrigin==null&&(l.crossOrigin=a.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=a.referrerPolicy),l.integrity==null&&(l.integrity=a.integrity)}var yd=null;function kk(l,a,u){if(yd===null){var h=new Map,g=yd=new Map;g.set(u,h)}else g=yd,h=g.get(u),h||(h=new Map,g.set(u,h));if(h.has(l))return h;for(h.set(l,null),u=u.getElementsByTagName(l),g=0;g<u.length;g++){var x=u[g];if(!(x[Ja]||x[mn]||l==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var w=x.getAttribute(a)||"";w=l+w;var C=h.get(w);C?C.push(x):h.set(w,[x])}}return h}function Ck(l,a,u){l=l.ownerDocument||l,l.head.insertBefore(u,a==="title"?l.querySelector("head > title"):null)}function SR(l,a,u){if(u===1||a.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return l=a.disabled,typeof a.precedence=="string"&&l==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Ek(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function wR(l,a,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var g=Yo(h.href),x=a.querySelector(Rc(g));if(x){a=x._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(l.count++,l=bd.bind(l),a.then(l,l)),u.state.loading|=4,u.instance=x,rn(x);return}x=a.ownerDocument||a,h=wk(h),(g=Di.get(g))&&by(h,g),x=x.createElement("link"),rn(x);var w=x;w._p=new Promise(function(C,D){w.onload=C,w.onerror=D}),xn(x,"link",h),u.instance=x}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(u,a),(a=u.state.preload)&&(u.state.loading&3)===0&&(l.count++,u=bd.bind(l),a.addEventListener("load",u),a.addEventListener("error",u))}}var Sy=0;function vR(l,a){return l.stylesheets&&l.count===0&&Sd(l,l.stylesheets),0<l.count||0<l.imgCount?function(u){var h=setTimeout(function(){if(l.stylesheets&&Sd(l,l.stylesheets),l.unsuspend){var x=l.unsuspend;l.unsuspend=null,x()}},6e4+a);0<l.imgBytes&&Sy===0&&(Sy=62500*nR());var g=setTimeout(function(){if(l.waitingForImages=!1,l.count===0&&(l.stylesheets&&Sd(l,l.stylesheets),l.unsuspend)){var x=l.unsuspend;l.unsuspend=null,x()}},(l.imgBytes>Sy?50:800)+a);return l.unsuspend=u,function(){l.unsuspend=null,clearTimeout(h),clearTimeout(g)}}:null}function bd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Sd(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var xd=null;function Sd(l,a){l.stylesheets=null,l.unsuspend!==null&&(l.count++,xd=new Map,a.forEach(kR,l),xd=null,bd.call(l))}function kR(l,a){if(!(a.state.loading&4)){var u=xd.get(l);if(u)var h=u.get(null);else{u=new Map,xd.set(l,u);for(var g=l.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<g.length;x++){var w=g[x];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(u.set(w.dataset.precedence,w),h=w)}h&&u.set(null,h)}g=a.instance,w=g.getAttribute("data-precedence"),x=u.get(w)||h,x===h&&u.set(null,g),u.set(w,g),this.count++,h=bd.bind(this),g.addEventListener("load",h),g.addEventListener("error",h),x?x.parentNode.insertBefore(g,x.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(g,l.firstChild)),a.state.loading|=4}}var Lc={$$typeof:L,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function CR(l,a,u,h,g,x,w,C,D){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=mm(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mm(0),this.hiddenUpdates=mm(null),this.identifierPrefix=h,this.onUncaughtError=g,this.onCaughtError=x,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Tk(l,a,u,h,g,x,w,C,D,V,G,X){return l=new CR(l,a,u,w,D,V,G,X,C),a=1,x===!0&&(a|=24),x=ci(3,null,null,a),l.current=x,x.stateNode=l,a=Qm(),a.refCount++,l.pooledCache=a,a.refCount++,x.memoizedState={element:h,isDehydrated:u,cache:a},ig(x),l}function Ak(l){return l?(l=Co,l):Co}function Mk(l,a,u,h,g,x){g=Ak(g),h.context===null?h.context=g:h.pendingContext=g,h=ys(a),h.payload={element:u},x=x===void 0?null:x,x!==null&&(h.callback=x),u=bs(l,h,a),u!==null&&(Wn(u,l,a),hc(u,l,a))}function Ok(l,a){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var u=l.retryLane;l.retryLane=u!==0&&u<a?u:a}}function wy(l,a){Ok(l,a),(l=l.alternate)&&Ok(l,a)}function _k(l){if(l.tag===13||l.tag===31){var a=yl(l,67108864);a!==null&&Wn(a,l,67108864),wy(l,67108864)}}function Dk(l){if(l.tag===13||l.tag===31){var a=pi();a=gm(a);var u=yl(l,a);u!==null&&Wn(u,l,a),wy(l,a)}}var wd=!0;function ER(l,a,u,h){var g=I.T;I.T=null;var x=K.p;try{K.p=2,vy(l,a,u,h)}finally{K.p=x,I.T=g}}function TR(l,a,u,h){var g=I.T;I.T=null;var x=K.p;try{K.p=8,vy(l,a,u,h)}finally{K.p=x,I.T=g}}function vy(l,a,u,h){if(wd){var g=ky(h);if(g===null)ay(l,a,h,vd,u),Rk(l,h);else if(MR(g,l,a,u,h))h.stopPropagation();else if(Rk(l,h),a&4&&-1<AR.indexOf(l)){for(;g!==null;){var x=ho(g);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var w=dl(x.pendingLanes);if(w!==0){var C=x;for(C.pendingLanes|=2,C.entangledLanes|=2;w;){var D=1<<31-xt(w);C.entanglements[1]|=D,w&=~D}cr(x),(ot&6)===0&&(rd=qe()+500,Oc(0))}}break;case 31:case 13:C=yl(x,2),C!==null&&Wn(C,x,2),ld(),wy(x,2)}if(x=ky(h),x===null&&ay(l,a,h,vd,u),x===g)break;g=x}g!==null&&h.stopPropagation()}else ay(l,a,h,null,u)}}function ky(l){return l=Em(l),Cy(l)}var vd=null;function Cy(l){if(vd=null,l=fo(l),l!==null){var a=s(l);if(a===null)l=null;else{var u=a.tag;if(u===13){if(l=o(a),l!==null)return l;l=null}else if(u===31){if(l=c(a),l!==null)return l;l=null}else if(u===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;l=null}else a!==l&&(l=null)}}return vd=l,null}function Nk(l){switch(l){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ft()){case Y:return 2;case oe:return 8;case Se:case Ue:return 32;case ut:return 268435456;default:return 32}default:return 32}}var Ey=!1,Os=null,_s=null,Ds=null,Ic=new Map,Bc=new Map,Ns=[],AR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Rk(l,a){switch(l){case"focusin":case"focusout":Os=null;break;case"dragenter":case"dragleave":_s=null;break;case"mouseover":case"mouseout":Ds=null;break;case"pointerover":case"pointerout":Ic.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bc.delete(a.pointerId)}}function jc(l,a,u,h,g,x){return l===null||l.nativeEvent!==x?(l={blockedOn:a,domEventName:u,eventSystemFlags:h,nativeEvent:x,targetContainers:[g]},a!==null&&(a=ho(a),a!==null&&_k(a)),l):(l.eventSystemFlags|=h,a=l.targetContainers,g!==null&&a.indexOf(g)===-1&&a.push(g),l)}function MR(l,a,u,h,g){switch(a){case"focusin":return Os=jc(Os,l,a,u,h,g),!0;case"dragenter":return _s=jc(_s,l,a,u,h,g),!0;case"mouseover":return Ds=jc(Ds,l,a,u,h,g),!0;case"pointerover":var x=g.pointerId;return Ic.set(x,jc(Ic.get(x)||null,l,a,u,h,g)),!0;case"gotpointercapture":return x=g.pointerId,Bc.set(x,jc(Bc.get(x)||null,l,a,u,h,g)),!0}return!1}function zk(l){var a=fo(l.target);if(a!==null){var u=s(a);if(u!==null){if(a=u.tag,a===13){if(a=o(u),a!==null){l.blockedOn=a,Gx(l.priority,function(){Dk(u)});return}}else if(a===31){if(a=c(u),a!==null){l.blockedOn=a,Gx(l.priority,function(){Dk(u)});return}}else if(a===3&&u.stateNode.current.memoizedState.isDehydrated){l.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}l.blockedOn=null}function kd(l){if(l.blockedOn!==null)return!1;for(var a=l.targetContainers;0<a.length;){var u=ky(l.nativeEvent);if(u===null){u=l.nativeEvent;var h=new u.constructor(u.type,u);Cm=h,u.target.dispatchEvent(h),Cm=null}else return a=ho(u),a!==null&&_k(a),l.blockedOn=u,!1;a.shift()}return!0}function Lk(l,a,u){kd(l)&&u.delete(a)}function OR(){Ey=!1,Os!==null&&kd(Os)&&(Os=null),_s!==null&&kd(_s)&&(_s=null),Ds!==null&&kd(Ds)&&(Ds=null),Ic.forEach(Lk),Bc.forEach(Lk)}function Cd(l,a){l.blockedOn===a&&(l.blockedOn=null,Ey||(Ey=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,OR)))}var Ed=null;function Ik(l){Ed!==l&&(Ed=l,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ed===l&&(Ed=null);for(var a=0;a<l.length;a+=3){var u=l[a],h=l[a+1],g=l[a+2];if(typeof h!="function"){if(Cy(h||u)===null)continue;break}var x=ho(u);x!==null&&(l.splice(a,3),a-=3,kg(x,{pending:!0,data:g,method:u.method,action:h},h,g))}}))}function Go(l){function a(D){return Cd(D,l)}Os!==null&&Cd(Os,l),_s!==null&&Cd(_s,l),Ds!==null&&Cd(Ds,l),Ic.forEach(a),Bc.forEach(a);for(var u=0;u<Ns.length;u++){var h=Ns[u];h.blockedOn===l&&(h.blockedOn=null)}for(;0<Ns.length&&(u=Ns[0],u.blockedOn===null);)zk(u),u.blockedOn===null&&Ns.shift();if(u=(l.ownerDocument||l).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var g=u[h],x=u[h+1],w=g[Yn]||null;if(typeof x=="function")w||Ik(u);else if(w){var C=null;if(x&&x.hasAttribute("formAction")){if(g=x,w=x[Yn]||null)C=w.formAction;else if(Cy(g)!==null)continue}else C=w.action;typeof C=="function"?u[h+1]=C:(u.splice(h,3),h-=3),Ik(u)}}}function Bk(){function l(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(w){return g=w})},focusReset:"manual",scroll:"manual"})}function a(){g!==null&&(g(),g=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,g=null;return navigation.addEventListener("navigate",l),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",l),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),g!==null&&(g(),g=null)}}}function Ty(l){this._internalRoot=l}Td.prototype.render=Ty.prototype.render=function(l){var a=this._internalRoot;if(a===null)throw Error(i(409));var u=a.current,h=pi();Mk(u,h,l,a,null,null)},Td.prototype.unmount=Ty.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var a=l.containerInfo;Mk(l.current,2,null,l,null,null),ld(),a[uo]=null}};function Td(l){this._internalRoot=l}Td.prototype.unstable_scheduleHydration=function(l){if(l){var a=Kx();l={blockedOn:null,target:l,priority:a};for(var u=0;u<Ns.length&&a!==0&&a<Ns[u].priority;u++);Ns.splice(u,0,l),u===0&&zk(l)}};var jk=e.version;if(jk!=="19.2.4")throw Error(i(527,jk,"19.2.4"));K.findDOMNode=function(l){var a=l._reactInternals;if(a===void 0)throw typeof l.render=="function"?Error(i(188)):(l=Object.keys(l).join(","),Error(i(268,l)));return l=d(a),l=l!==null?p(l):null,l=l===null?null:l.stateNode,l};var _R={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ad=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ad.isDisabled&&Ad.supportsFiber)try{Ln=Ad.inject(_R),en=Ad}catch{}}return Hc.createRoot=function(l,a){if(!r(l))throw Error(i(299));var u=!1,h="",g=qw,x=Yw,w=Kw;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(x=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError)),a=Tk(l,1,!1,null,null,u,h,null,g,x,w,Bk),l[uo]=a.current,oy(l),new Ty(a)},Hc.hydrateRoot=function(l,a,u){if(!r(l))throw Error(i(299));var h=!1,g="",x=qw,w=Yw,C=Kw,D=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(w=u.onCaughtError),u.onRecoverableError!==void 0&&(C=u.onRecoverableError),u.formState!==void 0&&(D=u.formState)),a=Tk(l,1,!0,a,u??null,h,g,D,x,w,C,Bk),a.context=Ak(null),u=a.current,h=pi(),h=gm(h),g=ys(h),g.callback=null,bs(u,g,h),u=h,a.current.lanes=u,Za(a,u),cr(a),l[uo]=a.current,oy(l),new Td(a)},Hc.version="19.2.4",Hc}var Gk;function VR(){if(Gk)return Oy.exports;Gk=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Oy.exports=HR(),Oy.exports}var PR=VR();class $R extends on.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("[Tandem] React error boundary caught:",e,n.componentStack)}render(){var e;return this.state.hasError?A.jsxs("div",{style:{padding:"2rem",fontFamily:"system-ui, sans-serif"},children:[A.jsx("h2",{children:"Something went wrong"}),A.jsx("p",{style:{color:"#666"},children:"The editor encountered an unexpected error. Reload the page to continue."}),A.jsx("pre",{style:{background:"#f5f5f5",padding:"1rem",borderRadius:"4px",fontSize:"12px",overflow:"auto",maxHeight:"200px"},children:(e=this.state.error)==null?void 0:e.message}),A.jsx("button",{onClick:()=>window.location.reload(),style:{marginTop:"1rem",padding:"8px 16px",cursor:"pointer",border:"1px solid #d1d5db",borderRadius:"4px",background:"#fff"},children:"Reload"})]}):this.props.children}}const Zk=3478,c1=3479,FR=3e3,qR=3e3,YR=3e4,KR=5,bu={yellow:"rgba(255, 235, 59, 0.3)",red:"rgba(244, 67, 54, 0.3)",green:"rgba(76, 175, 80, 0.3)",blue:"rgba(33, 150, 243, 0.3)",purple:"rgba(156, 39, 176, 0.3)"},GR="all",Jk="tandem:interruptionMode",u1="#6366f1",ZR="__tandem_ctrl__",oa="annotations",NA="awareness",RA="userAwareness",Xk="chat",th="documentMeta",Wk="savedAtVersion",f1="tandem:recentFiles",JR=20,V0="tandem:userName",P0="You",Qk={error:8e3,warning:6e3,info:4e3},XR=5,zA="tandem:tutorialCompleted",WR="tutorial-";function Sn(t){this.content=t}Sn.prototype={constructor:Sn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var i=n&&n!=t?this.remove(n):this,r=i.find(t),s=i.content.slice();return r==-1?s.push(n||t,e):(s[r+1]=e,n&&(s[r]=n)),new Sn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Sn(n)},addToStart:function(t,e){return new Sn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Sn(n)},addBefore:function(t,e,n){var i=this.remove(e),r=i.content.slice(),s=i.find(t);return r.splice(s==-1?r.length:s,0,e,n),new Sn(r)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Sn.from(t),t.size?new Sn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Sn.from(t),t.size?new Sn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Sn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Sn.from=function(t){if(t instanceof Sn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Sn(e)};function LA(t,e,n){for(let i=0;;i++){if(i==t.childCount||i==e.childCount)return t.childCount==e.childCount?null:n;let r=t.child(i),s=e.child(i);if(r==s){n+=r.nodeSize;continue}if(!r.sameMarkup(s))return n;if(r.isText&&r.text!=s.text){for(let o=0;r.text[o]==s.text[o];o++)n++;return n}if(r.content.size||s.content.size){let o=LA(r.content,s.content,n+1);if(o!=null)return o}n+=r.nodeSize}}function IA(t,e,n,i){for(let r=t.childCount,s=e.childCount;;){if(r==0||s==0)return r==s?null:{a:n,b:i};let o=t.child(--r),c=e.child(--s),f=o.nodeSize;if(o==c){n-=f,i-=f;continue}if(!o.sameMarkup(c))return{a:n,b:i};if(o.isText&&o.text!=c.text){let d=0,p=Math.min(o.text.length,c.text.length);for(;d<p&&o.text[o.text.length-d-1]==c.text[c.text.length-d-1];)d++,n--,i--;return{a:n,b:i}}if(o.content.size||c.content.size){let d=IA(o.content,c.content,n-1,i-1);if(d)return d}n-=f,i-=f}}class W{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let i=0;i<e.length;i++)this.size+=e[i].nodeSize}nodesBetween(e,n,i,r=0,s){for(let o=0,c=0;c<n;o++){let f=this.content[o],d=c+f.nodeSize;if(d>e&&i(f,r+c,s||null,o)!==!1&&f.content.size){let p=c+1;f.nodesBetween(Math.max(0,e-p),Math.min(f.content.size,n-p),i,r+p)}c=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,i,r){let s="",o=!0;return this.nodesBetween(e,n,(c,f)=>{let d=c.isText?c.text.slice(Math.max(e,f)-f,n-f):c.isLeaf?r?typeof r=="function"?r(c):r:c.type.spec.leafText?c.type.spec.leafText(c):"":"";c.isBlock&&(c.isLeaf&&d||c.isTextblock)&&i&&(o?o=!1:s+=i),s+=d},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,i=e.firstChild,r=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(r[r.length-1]=n.withText(n.text+i.text),s=1);s<e.content.length;s++)r.push(e.content[s]);return new W(r,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let i=[],r=0;if(n>e)for(let s=0,o=0;o<n;s++){let c=this.content[s],f=o+c.nodeSize;f>e&&((o<e||f>n)&&(c.isText?c=c.cut(Math.max(0,e-o),Math.min(c.text.length,n-o)):c=c.cut(Math.max(0,e-o-1),Math.min(c.content.size,n-o-1))),i.push(c),r+=c.nodeSize),o=f}return new W(i,r)}cutByIndex(e,n){return e==n?W.empty:e==0&&n==this.content.length?this:new W(this.content.slice(e,n))}replaceChild(e,n){let i=this.content[e];if(i==n)return this;let r=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return r[e]=n,new W(r,s)}addToStart(e){return new W([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new W(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,i=0;n<this.content.length;n++){let r=this.content[n];e(r,i,n),i+=r.nodeSize}}findDiffStart(e,n=0){return LA(this,e,n)}findDiffEnd(e,n=this.size,i=e.size){return IA(this,e,n,i)}findIndex(e){if(e==0)return Od(0,e);if(e==this.size)return Od(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let r=this.child(n),s=i+r.nodeSize;if(s>=e)return s==e?Od(n+1,s):Od(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return W.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new W(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return W.empty;let n,i=0;for(let r=0;r<e.length;r++){let s=e[r];i+=s.nodeSize,r&&s.isText&&e[r-1].sameMarkup(s)?(n||(n=e.slice(0,r)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new W(n||e,i)}static from(e){if(!e)return W.empty;if(e instanceof W)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new W([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}W.empty=new W([],0);const Ry={index:0,offset:0};function Od(t,e){return Ry.index=t,Ry.offset=e,Ry}function bh(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!bh(t[i],e[i]))return!1}else{for(let i in t)if(!(i in e)||!bh(t[i],e[i]))return!1;for(let i in e)if(!(i in t))return!1}return!0}let vt=class $0{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,i=!1;for(let r=0;r<e.length;r++){let s=e[r];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,r));else{if(s.type.excludes(this.type))return e;!i&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,r)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=e.slice()),i||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&bh(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let i=e.marks[n.type];if(!i)throw new RangeError(`There is no mark type ${n.type} in this schema`);let r=i.create(n.attrs);return i.checkAttrs(r.attrs),r}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].eq(n[i]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return $0.none;if(e instanceof $0)return[e];let n=e.slice();return n.sort((i,r)=>i.type.rank-r.type.rank),n}};vt.none=[];class xh extends Error{}class de{constructor(e,n,i){this.content=e,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let i=jA(this.content,e+this.openStart,n);return i&&new de(i,this.openStart,this.openEnd)}removeBetween(e,n){return new de(BA(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return de.empty;let i=n.openStart||0,r=n.openEnd||0;if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new de(W.fromJSON(e,n.content),i,r)}static maxOpen(e,n=!0){let i=0,r=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)r++;return new de(e,i,r)}}de.empty=new de(W.empty,0,0);function BA(t,e,n){let{index:i,offset:r}=t.findIndex(e),s=t.maybeChild(i),{index:o,offset:c}=t.findIndex(n);if(r==e||s.isText){if(c!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(i!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(i,s.copy(BA(s.content,e-r-1,n-r-1)))}function jA(t,e,n,i){let{index:r,offset:s}=t.findIndex(e),o=t.maybeChild(r);if(s==e||o.isText)return i&&!i.canReplace(r,r,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=jA(o.content,e-s-1,n,o);return c&&t.replaceChild(r,o.copy(c))}function QR(t,e,n){if(n.openStart>t.depth)throw new xh("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new xh("Inconsistent open depths");return UA(t,e,n,0)}function UA(t,e,n,i){let r=t.index(i),s=t.node(i);if(r==e.index(i)&&i<t.depth-n.openStart){let o=UA(t,e,n,i+1);return s.copy(s.content.replaceChild(r,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==i&&e.depth==i){let o=t.parent,c=o.content;return Vl(o,c.cut(0,t.parentOffset).append(n.content).append(c.cut(e.parentOffset)))}else{let{start:o,end:c}=ez(n,t);return Vl(s,VA(t,o,c,e,i))}else return Vl(s,Sh(t,e,i))}function HA(t,e){if(!e.type.compatibleContent(t.type))throw new xh("Cannot join "+e.type.name+" onto "+t.type.name)}function F0(t,e,n){let i=t.node(n);return HA(i,e.node(n)),i}function Hl(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Wc(t,e,n,i){let r=(e||t).node(n),s=0,o=e?e.index(n):r.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Hl(t.nodeAfter,i),s++));for(let c=s;c<o;c++)Hl(r.child(c),i);e&&e.depth==n&&e.textOffset&&Hl(e.nodeBefore,i)}function Vl(t,e){return t.type.checkContent(e),t.copy(e)}function VA(t,e,n,i,r){let s=t.depth>r&&F0(t,e,r+1),o=i.depth>r&&F0(n,i,r+1),c=[];return Wc(null,t,r,c),s&&o&&e.index(r)==n.index(r)?(HA(s,o),Hl(Vl(s,VA(t,e,n,i,r+1)),c)):(s&&Hl(Vl(s,Sh(t,e,r+1)),c),Wc(e,n,r,c),o&&Hl(Vl(o,Sh(n,i,r+1)),c)),Wc(i,null,r,c),new W(c)}function Sh(t,e,n){let i=[];if(Wc(null,t,n,i),t.depth>n){let r=F0(t,e,n+1);Hl(Vl(r,Sh(t,e,n+1)),i)}return Wc(e,null,n,i),new W(i)}function ez(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)r=e.node(s).copy(W.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}class xu{constructor(e,n,i){this.pos=e,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let i=this.pos-this.path[this.path.length-1],r=e.child(n);return i?e.child(n).cut(i):r}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let i=this.path[n*3],r=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)r+=i.child(s).nodeSize;return r}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return vt.none;if(this.textOffset)return e.child(n).marks;let i=e.maybeChild(n-1),r=e.maybeChild(n);if(!i){let c=i;i=r,r=c}let s=i.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!r||!s[o].isInSet(r.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let i=n.marks,r=e.parent.maybeChild(e.index());for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!r||!i[s].isInSet(r.marks))&&(i=i[s--].removeFromSet(i));return i}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!n||n(this.node(i))))return new wh(this,e,i);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let i=[],r=0,s=n;for(let o=e;;){let{index:c,offset:f}=o.content.findIndex(s),d=s-f;if(i.push(o,c,r+f),!d||(o=o.child(c),o.isText))break;s=d-1,r+=f+1}return new xu(n,i,s)}static resolveCached(e,n){let i=eC.get(e);if(i)for(let s=0;s<i.elts.length;s++){let o=i.elts[s];if(o.pos==n)return o}else eC.set(e,i=new tz);let r=i.elts[i.i]=xu.resolve(e,n);return i.i=(i.i+1)%nz,r}}class tz{constructor(){this.elts=[],this.i=0}}const nz=12,eC=new WeakMap;class wh{constructor(e,n,i){this.$from=e,this.$to=n,this.depth=i}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const iz=Object.create(null);let Js=class q0{constructor(e,n,i,r=vt.none){this.type=e,this.attrs=n,this.marks=r,this.content=i||W.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,i,r=0){this.content.nodesBetween(e,n,i,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,i,r){return this.content.textBetween(e,n,i,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,i){return this.type==e&&bh(this.attrs,n||e.defaultAttrs||iz)&&vt.sameSet(this.marks,i||vt.none)}copy(e=null){return e==this.content?this:new q0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new q0(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,i=!1){if(e==n)return de.empty;let r=this.resolve(e),s=this.resolve(n),o=i?0:r.sharedDepth(n),c=r.start(o),d=r.node(o).content.cut(r.pos-c,s.pos-c);return new de(d,r.depth-o,s.depth-o)}replace(e,n,i){return QR(this.resolve(e),this.resolve(n),i)}nodeAt(e){for(let n=this;;){let{index:i,offset:r}=n.content.findIndex(e);if(n=n.maybeChild(i),!n)return null;if(r==e||n.isText)return n;e-=r+1}}childAfter(e){let{index:n,offset:i}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:i}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:i}=this.content.findIndex(e);if(i<e)return{node:this.content.child(n),index:n,offset:i};let r=this.content.child(n-1);return{node:r,index:n-1,offset:i-r.nodeSize}}resolve(e){return xu.resolveCached(this,e)}resolveNoCache(e){return xu.resolve(this,e)}rangeHasMark(e,n,i){let r=!1;return n>e&&this.nodesBetween(e,n,s=>(i.isInSet(s.marks)&&(r=!0),!r)),r}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),PA(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,i=W.empty,r=0,s=i.childCount){let o=this.contentMatchAt(e).matchFragment(i,r,s),c=o&&o.matchFragment(this.content,n);if(!c||!c.validEnd)return!1;for(let f=r;f<s;f++)if(!this.type.allowsMarks(i.child(f).marks))return!1;return!0}canReplaceWith(e,n,i,r){if(r&&!this.type.allowsMarks(r))return!1;let s=this.contentMatchAt(e).matchType(i),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=vt.none;for(let n=0;n<this.marks.length;n++){let i=this.marks[n];i.type.checkAttrs(i.attrs),e=i.addToSet(e)}if(!vt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,i)}let r=W.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,r,i);return s.type.checkAttrs(s.attrs),s}};Js.prototype.text=void 0;class vh extends Js{constructor(e,n,i,r){if(super(e,n,null,r),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):PA(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new vh(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vh(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function PA(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Gl{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let i=new rz(e,n);if(i.next==null)return Gl.empty;let r=$A(i);i.next&&i.err("Unexpected trailing text");let s=fz(uz(r));return dz(s,i),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,i=e.childCount){let r=this;for(let s=n;r&&s<i;s++)r=r.matchType(e.child(s).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let i=0;i<e.next.length;i++)if(this.next[n].type==e.next[i].type)return!0;return!1}fillBefore(e,n=!1,i=0){let r=[this];function s(o,c){let f=o.matchFragment(e,i);if(f&&(!n||f.validEnd))return W.from(c.map(d=>d.createAndFill()));for(let d=0;d<o.next.length;d++){let{type:p,next:m}=o.next[d];if(!(p.isText||p.hasRequiredAttrs())&&r.indexOf(m)==-1){r.push(m);let y=s(m,c.concat(p));if(y)return y}}return null}return s(this,[])}findWrapping(e){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==e)return this.wrapCache[i+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let r=i.shift(),s=r.match;if(s.matchType(e)){let o=[];for(let c=r;c.type;c=c.via)o.push(c.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:c,next:f}=s.next[o];!c.isLeaf&&!c.hasRequiredAttrs()&&!(c.name in n)&&(!r.type||f.validEnd)&&(i.push({match:c.contentMatch,type:c,via:r}),n[c.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(i){e.push(i);for(let r=0;r<i.next.length;r++)e.indexOf(i.next[r].next)==-1&&n(i.next[r].next)}return n(this),e.map((i,r)=>{let s=r+(i.validEnd?"*":" ")+" ";for(let o=0;o<i.next.length;o++)s+=(o?", ":"")+i.next[o].type.name+"->"+e.indexOf(i.next[o].next);return s}).join(`
|
|
50
50
|
`)}}Gl.empty=new Gl(!0);class rz{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function $A(t){let e=[];do e.push(sz(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function sz(t){let e=[];do e.push(lz(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function lz(t){let e=cz(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=oz(t,e);else break;return e}function tC(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function oz(t,e){let n=tC(t),i=n;return t.eat(",")&&(t.next!="}"?i=tC(t):i=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:e}}function az(t,e){let n=t.nodeTypes,i=n[e];if(i)return[i];let r=[];for(let s in n){let o=n[s];o.isInGroup(e)&&r.push(o)}return r.length==0&&t.err("No node type or group '"+e+"' found"),r}function cz(t){if(t.eat("(")){let e=$A(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=az(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function uz(t){let e=[[]];return r(s(t,0),n()),e;function n(){return e.push([])-1}function i(o,c,f){let d={term:f,to:c};return e[o].push(d),d}function r(o,c){o.forEach(f=>f.to=c)}function s(o,c){if(o.type=="choice")return o.exprs.reduce((f,d)=>f.concat(s(d,c)),[]);if(o.type=="seq")for(let f=0;;f++){let d=s(o.exprs[f],c);if(f==o.exprs.length-1)return d;r(d,c=n())}else if(o.type=="star"){let f=n();return i(c,f),r(s(o.expr,f),f),[i(f)]}else if(o.type=="plus"){let f=n();return r(s(o.expr,c),f),r(s(o.expr,f),f),[i(f)]}else{if(o.type=="opt")return[i(c)].concat(s(o.expr,c));if(o.type=="range"){let f=c;for(let d=0;d<o.min;d++){let p=n();r(s(o.expr,f),p),f=p}if(o.max==-1)r(s(o.expr,f),f);else for(let d=o.min;d<o.max;d++){let p=n();i(f,p),r(s(o.expr,f),p),f=p}return[i(f)]}else{if(o.type=="name")return[i(c,void 0,o.value)];throw new Error("Unknown expr type")}}}}function FA(t,e){return e-t}function nC(t,e){let n=[];return i(e),n.sort(FA);function i(r){let s=t[r];if(s.length==1&&!s[0].term)return i(s[0].to);n.push(r);for(let o=0;o<s.length;o++){let{term:c,to:f}=s[o];!c&&n.indexOf(f)==-1&&i(f)}}}function fz(t){let e=Object.create(null);return n(nC(t,0));function n(i){let r=[];i.forEach(o=>{t[o].forEach(({term:c,to:f})=>{if(!c)return;let d;for(let p=0;p<r.length;p++)r[p][0]==c&&(d=r[p][1]);nC(t,f).forEach(p=>{d||r.push([c,d=[]]),d.indexOf(p)==-1&&d.push(p)})})});let s=e[i.join(",")]=new Gl(i.indexOf(t.length-1)>-1);for(let o=0;o<r.length;o++){let c=r[o][1].sort(FA);s.next.push({type:r[o][0],next:e[c.join(",")]||n(c)})}return s}}function dz(t,e){for(let n=0,i=[t];n<i.length;n++){let r=i[n],s=!r.validEnd,o=[];for(let c=0;c<r.next.length;c++){let{type:f,next:d}=r.next[c];o.push(f.name),s&&!(f.isText||f.hasRequiredAttrs())&&(s=!1),i.indexOf(d)==-1&&i.push(d)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function qA(t){let e=Object.create(null);for(let n in t){let i=t[n];if(!i.hasDefault)return null;e[n]=i.default}return e}function YA(t,e){let n=Object.create(null);for(let i in t){let r=e&&e[i];if(r===void 0){let s=t[i];if(s.hasDefault)r=s.default;else throw new RangeError("No value supplied for attribute "+i)}n[i]=r}return n}function KA(t,e,n,i){for(let r in e)if(!(r in t))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let r in t){let s=t[r];s.validate&&s.validate(e[r])}}function GA(t,e){let n=Object.create(null);if(e)for(let i in e)n[i]=new pz(t,i,e[i]);return n}let iC=class ZA{constructor(e,n,i){this.name=e,this.schema=n,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=GA(e,i.attrs),this.defaultAttrs=qA(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Gl.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:YA(this.attrs,e)}create(e=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Js(this,this.computeAttrs(e),W.from(n),vt.setFrom(i))}createChecked(e=null,n,i){return n=W.from(n),this.checkContent(n),new Js(this,this.computeAttrs(e),n,vt.setFrom(i))}createAndFill(e=null,n,i){if(e=this.computeAttrs(e),n=W.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let r=this.contentMatch.matchFragment(n),s=r&&r.fillBefore(W.empty,!0);return s?new Js(this,e,n.append(s),vt.setFrom(i)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){KA(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?n&&n.push(e[i]):n||(n=e.slice(0,i));return n?n.length?n:vt.none:e}static compile(e,n){let i=Object.create(null);e.forEach((s,o)=>i[s]=new ZA(s,n,o));let r=n.spec.topNode||"doc";if(!i[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function hz(t,e,n){let i=n.split("|");return r=>{let s=r===null?"null":typeof r;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${e} on type ${t}, got ${s}`)}}class pz{constructor(e,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?hz(e,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class Lp{constructor(e,n,i,r){this.name=e,this.rank=n,this.schema=i,this.spec=r,this.attrs=GA(e,r.attrs),this.excluded=null;let s=qA(this.attrs);this.instance=s?new vt(this,s):null}create(e=null){return!e&&this.instance?this.instance:new vt(this,YA(this.attrs,e))}static compile(e,n){let i=Object.create(null),r=0;return e.forEach((s,o)=>i[s]=new Lp(s,r++,n,o)),i}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){KA(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let JA=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let r in e)n[r]=e[r];n.nodes=Sn.from(e.nodes),n.marks=Sn.from(e.marks||{}),this.nodes=iC.compile(this.spec.nodes,this),this.marks=Lp.compile(this.spec.marks,this);let i=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let s=this.nodes[r],o=s.spec.content||"",c=s.spec.marks;if(s.contentMatch=i[o]||(i[o]=Gl.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=c=="_"?null:c?rC(this,c.split(" ")):c==""||!s.inlineContent?[]:null}for(let r in this.marks){let s=this.marks[r],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:rC(this,o.split(" "))}this.nodeFromJSON=r=>Js.fromJSON(this,r),this.markFromJSON=r=>vt.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,i,r){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof iC){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,i,r)}text(e,n){let i=this.nodes.text;return new vh(i,i.defaultAttrs,e,vt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function rC(t,e){let n=[];for(let i=0;i<e.length;i++){let r=e[i],s=t.marks[r],o=s;if(s)n.push(s);else for(let c in t.marks){let f=t.marks[c];(r=="_"||f.spec.group&&f.spec.group.split(" ").indexOf(r)>-1)&&n.push(o=f)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[i]+"'")}return n}function mz(t){return t.tag!=null}function gz(t){return t.style!=null}let Qc=class Y0{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(r=>{if(mz(r))this.tags.push(r);else if(gz(r)){let s=/[^=]*/.exec(r.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let s=e.nodes[r.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let i=new lC(this,n,!1);return i.addAll(e,vt.none,n.from,n.to),i.finish()}parseSlice(e,n={}){let i=new lC(this,n,!0);return i.addAll(e,vt.none,n.from,n.to),de.maxOpen(i.finish())}matchTag(e,n,i){for(let r=i?this.tags.indexOf(i)+1:0;r<this.tags.length;r++){let s=this.tags[r];if(xz(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,i,r){for(let s=r?this.styles.indexOf(r)+1:0;s<this.styles.length;s++){let o=this.styles[s],c=o.style;if(!(c.indexOf(e)!=0||o.context&&!i.matchesContext(o.context)||c.length>e.length&&(c.charCodeAt(e.length)!=61||c.slice(e.length+1)!=n))){if(o.getAttrs){let f=o.getAttrs(n);if(f===!1)continue;o.attrs=f||void 0}return o}}}static schemaRules(e){let n=[];function i(r){let s=r.priority==null?50:r.priority,o=0;for(;o<n.length;o++){let c=n[o];if((c.priority==null?50:c.priority)<s)break}n.splice(o,0,r)}for(let r in e.marks){let s=e.marks[r].spec.parseDOM;s&&s.forEach(o=>{i(o=oC(o)),o.mark||o.ignore||o.clearMark||(o.mark=r)})}for(let r in e.nodes){let s=e.nodes[r].spec.parseDOM;s&&s.forEach(o=>{i(o=oC(o)),o.node||o.ignore||o.mark||(o.node=r)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Y0(e,Y0.schemaRules(e)))}};const XA={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},yz={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},WA={ol:!0,ul:!0},Su=1,K0=2,eu=4;function sC(t,e,n){return e!=null?(e?Su:0)|(e==="full"?K0:0):t&&t.whitespace=="pre"?Su|K0:n&~eu}class _d{constructor(e,n,i,r,s,o){this.type=e,this.attrs=n,this.marks=i,this.solid=r,this.options=o,this.content=[],this.activeMarks=vt.none,this.match=s||(o&eu?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(W.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,r;return(r=i.findWrapping(e.type))?(this.match=i,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Su)){let i=this.content[this.content.length-1],r;if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-r[0].length))}}let n=W.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(W.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!XA.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class lC{constructor(e,n,i){this.parser=e,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let r=n.topNode,s,o=sC(null,n.preserveWhitespace,0)|(i?eu:0);r?s=new _d(r.type,r.attrs,vt.none,!0,n.topMatch||r.type.contentMatch,o):i?s=new _d(null,null,vt.none,!0,null,o):s=new _d(e.schema.topNodeType,null,vt.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let i=e.nodeValue,r=this.top,s=r.options&K0?"full":this.localPreserveWS||(r.options&Su)>0,{schema:o}=this.parser;if(s==="full"||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,`
|
|
51
51
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(o.linebreakReplacement.create())){let c=i.split(/\r?\n|\r/);for(let f=0;f<c.length;f++)f&&this.insertNode(o.linebreakReplacement.create(),n,!0),c[f]&&this.insertNode(o.text(c[f]),n,!/\S/.test(c[f]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let c=r.content[r.content.length-1],f=e.previousSibling;(!c||f&&f.nodeName=="BR"||c.isText&&/[ \t\r\n\u000c]$/.test(c.text))&&(i=i.slice(1))}i&&this.insertNode(o.text(i),n,!/\S/.test(i)),this.findInText(e)}else this.findInside(e)}addElement(e,n,i){let r=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),c;WA.hasOwnProperty(o)&&this.parser.normalizeLists&&bz(e);let f=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(c=this.parser.matchTag(e,this,i));e:if(f?f.ignore:yz.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!f||f.skip||f.closeParent){f&&f.closeParent?this.open=Math.max(0,this.open-1):f&&f.skip.nodeType&&(e=f.skip);let d,p=this.needsBlock;if(XA.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),d=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let m=f&&f.skip?n:this.readStyles(e,n);m&&this.addAll(e,m),d&&this.sync(s),this.needsBlock=p}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,f,d,f.consuming===!1?c:void 0)}this.localPreserveWS=r}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
52
52
|
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let i=e.style;if(i&&i.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let s=this.parser.matchedStyles[r],o=i.getPropertyValue(s);if(o)for(let c=void 0;;){let f=this.parser.matchStyle(s,o,this,c);if(!f)break;if(f.ignore)return null;if(f.clearMark?n=n.filter(d=>!f.clearMark(d)):n=n.concat(this.parser.schema.marks[f.mark].create(f.attrs)),f.consuming===!1)c=f;else break}}return n}addElementByRule(e,n,i,r){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),i,e.nodeName=="BR")||this.leafFallback(e,i);else{let f=this.enter(o,n.attrs||null,i,n.preserveWhitespace);f&&(s=!0,i=f)}else{let f=this.parser.schema.marks[n.mark];i=i.concat(f.create(n.attrs))}let c=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,i,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(f=>this.insertNode(f,i,!1));else{let f=e;typeof n.contentElement=="string"?f=e.querySelector(n.contentElement):typeof n.contentElement=="function"?f=n.contentElement(e):n.contentElement&&(f=n.contentElement),this.findAround(e,f,!0),this.addAll(f,i),this.findAround(e,f,!1)}s&&this.sync(c)&&this.open--}addAll(e,n,i,r){let s=i||0;for(let o=i?e.childNodes[i]:e.firstChild,c=r==null?null:e.childNodes[r];o!=c;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,i){let r,s;for(let o=this.open,c=0;o>=0;o--){let f=this.nodes[o],d=f.findWrapping(e);if(d&&(!r||r.length>d.length+c)&&(r=d,s=f,!d.length))break;if(f.solid){if(i)break;c+=2}}if(!r)return null;this.sync(s);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n,i){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let r=this.findPlace(e,n,i);if(r){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=vt.none;for(let c of r.concat(e.marks))(s.type?s.type.allowsMarkType(c.type):aC(c.type,e.type))&&(o=c.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,i,r){let s=this.findPlace(e.create(n),i,!1);return s&&(s=this.enterInner(e,n,i,!0,r)),s}enterInner(e,n,i,r=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let c=sC(e,s,o.options);o.options&eu&&o.content.length==0&&(c|=eu);let f=vt.none;return i=i.filter(d=>(o.type?o.type.allowsMarkType(d.type):aC(d.type,e))?(f=d.addToSet(f),!1):!0),this.nodes.push(new _d(e,n,f,r,null,c)),this.open++,i}closeExtra(e=!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(e));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(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Su)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let r=i.length-1;r>=0;r--)e+=i[r].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==n&&(this.find[i].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,i){if(e!=n&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&n.compareDocumentPosition(this.find[r].node)&(i?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),i=this.options.context,r=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(r?0:1),o=(c,f)=>{for(;c>=0;c--){let d=n[c];if(d==""){if(c==n.length-1||c==0)continue;for(;f>=s;f--)if(o(c-1,f))return!0;return!1}else{let p=f>0||f==0&&r?this.nodes[f].type:i&&f>=s?i.node(f-s).type:null;if(!p||p.name!=d&&!p.isInGroup(d))return!1;f--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function bz(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let i=e.nodeType==1?e.nodeName.toLowerCase():null;i&&WA.hasOwnProperty(i)&&n?(n.appendChild(e),e=n):i=="li"?n=e:i&&(n=null)}}function xz(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function oC(t){let e={};for(let n in t)e[n]=t[n];return e}function aC(t,e){let n=e.schema.nodes;for(let i in n){let r=n[i];if(!r.allowsMarkType(t))continue;let s=[],o=c=>{s.push(c);for(let f=0;f<c.edgeCount;f++){let{type:d,next:p}=c.edge(f);if(d==e||s.indexOf(p)<0&&o(p))return!0}};if(o(r.contentMatch))return!0}}class lo{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},i){i||(i=zy(n).createDocumentFragment());let r=i,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let c=0,f=0;for(;c<s.length&&f<o.marks.length;){let d=o.marks[f];if(!this.marks[d.type.name]){f++;continue}if(!d.eq(s[c][0])||d.type.spec.spanning===!1)break;c++,f++}for(;c<s.length;)r=s.pop()[1];for(;f<o.marks.length;){let d=o.marks[f++],p=this.serializeMark(d,o.isInline,n);p&&(s.push([d,r]),r.appendChild(p.dom),r=p.contentDOM||p.dom)}}r.appendChild(this.serializeNodeInner(o,n))}),i}serializeNodeInner(e,n){let{dom:i,contentDOM:r}=nh(zy(n),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,r)}return i}serializeNode(e,n={}){let i=this.serializeNodeInner(e,n);for(let r=e.marks.length-1;r>=0;r--){let s=this.serializeMark(e.marks[r],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(e,n,i={}){let r=this.marks[e.type.name];return r&&nh(zy(i),r(e,n),null,e.attrs)}static renderSpec(e,n,i=null,r){return nh(e,n,i,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new lo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=cC(e.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(e){return cC(e.marks)}}function cC(t){let e={};for(let n in t){let i=t[n].spec.toDOM;i&&(e[n]=i)}return e}function zy(t){return t.document||window.document}const uC=new WeakMap;function Sz(t){let e=uC.get(t);return e===void 0&&uC.set(t,e=wz(t)),e}function wz(t){let e=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")e||(e=[]),e.push(i);else for(let r=0;r<i.length;r++)n(i[r]);else for(let r in i)n(i[r])}return n(t),e}function nh(t,e,n,i){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let r=e[0],s;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(i&&(s=Sz(i))&&s.indexOf(e)>-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 o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));let c,f=n?t.createElementNS(n,r):t.createElement(r),d=e[1],p=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){p=2;for(let m in d)if(d[m]!=null){let y=m.indexOf(" ");y>0?f.setAttributeNS(m.slice(0,y),m.slice(y+1),d[m]):m=="style"&&f.style?f.style.cssText=d[m]:f.setAttribute(m,d[m])}}for(let m=p;m<e.length;m++){let y=e[m];if(y===0){if(m<e.length-1||m>p)throw new RangeError("Content hole must be the only child of its parent node");return{dom:f,contentDOM:f}}else{let{dom:b,contentDOM:S}=nh(t,y,n,i);if(f.appendChild(b),S){if(c)throw new RangeError("Multiple content holes");c=S}}}return{dom:f,contentDOM:c}}const QA=65535,eM=Math.pow(2,16);function vz(t,e){return t+e*eM}function fC(t){return t&QA}function kz(t){return(t-(t&QA))/eM}const tM=1,nM=2,ih=4,iM=8;class G0{constructor(e,n,i){this.pos=e,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&iM)>0}get deletedBefore(){return(this.delInfo&(tM|ih))>0}get deletedAfter(){return(this.delInfo&(nM|ih))>0}get deletedAcross(){return(this.delInfo&ih)>0}}class bi{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&bi.empty)return bi.empty}recover(e){let n=0,i=fC(e);if(!this.inverted)for(let r=0;r<i;r++)n+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[i*3]+n+kz(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,i){let r=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let f=this.ranges[c]-(this.inverted?r:0);if(f>e)break;let d=this.ranges[c+s],p=this.ranges[c+o],m=f+d;if(e<=m){let y=d?e==f?-1:e==m?1:n:n,b=f+r+(y<0?0:p);if(i)return b;let S=e==(n<0?f:m)?null:vz(c/3,e-f),v=e==f?nM:e==m?tM:ih;return(n<0?e!=f:e!=m)&&(v|=iM),new G0(b,v,S)}r+=p-d}return i?e+r:new G0(e+r,0,null)}touches(e,n){let i=0,r=fC(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let f=this.ranges[c]-(this.inverted?i:0);if(f>e)break;let d=this.ranges[c+s],p=f+d;if(e<=p&&c==r*3)return!0;i+=this.ranges[c+o]-d}return!1}forEach(e){let n=this.inverted?2:1,i=this.inverted?1:2;for(let r=0,s=0;r<this.ranges.length;r+=3){let o=this.ranges[r],c=o-(this.inverted?s:0),f=o+(this.inverted?0:s),d=this.ranges[r+n],p=this.ranges[r+i];e(c,c+d,f,f+p),s+=p-d}}invert(){return new bi(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?bi.empty:new bi(e<0?[0,-e,0]:[0,0,e])}}bi.empty=new bi([]);class wu{constructor(e,n,i=0,r=e?e.length:0){this.mirror=n,this.from=i,this.to=r,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new wu(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,i=this._maps.length;n<e._maps.length;n++){let r=e.getMirror(n);this.appendMap(e._maps[n],r!=null&&r<n?i+r:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,i=this._maps.length+e._maps.length;n>=0;n--){let r=e.getMirror(n);this.appendMap(e._maps[n].invert(),r!=null&&r>n?i-r-1:void 0)}}invert(){let e=new wu;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let i=this.from;i<this.to;i++)e=this._maps[i].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,i){let r=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],c=o.mapResult(e,n);if(c.recover!=null){let f=this.getMirror(s);if(f!=null&&f>s&&f<this.to){s=f,e=this._maps[f].recover(c.recover);continue}}r|=c.delInfo,e=c.pos}return i?e:new G0(e,r,null)}}const Ly=Object.create(null);class Rn{getMap(){return bi.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let i=Ly[n.stepType];if(!i)throw new RangeError(`No step type ${n.stepType} defined`);return i.fromJSON(e,n)}static jsonID(e,n){if(e in Ly)throw new RangeError("Duplicate use of step JSON ID "+e);return Ly[e]=n,n.prototype.jsonID=e,n}}class Zt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Zt(e,null)}static fail(e){return new Zt(null,e)}static fromReplace(e,n,i,r){try{return Zt.ok(e.replace(n,i,r))}catch(s){if(s instanceof xh)return Zt.fail(s.message);throw s}}}function d1(t,e,n){let i=[];for(let r=0;r<t.childCount;r++){let s=t.child(r);s.content.size&&(s=s.copy(d1(s.content,e,s))),s.isInline&&(s=e(s,n,r)),i.push(s)}return W.fromArray(i)}class Ys extends Rn{constructor(e,n,i){super(),this.from=e,this.to=n,this.mark=i}apply(e){let n=e.slice(this.from,this.to),i=e.resolve(this.from),r=i.node(i.sharedDepth(this.to)),s=new de(d1(n.content,(o,c)=>!o.isAtom||!c.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),r),n.openStart,n.openEnd);return Zt.fromReplace(e,this.from,this.to,s)}invert(){return new mr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Ys(n.pos,i.pos,this.mark)}merge(e){return e instanceof Ys&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ys(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ys(n.from,n.to,e.markFromJSON(n.mark))}}Rn.jsonID("addMark",Ys);class mr extends Rn{constructor(e,n,i){super(),this.from=e,this.to=n,this.mark=i}apply(e){let n=e.slice(this.from,this.to),i=new de(d1(n.content,r=>r.mark(this.mark.removeFromSet(r.marks)),e),n.openStart,n.openEnd);return Zt.fromReplace(e,this.from,this.to,i)}invert(){return new Ys(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new mr(n.pos,i.pos,this.mark)}merge(e){return e instanceof mr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new mr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new mr(n.from,n.to,e.markFromJSON(n.mark))}}Rn.jsonID("removeMark",mr);class Ks extends Rn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Zt.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Zt.fromReplace(e,this.pos,this.pos+1,new de(W.from(i),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(i))return new Ks(this.pos,n.marks[r]);return new Ks(this.pos,this.mark)}}return new Zl(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ks(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ks(n.pos,e.markFromJSON(n.mark))}}Rn.jsonID("addNodeMark",Ks);class Zl extends Rn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Zt.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Zt.fromReplace(e,this.pos,this.pos+1,new de(W.from(i),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ks(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Zl(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Zl(n.pos,e.markFromJSON(n.mark))}}Rn.jsonID("removeNodeMark",Zl);class an extends Rn{constructor(e,n,i,r=!1){super(),this.from=e,this.to=n,this.slice=i,this.structure=r}apply(e){return this.structure&&Z0(e,this.from,this.to)?Zt.fail("Structure replace would overwrite content"):Zt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new bi([this.from,this.to-this.from,this.slice.size])}invert(e){return new an(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deletedAcross&&i.deletedAcross?null:new an(n.pos,Math.max(n.pos,i.pos),this.slice,this.structure)}merge(e){if(!(e instanceof an)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?de.empty:new de(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new an(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?de.empty:new de(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new an(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new an(n.from,n.to,de.fromJSON(e,n.slice),!!n.structure)}}Rn.jsonID("replace",an);class cn extends Rn{constructor(e,n,i,r,s,o,c=!1){super(),this.from=e,this.to=n,this.gapFrom=i,this.gapTo=r,this.slice=s,this.insert=o,this.structure=c}apply(e){if(this.structure&&(Z0(e,this.from,this.gapFrom)||Z0(e,this.gapTo,this.to)))return Zt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Zt.fail("Gap is not a flat range");let i=this.slice.insertAt(this.insert,n.content);return i?Zt.fromReplace(e,this.from,this.to,i):Zt.fail("Content does not fit in gap")}getMap(){return new bi([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new cn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1),r=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?i.pos:e.map(this.gapTo,1);return n.deletedAcross&&i.deletedAcross||r<n.pos||s>i.pos?null:new cn(n.pos,i.pos,r,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,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 cn(n.from,n.to,n.gapFrom,n.gapTo,de.fromJSON(e,n.slice),n.insert,!!n.structure)}}Rn.jsonID("replaceAround",cn);function Z0(t,e,n){let i=t.resolve(e),r=n-e,s=i.depth;for(;r>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,r--;if(r>0){let o=i.node(s).maybeChild(i.indexAfter(s));for(;r>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,r--}}return!1}function Cz(t,e,n,i){let r=[],s=[],o,c;t.doc.nodesBetween(e,n,(f,d,p)=>{if(!f.isInline)return;let m=f.marks;if(!i.isInSet(m)&&p.type.allowsMarkType(i.type)){let y=Math.max(d,e),b=Math.min(d+f.nodeSize,n),S=i.addToSet(m);for(let v=0;v<m.length;v++)m[v].isInSet(S)||(o&&o.to==y&&o.mark.eq(m[v])?o.to=b:r.push(o=new mr(y,b,m[v])));c&&c.to==y?c.to=b:s.push(c=new Ys(y,b,i))}}),r.forEach(f=>t.step(f)),s.forEach(f=>t.step(f))}function Ez(t,e,n,i){let r=[],s=0;t.doc.nodesBetween(e,n,(o,c)=>{if(!o.isInline)return;s++;let f=null;if(i instanceof Lp){let d=o.marks,p;for(;p=i.isInSet(d);)(f||(f=[])).push(p),d=p.removeFromSet(d)}else i?i.isInSet(o.marks)&&(f=[i]):f=o.marks;if(f&&f.length){let d=Math.min(c+o.nodeSize,n);for(let p=0;p<f.length;p++){let m=f[p],y;for(let b=0;b<r.length;b++){let S=r[b];S.step==s-1&&m.eq(r[b].style)&&(y=S)}y?(y.to=d,y.step=s):r.push({style:m,from:Math.max(c,e),to:d,step:s})}}}),r.forEach(o=>t.step(new mr(o.from,o.to,o.style)))}function h1(t,e,n,i=n.contentMatch,r=!0){let s=t.doc.nodeAt(e),o=[],c=e+1;for(let f=0;f<s.childCount;f++){let d=s.child(f),p=c+d.nodeSize,m=i.matchType(d.type);if(!m)o.push(new an(c,p,de.empty));else{i=m;for(let y=0;y<d.marks.length;y++)n.allowsMarkType(d.marks[y].type)||t.step(new mr(c,p,d.marks[y]));if(r&&d.isText&&n.whitespace!="pre"){let y,b=/\r?\n|\r/g,S;for(;y=b.exec(d.text);)S||(S=new de(W.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),o.push(new an(c+y.index,c+y.index+y[0].length,S))}}c=p}if(!i.validEnd){let f=i.fillBefore(W.empty,!0);t.replace(c,c,new de(f,0,0))}for(let f=o.length-1;f>=0;f--)t.step(o[f])}function Tz(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ba(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let i=t.depth,r=0,s=0;;--i){let o=t.$from.node(i),c=t.$from.index(i)+r,f=t.$to.indexAfter(i)-s;if(i<t.depth&&o.canReplace(c,f,n))return i;if(i==0||o.type.spec.isolating||!Tz(o,c,f))break;c&&(r=1),f<o.childCount&&(s=1)}return null}function Az(t,e,n){let{$from:i,$to:r,depth:s}=e,o=i.before(s+1),c=r.after(s+1),f=o,d=c,p=W.empty,m=0;for(let S=s,v=!1;S>n;S--)v||i.index(S)>0?(v=!0,p=W.from(i.node(S).copy(p)),m++):f--;let y=W.empty,b=0;for(let S=s,v=!1;S>n;S--)v||r.after(S+1)<r.end(S)?(v=!0,y=W.from(r.node(S).copy(y)),b++):d++;t.step(new cn(f,d,o,c,new de(p.append(y),m,b),p.size-m,!0))}function p1(t,e,n=null,i=t){let r=Mz(t,e),s=r&&Oz(i,e);return s?r.map(dC).concat({type:e,attrs:n}).concat(s.map(dC)):null}function dC(t){return{type:t,attrs:null}}function Mz(t,e){let{parent:n,startIndex:i,endIndex:r}=t,s=n.contentMatchAt(i).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(i,r,o)?s:null}function Oz(t,e){let{parent:n,startIndex:i,endIndex:r}=t,s=n.child(i),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let f=(o.length?o[o.length-1]:e).contentMatch;for(let d=i;f&&d<r;d++)f=f.matchType(n.child(d).type);return!f||!f.validEnd?null:o}function _z(t,e,n){let i=W.empty;for(let o=n.length-1;o>=0;o--){if(i.size){let c=n[o].type.contentMatch.matchFragment(i);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=W.from(n[o].type.create(n[o].attrs,i))}let r=e.start,s=e.end;t.step(new cn(r,s,r,s,new de(i,0,0),n.length,!0))}function Dz(t,e,n,i,r){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,c)=>{let f=typeof r=="function"?r(o):r;if(o.isTextblock&&!o.hasMarkup(i,f)&&Nz(t.doc,t.mapping.slice(s).map(c),i)){let d=null;if(i.schema.linebreakReplacement){let b=i.whitespace=="pre",S=!!i.contentMatch.matchType(i.schema.linebreakReplacement);b&&!S?d=!1:!b&&S&&(d=!0)}d===!1&&sM(t,o,c,s),h1(t,t.mapping.slice(s).map(c,1),i,void 0,d===null);let p=t.mapping.slice(s),m=p.map(c,1),y=p.map(c+o.nodeSize,1);return t.step(new cn(m,y,m+1,y-1,new de(W.from(i.create(f,null,o.marks)),0,0),1,!0)),d===!0&&rM(t,o,c,s),!1}})}function rM(t,e,n,i){e.forEach((r,s)=>{if(r.isText){let o,c=/\r?\n|\r/g;for(;o=c.exec(r.text);){let f=t.mapping.slice(i).map(n+1+s+o.index);t.replaceWith(f,f+1,e.type.schema.linebreakReplacement.create())}}})}function sM(t,e,n,i){e.forEach((r,s)=>{if(r.type==r.type.schema.linebreakReplacement){let o=t.mapping.slice(i).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -156,9 +156,9 @@ img.ProseMirror-separator {
|
|
|
156
156
|
`));return o.replaceSelectionWith(this.type.create({language:s},f)),o.selection.$from.parent.type!==this.type&&o.setSelection(Ae.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),II=hn.create({name:"doc",topNode:!0,content:"block+"});function BI(t={}){return new kt({view(e){return new jI(e,t)}})}class jI{constructor(e,n){var i;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(i=n.width)!==null&&i!==void 0?i:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let s=o=>{this[r](o)};return e.dom.addEventListener(r,s),{name:r,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,i,r=this.editorView.dom,s=r.getBoundingClientRect(),o=s.width/r.offsetWidth,c=s.height/r.offsetHeight;if(n){let m=e.nodeBefore,y=e.nodeAfter;if(m||y){let b=this.editorView.nodeDOM(this.cursorPos-(m?m.nodeSize:0));if(b){let S=b.getBoundingClientRect(),v=m?S.bottom:S.top;m&&y&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let k=this.width/2*c;i={left:S.left,right:S.right,top:v-k,bottom:v+k}}}}if(!i){let m=this.editorView.coordsAtPos(this.cursorPos),y=this.width/2*o;i={left:m.left-y,right:m.left+y,top:m.top,bottom:m.bottom}}let f=this.editorView.dom.offsetParent;this.element||(this.element=f.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let d,p;if(!f||f==document.body&&getComputedStyle(f).position=="static")d=-pageXOffset,p=-pageYOffset;else{let m=f.getBoundingClientRect(),y=m.width/f.offsetWidth,b=m.height/f.offsetHeight;d=m.left-f.scrollLeft*y,p=m.top-f.scrollTop*b}this.element.style.left=(i.left-d)/o+"px",this.element.style.top=(i.top-p)/c+"px",this.element.style.width=(i.right-i.left)/o+"px",this.element.style.height=(i.bottom-i.top)/c+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),i=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),r=i&&i.type.spec.disableDropCursor,s=typeof r=="function"?r(this.editorView,n,e):r;if(n&&!s){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let c=oM(this.editorView.state.doc,o,this.editorView.dragging.slice);c!=null&&(o=c)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const UI=Xt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[BI(this.options)]}});class Bt extends _e{constructor(e){super(e,e)}map(e,n){let i=e.resolve(n.map(this.head));return Bt.valid(i)?new Bt(i):_e.near(i)}content(){return de.empty}eq(e){return e instanceof Bt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Bt(e.resolve(n.pos))}getBookmark(){return new U1(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!HI(e)||!VI(e))return!1;let i=n.type.spec.allowGapCursor;if(i!=null)return i;let r=n.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,n,i=!1){e:for(;;){if(!i&&Bt.valid(e))return e;let r=e.pos,s=null;for(let o=e.depth;;o--){let c=e.node(o);if(n>0?e.indexAfter(o)<c.childCount:e.index(o)>0){s=c.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;r+=n;let f=e.doc.resolve(r);if(Bt.valid(f))return f}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!Ee.isSelectable(s)){e=e.doc.resolve(r+s.nodeSize*n),i=!1;continue e}break}s=o,r+=n;let c=e.doc.resolve(r);if(Bt.valid(c))return c}return null}}}Bt.prototype.visible=!1;Bt.findFrom=Bt.findGapCursorFrom;_e.jsonID("gapcursor",Bt);class U1{constructor(e){this.pos=e}map(e){return new U1(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Bt.valid(n)?new Bt(n):_e.near(n)}}function vO(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function HI(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),i=t.node(e);if(n==0){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(n-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||vO(r.type))return!0;if(r.inlineContent)return!1}}return!0}function VI(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),i=t.node(e);if(n==i.childCount){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(n);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||vO(r.type))return!0;if(r.inlineContent)return!1}}return!0}function PI(){return new kt({props:{decorations:YI,createSelectionBetween(t,e,n){return e.pos==n.pos&&Bt.valid(n)?new Bt(n):null},handleClick:FI,handleKeyDown:$I,handleDOMEvents:{beforeinput:qI}}})}const $I=T1({ArrowLeft:Id("horiz",-1),ArrowRight:Id("horiz",1),ArrowUp:Id("vert",-1),ArrowDown:Id("vert",1)});function Id(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(i,r,s){let o=i.selection,c=e>0?o.$to:o.$from,f=o.empty;if(o instanceof Ae){if(!s.endOfTextblock(n)||c.depth==0)return!1;f=!1,c=i.doc.resolve(e>0?c.after():c.before())}let d=Bt.findGapCursorFrom(c,e,f);return d?(r&&r(i.tr.setSelection(new Bt(d))),!0):!1}}function FI(t,e,n){if(!t||!t.editable)return!1;let i=t.state.doc.resolve(e);if(!Bt.valid(i))return!1;let r=t.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&Ee.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Bt(i))),!0)}function qI(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Bt))return!1;let{$from:n}=t.state.selection,i=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!i)return!1;let r=W.empty;for(let o=i.length-1;o>=0;o--)r=W.from(i[o].createAndFill(null,r));let s=t.state.tr.replace(n.pos,n.pos,new de(r,0,0));return s.setSelection(Ae.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function YI(t){if(!(t.selection instanceof Bt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",bt.create(t.doc,[Jt.widget(t.selection.head,e,{key:"gapcursor"})])}const KI=Xt.create({name:"gapCursor",addProseMirrorPlugins(){return[PI()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=$e(xe(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),GI=hn.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Ut(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
157
157
|
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:i})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:s}=n;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:c}=i.extensionManager,f=s||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:p})=>{if(p&&f&&o){const m=f.filter(y=>c.includes(y.type.name));d.ensureMarks(m)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ZI=hn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Ut(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>cb({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Dh=200,un=function(){};un.prototype.append=function(e){return e.length?(e=un.from(e),!this.length&&e||e.length<Dh&&this.leafAppend(e)||this.length<Dh&&e.leafPrepend(this)||this.appendInner(e)):this};un.prototype.prepend=function(e){return e.length?un.from(e).append(this):this};un.prototype.appendInner=function(e){return new JI(this,e)};un.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?un.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};un.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};un.prototype.forEach=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(e,n,i,0):this.forEachInvertedInner(e,n,i,0)};un.prototype.map=function(e,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(s,o){return r.push(e(s,o))},n,i),r};un.from=function(e){return e instanceof un?e:e&&e.length?new kO(e):un.empty};var kO=(function(t){function e(i){t.call(this),this.values=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,s){return r==0&&s==this.length?this:new e(this.values.slice(r,s))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,s,o,c){for(var f=s;f<o;f++)if(r(this.values[f],c+f)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,o,c){for(var f=s-1;f>=o;f--)if(r(this.values[f],c+f)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=Dh)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=Dh)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(un);un.empty=new kO([]);var JI=(function(t){function e(n,i){t.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},e.prototype.forEachInner=function(i,r,s,o){var c=this.left.length;if(r<c&&this.left.forEachInner(i,r,Math.min(s,c),o)===!1||s>c&&this.right.forEachInner(i,Math.max(r-c,0),Math.min(this.length,s)-c,o+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,s,o){var c=this.left.length;if(r>c&&this.right.forEachInvertedInner(i,r-c,Math.max(s,c)-c,o+c)===!1||s<c&&this.left.forEachInvertedInner(i,Math.min(r,c),s,o)===!1)return!1},e.prototype.sliceInner=function(i,r){if(i==0&&r==this.length)return this;var s=this.left.length;return r<=s?this.left.slice(i,r):i>=s?this.right.slice(i-s,r-s):this.left.slice(i,s).append(this.right.slice(0,r-s))},e.prototype.leafAppend=function(i){var r=this.right.leafAppend(i);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(i){var r=this.left.leafPrepend(i);if(r)return new e(r,this.right)},e.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new e(this.left,new e(this.right,i)):new e(this,i)},e})(un);const XI=500;class Xi{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let r,s;n&&(r=this.remapping(i,this.items.length),s=r.maps.length);let o=e.tr,c,f,d=[],p=[];return this.items.forEach((m,y)=>{if(!m.step){r||(r=this.remapping(i,y+1),s=r.maps.length),s--,p.push(m);return}if(r){p.push(new zs(m.map));let b=m.step.map(r.slice(s)),S;b&&o.maybeStep(b).doc&&(S=o.mapping.maps[o.mapping.maps.length-1],d.push(new zs(S,void 0,void 0,d.length+p.length))),s--,S&&r.appendMap(S,s)}else o.maybeStep(m.step);if(m.selection)return c=r?m.selection.map(r.slice(s)):m.selection,f=new Xi(this.items.slice(0,i).append(p.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:f,transform:o,selection:c}}addTransform(e,n,i,r){let s=[],o=this.eventCount,c=this.items,f=!r&&c.length?c.get(c.length-1):null;for(let p=0;p<e.steps.length;p++){let m=e.steps[p].invert(e.docs[p]),y=new zs(e.mapping.maps[p],m,n),b;(b=f&&f.merge(y))&&(y=b,p?s.pop():c=c.slice(0,c.length-1)),s.push(y),n&&(o++,n=void 0),r||(f=y)}let d=o-i.depth;return d>QI&&(c=WI(c,d),o-=d),new Xi(c.append(s),o)}remapping(e,n){let i=new wu;return this.items.forEach((r,s)=>{let o=r.mirrorOffset!=null&&s-r.mirrorOffset>=e?i.maps.length-r.mirrorOffset:void 0;i.appendMap(r.map,o)},e,n),i}addMaps(e){return this.eventCount==0?this:new Xi(this.items.append(e.map(n=>new zs(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,c=this.eventCount;this.items.forEach(y=>{y.selection&&c--},r);let f=n;this.items.forEach(y=>{let b=s.getMirror(--f);if(b==null)return;o=Math.min(o,b);let S=s.maps[b];if(y.step){let v=e.steps[b].invert(e.docs[b]),k=y.selection&&y.selection.map(s.slice(f+1,b));k&&c++,i.push(new zs(S,v,k))}else i.push(new zs(S))},r);let d=[];for(let y=n;y<o;y++)d.push(new zs(s.maps[y]));let p=this.items.slice(0,r).append(d).append(i),m=new Xi(p,c);return m.emptyItemCount()>XI&&(m=m.compress(this.items.length-i.length)),m}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),i=n.maps.length,r=[],s=0;return this.items.forEach((o,c)=>{if(c>=e)r.push(o),o.selection&&s++;else if(o.step){let f=o.step.map(n.slice(i)),d=f&&f.getMap();if(i--,d&&n.appendMap(d,i),f){let p=o.selection&&o.selection.map(n.slice(i));p&&s++;let m=new zs(d.invert(),f,p),y,b=r.length-1;(y=r.length&&r[b].merge(m))?r[b]=y:r.push(m)}}else o.map&&i--},this.items.length,0),new Xi(un.from(r.reverse()),s)}}Xi.empty=new Xi(un.empty,0);function WI(t,e){let n;return t.forEach((i,r)=>{if(i.selection&&e--==0)return n=r,!1}),t.slice(n)}let zs=class CO{constructor(e,n,i,r){this.map=e,this.step=n,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new CO(n.getMap().invert(),n,this.selection)}}};class Us{constructor(e,n,i,r,s){this.done=e,this.undone=n,this.prevRanges=i,this.prevTime=r,this.prevComposition=s}}const QI=20;function eB(t,e,n,i){let r=n.getMeta(Fl),s;if(r)return r.historyState;n.getMeta(iB)&&(t=new Us(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Fl))return o.getMeta(Fl).redo?new Us(t.done.addTransform(n,void 0,i,sh(e)),t.undone,fE(n.mapping.maps),t.prevTime,t.prevComposition):new Us(t.done,t.undone.addTransform(n,void 0,i,sh(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let c=n.getMeta("composition"),f=t.prevTime==0||!o&&t.prevComposition!=c&&(t.prevTime<(n.time||0)-i.newGroupDelay||!tB(n,t.prevRanges)),d=o?Qy(t.prevRanges,n.mapping):fE(n.mapping.maps);return new Us(t.done.addTransform(n,f?e.selection.getBookmark():void 0,i,sh(e)),Xi.empty,d,n.time,c??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Us(t.done.rebased(n,s),t.undone.rebased(n,s),Qy(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Us(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Qy(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function tB(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((i,r)=>{for(let s=0;s<e.length;s+=2)i<=e[s+1]&&r>=e[s]&&(n=!0)}),n}function fE(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((i,r,s,o)=>e.push(s,o));return e}function Qy(t,e){if(!t)return null;let n=[];for(let i=0;i<t.length;i+=2){let r=e.map(t[i],1),s=e.map(t[i+1],-1);r<=s&&n.push(r,s)}return n}function nB(t,e,n){let i=sh(e),r=Fl.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,i);if(!s)return null;let o=s.selection.resolve(s.transform.doc),c=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),r,i),f=new Us(n?c:s.remaining,n?s.remaining:c,null,0,-1);return s.transform.setSelection(o).setMeta(Fl,{redo:n,historyState:f})}let e0=!1,dE=null;function sh(t){let e=t.plugins;if(dE!=e){e0=!1,dE=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){e0=!0;break}}return e0}const Fl=new Dt("history"),iB=new Dt("closeHistory");function rB(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new kt({key:Fl,state:{init(){return new Us(Xi.empty,Xi.empty,null,0,-1)},apply(e,n,i){return eB(n,i,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let i=n.inputType,r=i=="historyUndo"?TO:i=="historyRedo"?AO:null;return!r||!e.editable?!1:(n.preventDefault(),r(e.state,e.dispatch))}}}})}function EO(t,e){return(n,i)=>{let r=Fl.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(i){let s=nB(r,n,t);s&&i(e?s.scrollIntoView():s)}return!0}}const TO=EO(!1,!0),AO=EO(!0,!0),sB=Xt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>TO(t,e),redo:()=>({state:t,dispatch:e})=>AO(t,e)}},addProseMirrorPlugins(){return[rB(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),lB=hn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Ut(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!X6(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$from:i,$to:r}=n,s=t();return i.parentOffset===0?s.insertContentAt({from:Math.max(i.pos-1,0),to:r.pos},{type:this.name}):b6(n)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:o,dispatch:c})=>{var f;if(c){const{$to:d}=o.selection,p=d.end();if(d.nodeAfter)d.nodeAfter.isTextblock?o.setSelection(Ae.create(o.doc,d.pos+1)):d.nodeAfter.isBlock?o.setSelection(Ee.create(o.doc,d.pos)):o.setSelection(Ae.create(o.doc,d.pos));else{const m=(f=d.parent.type.contentMatch.defaultType)===null||f===void 0?void 0:f.create();m&&(o.insert(p,m),o.setSelection(Ae.create(o.doc,p+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[J6({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),oB=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,aB=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,cB=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,uB=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,fB=wr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Ut(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Wl({find:oB,type:this.type}),Wl({find:cB,type:this.type})]},addPasteRules(){return[nl({find:aB,type:this.type}),nl({find:uB,type:this.type})]}}),dB=hn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ut(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),hB="listItem",hE="textStyle",pE=/^(\d+)\.\s$/,pB=hn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Ut(this.options.HTMLAttributes,n),0]:["ol",Ut(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(hB,this.editor.getAttributes(hE)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Mu({find:pE,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mu({find:pE,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(hE)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),mB=hn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Ut(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),gB=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,yB=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,bB=wr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Ut(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Wl({find:gB,type:this.type})]},addPasteRules(){return[nl({find:yB,type:this.type})]}}),xB=hn.create({name:"text",group:"inline"}),SB=Xt.create({name:"starterKit",addExtensions(){const t=[];return this.options.bold!==!1&&t.push(AI.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(vI.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(OI.configure(this.options.bulletList)),this.options.code!==!1&&t.push(NI.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(LI.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(II.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(UI.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(KI.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(GI.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(ZI.configure(this.options.heading)),this.options.history!==!1&&t.push(sB.configure(this.options.history)),this.options.horizontalRule!==!1&&t.push(lB.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(fB.configure(this.options.italic)),this.options.listItem!==!1&&t.push(dB.configure(this.options.listItem)),this.options.orderedList!==!1&&t.push(pB.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(mB.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(bB.configure(this.options.strike)),this.options.text!==!1&&t.push(xB.configure(this.options.text)),t}}),Vi=()=>new Map,fb=t=>{const e=Vi();return t.forEach((n,i)=>{e.set(i,n)}),e},Er=(t,e,n)=>{let i=t.get(e);return i===void 0&&t.set(e,i=n()),i},wB=(t,e)=>{const n=[];for(const[i,r]of t)n.push(e(r,i));return n},vB=(t,e)=>{for(const[n,i]of t)if(e(i,n))return!0;return!1},Ql=()=>new Set,t0=t=>t[t.length-1],kB=(t,e)=>{for(let n=0;n<e.length;n++)t.push(e[n])},il=Array.from,H1=(t,e)=>{for(let n=0;n<t.length;n++)if(!e(t[n],n,t))return!1;return!0},V1=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},CB=(t,e)=>{const n=new Array(t);for(let i=0;i<t;i++)n[i]=e(i,n);return n},Ca=Array.isArray;class MO{constructor(){this._observers=Vi()}on(e,n){return Er(this._observers,e,Ql).add(n),n}once(e,n){const i=(...r)=>{this.off(e,i),n(...r)};this.on(e,i)}off(e,n){const i=this._observers.get(e);i!==void 0&&(i.delete(n),i.size===0&&this._observers.delete(e))}emit(e,n){return il((this._observers.get(e)||Vi()).values()).forEach(i=>i(...n))}destroy(){this._observers=Vi()}}const Qi=Math.floor,lh=Math.abs,ns=(t,e)=>t<e?t:e,er=(t,e)=>t>e?t:e,OO=t=>t!==0?t<0:1/t<0,mE=1,gE=2,n0=4,i0=8,Ou=32,is=64,Un=128,EB=1<<29,Zp=31,db=63,ql=127,TB=2147483647,Nh=Number.MAX_SAFE_INTEGER,yE=Number.MIN_SAFE_INTEGER,AB=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&Qi(t)===t),_O=String.fromCharCode,MB=t=>t.toLowerCase(),OB=/^\s*/g,_B=t=>t.replace(OB,""),DB=/([A-Z])/g,bE=(t,e)=>_B(t.replace(DB,n=>`${e}${MB(n)}`)),NB=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,i=new Uint8Array(n);for(let r=0;r<n;r++)i[r]=e.codePointAt(r);return i},_u=typeof TextEncoder<"u"?new TextEncoder:null,RB=t=>_u.encode(t),zB=_u?RB:NB;let iu=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});iu&&iu.decode(new Uint8Array).length===1&&(iu=null);const LB=(t,e)=>CB(e,()=>t).join("");let nf=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}};const rf=()=>new nf,IB=t=>{const e=rf();return t(e),Wi(e)},BB=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},Wi=t=>{const e=new Uint8Array(BB(t));let n=0;for(let i=0;i<t.bufs.length;i++){const r=t.bufs[i];e.set(r,n),n+=r.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},jB=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(er(n,e)*2),t.cpos=0)},ln=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},hb=ln,et=(t,e)=>{for(;e>ql;)ln(t,Un|ql&e),e=Qi(e/128);ln(t,ql&e)},P1=(t,e)=>{const n=OO(e);for(n&&(e=-e),ln(t,(e>db?Un:0)|(n?is:0)|db&e),e=Qi(e/64);e>0;)ln(t,(e>ql?Un:0)|ql&e),e=Qi(e/128)},pb=new Uint8Array(3e4),UB=pb.length/3,HB=(t,e)=>{if(e.length<UB){const n=_u.encodeInto(e,pb).written||0;et(t,n);for(let i=0;i<n;i++)ln(t,pb[i])}else gi(t,zB(e))},VB=(t,e)=>{const n=unescape(encodeURIComponent(e)),i=n.length;et(t,i);for(let r=0;r<i;r++)ln(t,n.codePointAt(r))},ua=_u&&_u.encodeInto?HB:VB,Jp=(t,e)=>{const n=t.cbuf.length,i=t.cpos,r=ns(n-i,e.length),s=e.length-r;t.cbuf.set(e.subarray(0,r),i),t.cpos+=r,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(er(n*2,s)),t.cbuf.set(e.subarray(r)),t.cpos=s)},gi=(t,e)=>{et(t,e.byteLength),Jp(t,e)},$1=(t,e)=>{jB(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},PB=(t,e)=>$1(t,4).setFloat32(0,e,!1),$B=(t,e)=>$1(t,8).setFloat64(0,e,!1),FB=(t,e)=>$1(t,8).setBigInt64(0,e,!1),xE=new DataView(new ArrayBuffer(4)),qB=t=>(xE.setFloat32(0,t),xE.getFloat32(0)===t),Ea=(t,e)=>{switch(typeof e){case"string":ln(t,119),ua(t,e);break;case"number":AB(e)&&lh(e)<=TB?(ln(t,125),P1(t,e)):qB(e)?(ln(t,124),PB(t,e)):(ln(t,123),$B(t,e));break;case"bigint":ln(t,122),FB(t,e);break;case"object":if(e===null)ln(t,126);else if(Ca(e)){ln(t,117),et(t,e.length);for(let n=0;n<e.length;n++)Ea(t,e[n])}else if(e instanceof Uint8Array)ln(t,116),gi(t,e);else{ln(t,118);const n=Object.keys(e);et(t,n.length);for(let i=0;i<n.length;i++){const r=n[i];ua(t,r),Ea(t,e[r])}}break;case"boolean":ln(t,e?120:121);break;default:ln(t,127)}};class SE extends nf{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&et(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const wE=t=>{t.count>0&&(P1(t.encoder,t.count===1?t.s:-t.s),t.count>1&&et(t.encoder,t.count-2))};class oh{constructor(){this.encoder=new nf,this.s=0,this.count=0}write(e){this.s===e?this.count++:(wE(this),this.count=1,this.s=e)}toUint8Array(){return wE(this),Wi(this.encoder)}}const vE=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);P1(t.encoder,e),t.count>1&&et(t.encoder,t.count-2)}};class r0{constructor(){this.encoder=new nf,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(vE(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return vE(this),Wi(this.encoder)}}class YB{constructor(){this.sarr=[],this.s="",this.lensE=new oh}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new nf;return this.sarr.push(this.s),this.s="",ua(e,this.sarr.join("")),Jp(e,this.lensE.toUint8Array()),Wi(e)}}const vr=t=>new Error(t),Pi=()=>{throw vr("Method unimplemented")},Dn=()=>{throw vr("Unexpected case")},DO=vr("Unexpected end of array"),NO=vr("Integer out of Range");let Xp=class{constructor(e){this.arr=e,this.pos=0}};const ja=t=>new Xp(t),KB=t=>t.pos!==t.arr.length,GB=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},yi=t=>GB(t,Ye(t)),Ta=t=>t.arr[t.pos++],Ye=t=>{let e=0,n=1;const i=t.arr.length;for(;t.pos<i;){const r=t.arr[t.pos++];if(e=e+(r&ql)*n,n*=128,r<Un)return e;if(e>Nh)throw NO}throw DO},F1=t=>{let e=t.arr[t.pos++],n=e&db,i=64;const r=(e&is)>0?-1:1;if((e&Un)===0)return r*n;const s=t.arr.length;for(;t.pos<s;){if(e=t.arr[t.pos++],n=n+(e&ql)*i,i*=128,e<Un)return r*n;if(n>Nh)throw NO}throw DO},ZB=t=>{let e=Ye(t);if(e===0)return"";{let n=String.fromCodePoint(Ta(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(Ta(t));else for(;e>0;){const i=e<1e4?e:1e4,r=t.arr.subarray(t.pos,t.pos+i);t.pos+=i,n+=String.fromCodePoint.apply(null,r),e-=i}return decodeURIComponent(escape(n))}},JB=t=>iu.decode(yi(t)),fa=iu?JB:ZB,q1=(t,e)=>{const n=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);return t.pos+=e,n},XB=t=>q1(t,4).getFloat32(0,!1),WB=t=>q1(t,8).getFloat64(0,!1),QB=t=>q1(t,8).getBigInt64(0,!1),ej=[t=>{},t=>null,F1,XB,WB,QB,t=>!1,t=>!0,fa,t=>{const e=Ye(t),n={};for(let i=0;i<e;i++){const r=fa(t);n[r]=Du(t)}return n},t=>{const e=Ye(t),n=[];for(let i=0;i<e;i++)n.push(Du(t));return n},yi],Du=t=>ej[127-Ta(t)](t);class kE extends Xp{constructor(e,n){super(e),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),KB(this)?this.count=Ye(this)+1:this.count=-1),this.count--,this.s}}class ah extends Xp{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=F1(this);const e=OO(this.s);this.count=1,e&&(this.s=-this.s,this.count=Ye(this)+2)}return this.count--,this.s}}class s0 extends Xp{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const e=F1(this),n=e&1;this.diff=Qi(e/2),this.count=1,n&&(this.count=Ye(this)+2)}return this.s+=this.diff,this.count--,this.s}}class tj{constructor(e){this.decoder=new ah(e),this.str=fa(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),n=this.str.slice(this.spos,e);return this.spos=e,n}}const nj=crypto.getRandomValues.bind(crypto),ij=Math.random,RO=()=>nj(new Uint32Array(1))[0],rj=t=>t[Qi(ij()*t.length)],sj="10000000-1000-4000-8000"+-1e11,lj=()=>sj.replace(/[018]/g,t=>(t^RO()&15>>t/4).toString(16)),oj=Date.now,CE=t=>new Promise(t);Promise.all.bind(Promise);const EE=t=>t===void 0?null:t;class aj{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let zO=new aj,cj=!0;try{typeof localStorage<"u"&&localStorage&&(zO=localStorage,cj=!1)}catch{}const uj=zO,Nu=Symbol("Equality"),LO=(t,e)=>{var n;return t===e||!!((n=t==null?void 0:t[Nu])!=null&&n.call(t,e))||!1},fj=t=>typeof t=="object",dj=Object.assign,IO=Object.keys,hj=(t,e)=>{for(const n in t)e(t[n],n)},Rh=t=>IO(t).length,pj=t=>{for(const e in t)return!1;return!0},Ua=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},Y1=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),mj=(t,e)=>t===e||Rh(t)===Rh(e)&&Ua(t,(n,i)=>(n!==void 0||Y1(e,i))&&LO(e[i],n)),gj=Object.freeze,BO=t=>{for(const e in t){const n=t[e];(typeof n=="object"||typeof n=="function")&&BO(t[e])}return gj(t)},K1=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&K1(t,e,n+1)}},yj=t=>t,ch=(t,e)=>{if(t===e)return!0;if(t==null||e==null||t.constructor!==e.constructor&&(t.constructor||Object)!==(e.constructor||Object))return!1;if(t[Nu]!=null)return t[Nu](e);switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;break}case Set:{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;break}case Map:{if(t.size!==e.size)return!1;for(const n of t.keys())if(!e.has(n)||!ch(t.get(n),e.get(n)))return!1;break}case void 0:case Object:if(Rh(t)!==Rh(e))return!1;for(const n in t)if(!Y1(t,n)||!ch(t[n],e[n]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!ch(t[n],e[n]))return!1;break;default:return!1}return!0},bj=(t,e)=>e.includes(t);var jO={};const Aa=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",UO=typeof window<"u"&&typeof document<"u"&&!Aa;let ur;const xj=()=>{if(ur===void 0)if(Aa){ur=Vi();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const i=t[n];i[0]==="-"?(e!==null&&ur.set(e,""),e=i):e!==null&&(ur.set(e,i),e=null)}e!==null&&ur.set(e,"")}else typeof location=="object"?(ur=Vi(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");ur.set(`--${bE(e,"-")}`,n),ur.set(`-${bE(e,"-")}`,n)}})):ur=Vi();return ur},mb=t=>xj().has(t),zh=t=>EE(Aa?jO[t.toUpperCase().replaceAll("-","_")]:uj.getItem(t)),HO=t=>mb("--"+t)||zh(t)!==null,Sj=HO("production"),wj=Aa&&bj(jO.FORCE_COLOR,["true","1","2"]),vj=wj||!mb("--no-colors")&&!HO("no-color")&&(!Aa||process.stdout.isTTY)&&(!Aa||mb("--color")||zh("COLORTERM")!==null||(zh("TERM")||"").includes("color")),kj=t=>new Uint8Array(t),Cj=t=>{let e="";for(let n=0;n<t.byteLength;n++)e+=_O(t[n]);return btoa(e)},Ej=t=>Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("base64"),Tj=UO?Cj:Ej,Aj=t=>{const e=kj(t.byteLength);return e.set(t),e},Mj=t=>IB(e=>Ea(e,t));class Oj{constructor(e,n){this.left=e,this.right=n}}const Kr=(t,e)=>new Oj(t,e),TE=t=>t.next()>=.5,l0=(t,e,n)=>Qi(t.next()*(n+1-e)+e),VO=(t,e,n)=>Qi(t.next()*(n+1-e)+e),G1=(t,e,n)=>VO(t,e,n),_j=t=>_O(G1(t,97,122)),Dj=(t,e=0,n=20)=>{const i=G1(t,e,n);let r="";for(let s=0;s<i;s++)r+=_j(t);return r},o0=(t,e)=>e[G1(t,0,e.length-1)],Nj=Symbol("0schema");class Rj{constructor(){this._rerrs=[]}extend(e,n,i,r=null){this._rerrs.push({path:e,expected:n,has:i,message:r})}toString(){const e=[];for(let n=this._rerrs.length-1;n>0;n--){const i=this._rerrs[n];e.push(LB(" ",(this._rerrs.length-n)*2)+`${i.path!=null?`[${i.path}] `:""}${i.has} doesn't match ${i.expected}. ${i.message}`)}return e.join(`
|
|
158
158
|
`)}}const gb=(t,e)=>t===e?!0:t==null||e==null||t.constructor!==e.constructor?!1:t[Nu]?LO(t,e):Ca(t)?H1(t,n=>V1(e,i=>gb(n,i))):fj(t)?Ua(t,(n,i)=>gb(n,e[i])):!1;var H0;let $n=(H0=class{extends(e){let[n,i]=[this.shape,e.shape];return this.constructor._dilutes&&([i,n]=[n,i]),gb(n,i)}equals(e){return this.constructor===e.constructor&&ch(this.shape,e.shape)}[Nj](){return!0}[Nu](e){return this.equals(e)}validate(e){return this.check(e)}check(e,n){Pi()}get nullable(){return Ha(this,nm)}get optional(){return new FO(this)}cast(e){return AE(e,this),e}expect(e){return AE(e,this),e}},Md(H0,"_dilutes",!1),H0);class Z1 extends $n{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n=void 0){const i=(e==null?void 0:e.constructor)===this.shape&&(this._c==null||this._c(e));return!i&&(n==null||n.extend(null,this.shape.name,e==null?void 0:e.constructor.name,(e==null?void 0:e.constructor)!==this.shape?"Constructor match failed":"Check failed")),i}}const Qt=(t,e=null)=>new Z1(t,e);Qt(Z1);class J1 extends $n{constructor(e){super(),this.shape=e}check(e,n){const i=this.shape(e);return!i&&(n==null||n.extend(null,"custom prop",e==null?void 0:e.constructor.name,"failed to check custom prop")),i}}const pn=t=>new J1(t);Qt(J1);class Wp extends $n{constructor(e){super(),this.shape=e}check(e,n){const i=this.shape.some(r=>r===e);return!i&&(n==null||n.extend(null,this.shape.join(" | "),e.toString())),i}}const Qp=(...t)=>new Wp(t),PO=Qt(Wp),zj=RegExp.escape||(t=>t.replace(/[().|&,$^[\]]/g,e=>"\\"+e)),$O=t=>{if(Ma.check(t))return[zj(t)];if(PO.check(t))return t.shape.map(e=>e+"");if(QO.check(t))return["[+-]?\\d+.?\\d*"];if(e_.check(t))return[".*"];if(Ih.check(t))return t.shape.map($O).flat(1);Dn()};class Lj extends $n{constructor(e){super(),this.shape=e,this._r=new RegExp("^"+e.map($O).map(n=>`(${n.join("|")})`).join("")+"$")}check(e,n){const i=this._r.exec(e)!=null;return!i&&(n==null||n.extend(null,this._r.toString(),e.toString(),"String doesn't match string template.")),i}}Qt(Lj);const Ij=Symbol("optional");class FO extends $n{constructor(e){super(),this.shape=e}check(e,n){const i=e===void 0||this.shape.check(e);return!i&&(n==null||n.extend(null,"undefined (optional)","()")),i}get[Ij](){return!0}}const Bj=Qt(FO);class jj extends $n{check(e,n){return n==null||n.extend(null,"never",typeof e),!1}}Qt(jj);const Rp=class Rp extends $n{constructor(e,n=!1){super(),this.shape=e,this._isPartial=n}get partial(){return new Rp(this.shape,!0)}check(e,n){return e==null?(n==null||n.extend(null,"object","null"),!1):Ua(this.shape,(i,r)=>{const s=this._isPartial&&!Y1(e,r)||i.check(e[r],n);return!s&&(n==null||n.extend(r.toString(),i.toString(),typeof e[r],"Object property does not match")),s})}};Md(Rp,"_dilutes",!0);let Lh=Rp;const Uj=t=>new Lh(t),Hj=Qt(Lh),Vj=pn(t=>t!=null&&(t.constructor===Object||t.constructor==null));class qO extends $n{constructor(e,n){super(),this.shape={keys:e,values:n}}check(e,n){return e!=null&&Ua(e,(i,r)=>{const s=this.shape.keys.check(r,n);return!s&&(n==null||n.extend(r+"","Record",typeof e,s?"Key doesn't match schema":"Value doesn't match value")),s&&this.shape.values.check(i,n)})}}const YO=(t,e)=>new qO(t,e),Pj=Qt(qO);class KO extends $n{constructor(e){super(),this.shape=e}check(e,n){return e!=null&&Ua(this.shape,(i,r)=>{const s=i.check(e[r],n);return!s&&(n==null||n.extend(r.toString(),"Tuple",typeof i)),s})}}const $j=(...t)=>new KO(t);Qt(KO);class GO extends $n{constructor(e){super(),this.shape=e.length===1?e[0]:new em(e)}check(e,n){const i=Ca(e)&&H1(e,r=>this.shape.check(r));return!i&&(n==null||n.extend(null,"Array","")),i}}const ZO=(...t)=>new GO(t),Fj=Qt(GO),qj=pn(t=>Ca(t));class JO extends $n{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n){const i=e instanceof this.shape&&(this._c==null||this._c(e));return!i&&(n==null||n.extend(null,this.shape.name,e==null?void 0:e.constructor.name)),i}}const Yj=(t,e=null)=>new JO(t,e);Qt(JO);const Kj=Yj($n);class Gj extends $n{constructor(e){super(),this.len=e.length-1,this.args=$j(...e.slice(-1)),this.res=e[this.len]}check(e,n){const i=e.constructor===Function&&e.length<=this.len;return!i&&(n==null||n.extend(null,"function",typeof e)),i}}const Zj=Qt(Gj),Jj=pn(t=>typeof t=="function");class Xj extends $n{constructor(e){super(),this.shape=e}check(e,n){const i=H1(this.shape,r=>r.check(e,n));return!i&&(n==null||n.extend(null,"Intersectinon",typeof e)),i}}Qt(Xj,t=>t.shape.length>0);class em extends $n{constructor(e){super(),this.shape=e}check(e,n){const i=V1(this.shape,r=>r.check(e,n));return n==null||n.extend(null,"Union",typeof e),i}}Md(em,"_dilutes",!0);const Ha=(...t)=>t.findIndex(e=>Ih.check(e))>=0?Ha(...t.map(e=>Ru(e)).map(e=>Ih.check(e)?e.shape:[e]).flat(1)):t.length===1?t[0]:new em(t),Ih=Qt(em),XO=()=>!0,Bh=pn(XO),Wj=Qt(J1,t=>t.shape===XO),X1=pn(t=>typeof t=="bigint"),Qj=pn(t=>t===X1),WO=pn(t=>typeof t=="symbol");pn(t=>t===WO);const da=pn(t=>typeof t=="number"),QO=pn(t=>t===da),Ma=pn(t=>typeof t=="string"),e_=pn(t=>t===Ma),tm=pn(t=>typeof t=="boolean"),e5=pn(t=>t===tm),t_=Qp(void 0);Qt(Wp,t=>t.shape.length===1&&t.shape[0]===void 0);Qp(void 0);const nm=Qp(null),t5=Qt(Wp,t=>t.shape.length===1&&t.shape[0]===null);Qt(Uint8Array);Qt(Z1,t=>t.shape===Uint8Array);const n5=Ha(da,Ma,nm,t_,X1,tm,WO);(()=>{const t=ZO(Bh),e=YO(Ma,Bh),n=Ha(da,Ma,nm,tm,t,e);return t.shape=n,e.shape.values=n,n})();const Ru=t=>{if(Kj.check(t))return t;if(Vj.check(t)){const e={};for(const n in t)e[n]=Ru(t[n]);return Uj(e)}else{if(qj.check(t))return Ha(...t.map(Ru));if(n5.check(t))return Qp(t);if(Jj.check(t))return Qt(t)}Dn()},AE=Sj?()=>{}:(t,e)=>{const n=new Rj;if(!e.check(t,n))throw vr(`Expected value to be of type ${e.constructor.name}.
|
|
159
|
-
${n.toString()}`)};class i5{constructor(e){this.patterns=[],this.$state=e}if(e,n){return this.patterns.push({if:Ru(e),h:n}),this}else(e){return this.if(Bh,e)}done(){return(e,n)=>{for(let i=0;i<this.patterns.length;i++){const r=this.patterns[i];if(r.if.check(e))return r.h(e,n)}throw vr("Unhandled pattern")}}}const r5=t=>new i5(t),n_=r5(Bh).if(QO,(t,e)=>l0(e,yE,Nh)).if(e_,(t,e)=>Dj(e)).if(e5,(t,e)=>TE(e)).if(Qj,(t,e)=>BigInt(l0(e,yE,Nh))).if(Ih,(t,e)=>Xo(e,o0(e,t.shape))).if(Hj,(t,e)=>{const n={};for(const i in t.shape){let r=t.shape[i];if(Bj.check(r)){if(TE(e))continue;r=r.shape}n[i]=n_(r,e)}return n}).if(Fj,(t,e)=>{const n=[],i=VO(e,0,42);for(let r=0;r<i;r++)n.push(Xo(e,t.shape));return n}).if(PO,(t,e)=>o0(e,t.shape)).if(t5,(t,e)=>null).if(Zj,(t,e)=>{const n=Xo(e,t.res);return()=>n}).if(Wj,(t,e)=>Xo(e,o0(e,[da,Ma,nm,t_,X1,tm,ZO(da),YO(Ha("a","b","c"),da)]))).if(Pj,(t,e)=>{const n={},i=l0(e,0,3);for(let r=0;r<i;r++){const s=Xo(e,t.shape.keys),o=Xo(e,t.shape.values);n[s]=o}return n}).done(),Xo=(t,e)=>n_(Ru(e),t),sf=typeof document<"u"?document:{};pn(t=>t.nodeType===c5);typeof DOMParser<"u"&&new DOMParser;pn(t=>t.nodeType===l5);pn(t=>t.nodeType===o5);const s5=t=>wB(t,(e,n)=>`${n}:${e};`).join(""),l5=sf.ELEMENT_NODE,o5=sf.TEXT_NODE,a5=sf.DOCUMENT_NODE,c5=sf.DOCUMENT_FRAGMENT_NODE;pn(t=>t.nodeType===a5);const u5=t=>class{constructor(n){this._=n}destroy(){t(this._)}},f5=u5(clearTimeout),W1=(t,e)=>new f5(setTimeout(e,t)),as=Symbol,i_=as(),r_=as(),d5=as(),h5=as(),p5=as(),s_=as(),m5=as(),Q1=as(),g5=as(),y5=t=>{var r;t.length===1&&((r=t[0])==null?void 0:r.constructor)===Function&&(t=t[0]());const e=[],n=[];let i=0;for(;i<t.length;i++){const s=t[i];if(s===void 0)break;if(s.constructor===String||s.constructor===Number)e.push(s);else if(s.constructor===Object)break}for(i>0&&n.push(e.join(""));i<t.length;i++){const s=t[i];s instanceof Symbol||n.push(s)}return n},b5={[i_]:Kr("font-weight","bold"),[r_]:Kr("font-weight","normal"),[d5]:Kr("color","blue"),[p5]:Kr("color","green"),[h5]:Kr("color","grey"),[s_]:Kr("color","red"),[m5]:Kr("color","purple"),[Q1]:Kr("color","orange"),[g5]:Kr("color","black")},x5=t=>{var o;t.length===1&&((o=t[0])==null?void 0:o.constructor)===Function&&(t=t[0]());const e=[],n=[],i=Vi();let r=[],s=0;for(;s<t.length;s++){const c=t[s],f=b5[c];if(f!==void 0)i.set(f.left,f.right);else{if(c===void 0)break;if(c.constructor===String||c.constructor===Number){const d=s5(i);s>0||d.length>0?(e.push("%c"+c),n.push(d)):e.push(c)}else break}}for(s>0&&(r=n,r.unshift(e.join("")));s<t.length;s++){const c=t[s];c instanceof Symbol||r.push(c)}return r},l_=vj?x5:y5,S5=(...t)=>{console.log(...l_(t)),a_.forEach(e=>e.print(t))},o_=(...t)=>{console.warn(...l_(t)),t.unshift(Q1),a_.forEach(e=>e.print(t))},a_=Ql(),c_=t=>({[Symbol.iterator](){return this},next:t}),w5=(t,e)=>c_(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),a0=(t,e)=>c_(()=>{const{done:n,value:i}=t.next();return{done:n,value:n?void 0:e(i)}});class im{constructor(e,n){this.clock=e,this.len=n}}class Va{constructor(){this.clients=new Map}}const rl=(t,e,n)=>e.clients.forEach((i,r)=>{const s=t.doc.store.clients.get(r);if(s!=null){const o=s[s.length-1],c=o.id.clock+o.length;for(let f=0,d=i[f];f<i.length&&d.clock<c;d=i[++f])k_(t,s,d.clock,d.len,n)}}),v5=(t,e)=>{let n=0,i=t.length-1;for(;n<=i;){const r=Qi((n+i)/2),s=t[r],o=s.clock;if(o<=e){if(e<o+s.len)return r;n=r+1}else i=r-1}return null},Pa=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&v5(n,e.clock)!==null},ex=t=>{t.clients.forEach(e=>{e.sort((r,s)=>r.clock-s.clock);let n,i;for(n=1,i=1;n<e.length;n++){const r=e[i-1],s=e[n];r.clock+r.len>=s.clock?e[i-1]=new im(r.clock,er(r.len,s.clock+s.len-r.clock)):(i<n&&(e[i]=s),i++)}e.length=i})},yb=t=>{const e=new Va;for(let n=0;n<t.length;n++)t[n].clients.forEach((i,r)=>{if(!e.clients.has(r)){const s=i.slice();for(let o=n+1;o<t.length;o++)kB(s,t[o].clients.get(r)||[]);e.clients.set(r,s)}});return ex(e),e},zu=(t,e,n,i)=>{Er(t.clients,e,()=>[]).push(new im(n,i))},u_=()=>new Va,f_=t=>{const e=u_();return t.clients.forEach((n,i)=>{const r=[];for(let s=0;s<n.length;s++){const o=n[s];if(o.deleted){const c=o.id.clock;let f=o.length;if(s+1<n.length)for(let d=n[s+1];s+1<n.length&&d.deleted;d=n[++s+1])f+=d.length;r.push(new im(c,f))}}r.length>0&&e.clients.set(i,r)}),e},$a=(t,e)=>{et(t.restEncoder,e.clients.size),il(e.clients.entries()).sort((n,i)=>i[0]-n[0]).forEach(([n,i])=>{t.resetDsCurVal(),et(t.restEncoder,n);const r=i.length;et(t.restEncoder,r);for(let s=0;s<r;s++){const o=i[s];t.writeDsClock(o.clock),t.writeDsLen(o.len)}})},tx=t=>{const e=new Va,n=Ye(t.restDecoder);for(let i=0;i<n;i++){t.resetDsCurVal();const r=Ye(t.restDecoder),s=Ye(t.restDecoder);if(s>0){const o=Er(e.clients,r,()=>[]);for(let c=0;c<s;c++)o.push(new im(t.readDsClock(),t.readDsLen()))}}return e},ME=(t,e,n)=>{const i=new Va,r=Ye(t.restDecoder);for(let s=0;s<r;s++){t.resetDsCurVal();const o=Ye(t.restDecoder),c=Ye(t.restDecoder),f=n.clients.get(o)||[],d=$t(n,o);for(let p=0;p<c;p++){const m=t.readDsClock(),y=m+t.readDsLen();if(m<d){d<y&&zu(i,o,d,y-d);let b=tr(f,m),S=f[b];for(!S.deleted&&S.id.clock<m&&(f.splice(b+1,0,Fh(e,S,m-S.id.clock)),b++);b<f.length&&(S=f[b++],S.id.clock<y);)S.deleted||(y<S.id.clock+S.length&&f.splice(b,0,Fh(e,S,y-S.id.clock)),S.delete(e))}else zu(i,o,m,y-m)}}if(i.clients.size>0){const s=new eo;return et(s.restEncoder,0),$a(s,i),s.toUint8Array()}return null},d_=RO;class kr extends MO{constructor({guid:e=lj(),collectionid:n=null,gc:i=!0,gcFilter:r=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:c=!0}={}){super(),this.gc=i,this.gcFilter=r,this.clientID=d_(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new w_,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=c,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=CE(d=>{this.on("load",()=>{this.isLoaded=!0,d(this)})});const f=()=>CE(d=>{const p=m=>{(m===void 0||m===!0)&&(this.off("sync",p),d())};this.on("sync",p)});this.on("sync",d=>{d===!1&&this.isSynced&&(this.whenSynced=f()),this.isSynced=d===void 0||d===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=f()}load(){const e=this._item;e!==null&&!this.shouldLoad&&wt(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(il(this.subdocs).map(e=>e.guid))}transact(e,n=null){return wt(this,e,n)}get(e,n=fn){const i=Er(this.share,e,()=>{const s=new n;return s._integrate(this,null),s}),r=i.constructor;if(n!==fn&&r!==n)if(r===fn){const s=new n;s._map=i._map,i._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=i._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=i._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return i}getArray(e=""){return this.get(e,ma)}getText(e=""){return this.get(e,sl)}getMap(e=""){return this.get(e,_a)}getXmlElement(e=""){return this.get(e,En)}getXmlFragment(e=""){return this.get(e,to)}toJSON(){const e={};return this.share.forEach((n,i)=>{e[i]=n.toJSON()}),e}destroy(){this.isDestroyed=!0,il(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new kr({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,wt(e.parent.doc,i=>{const r=n.doc;e.deleted||i.subdocsAdded.add(r),i.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class h_{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Ye(this.restDecoder)}readDsLen(){return Ye(this.restDecoder)}}class p_ extends h_{readLeftID(){return Ie(Ye(this.restDecoder),Ye(this.restDecoder))}readRightID(){return Ie(Ye(this.restDecoder),Ye(this.restDecoder))}readClient(){return Ye(this.restDecoder)}readInfo(){return Ta(this.restDecoder)}readString(){return fa(this.restDecoder)}readParentInfo(){return Ye(this.restDecoder)===1}readTypeRef(){return Ye(this.restDecoder)}readLen(){return Ye(this.restDecoder)}readAny(){return Du(this.restDecoder)}readBuf(){return Aj(yi(this.restDecoder))}readJSON(){return JSON.parse(fa(this.restDecoder))}readKey(){return fa(this.restDecoder)}}class k5{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Ye(this.restDecoder),this.dsCurrVal}readDsLen(){const e=Ye(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Oa extends k5{constructor(e){super(e),this.keys=[],Ye(e),this.keyClockDecoder=new s0(yi(e)),this.clientDecoder=new ah(yi(e)),this.leftClockDecoder=new s0(yi(e)),this.rightClockDecoder=new s0(yi(e)),this.infoDecoder=new kE(yi(e),Ta),this.stringDecoder=new tj(yi(e)),this.parentInfoDecoder=new kE(yi(e),Ta),this.typeRefDecoder=new ah(yi(e)),this.lenDecoder=new ah(yi(e))}readLeftID(){return new ha(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new ha(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Du(this.restDecoder)}readBuf(){return yi(this.restDecoder)}readJSON(){return Du(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const n=this.stringDecoder.read();return this.keys.push(n),n}}}class m_{constructor(){this.restEncoder=rf()}toUint8Array(){return Wi(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){et(this.restEncoder,e)}writeDsLen(e){et(this.restEncoder,e)}}class lf extends m_{writeLeftID(e){et(this.restEncoder,e.client),et(this.restEncoder,e.clock)}writeRightID(e){et(this.restEncoder,e.client),et(this.restEncoder,e.clock)}writeClient(e){et(this.restEncoder,e)}writeInfo(e){hb(this.restEncoder,e)}writeString(e){ua(this.restEncoder,e)}writeParentInfo(e){et(this.restEncoder,e?1:0)}writeTypeRef(e){et(this.restEncoder,e)}writeLen(e){et(this.restEncoder,e)}writeAny(e){Ea(this.restEncoder,e)}writeBuf(e){gi(this.restEncoder,e)}writeJSON(e){ua(this.restEncoder,JSON.stringify(e))}writeKey(e){ua(this.restEncoder,e)}}class g_{constructor(){this.restEncoder=rf(),this.dsCurrVal=0}toUint8Array(){return Wi(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,et(this.restEncoder,n)}writeDsLen(e){e===0&&Dn(),et(this.restEncoder,e-1),this.dsCurrVal+=e}}class eo extends g_{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new r0,this.clientEncoder=new oh,this.leftClockEncoder=new r0,this.rightClockEncoder=new r0,this.infoEncoder=new SE(hb),this.stringEncoder=new YB,this.parentInfoEncoder=new SE(hb),this.typeRefEncoder=new oh,this.lenEncoder=new oh}toUint8Array(){const e=rf();return et(e,0),gi(e,this.keyClockEncoder.toUint8Array()),gi(e,this.clientEncoder.toUint8Array()),gi(e,this.leftClockEncoder.toUint8Array()),gi(e,this.rightClockEncoder.toUint8Array()),gi(e,Wi(this.infoEncoder)),gi(e,this.stringEncoder.toUint8Array()),gi(e,Wi(this.parentInfoEncoder)),gi(e,this.typeRefEncoder.toUint8Array()),gi(e,this.lenEncoder.toUint8Array()),Jp(e,Wi(this.restEncoder)),Wi(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Ea(this.restEncoder,e)}writeBuf(e){gi(this.restEncoder,e)}writeJSON(e){Ea(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const C5=(t,e,n,i)=>{i=er(i,e[0].id.clock);const r=tr(e,i);et(t.restEncoder,e.length-r),t.writeClient(n),et(t.restEncoder,i);const s=e[r];s.write(t,i-s.id.clock);for(let o=r+1;o<e.length;o++)e[o].write(t,0)},nx=(t,e,n)=>{const i=new Map;n.forEach((r,s)=>{$t(e,s)>r&&i.set(s,r)}),of(e).forEach((r,s)=>{n.has(s)||i.set(s,0)}),et(t.restEncoder,i.size),il(i.entries()).sort((r,s)=>s[0]-r[0]).forEach(([r,s])=>{C5(t,e.clients.get(r),r,s)})},E5=(t,e)=>{const n=Vi(),i=Ye(t.restDecoder);for(let r=0;r<i;r++){const s=Ye(t.restDecoder),o=new Array(s),c=t.readClient();let f=Ye(t.restDecoder);n.set(c,{i:0,refs:o});for(let d=0;d<s;d++){const p=t.readInfo();switch(Zp&p){case 0:{const m=t.readLen();o[d]=new Bi(Ie(c,f),m),f+=m;break}case 10:{const m=Ye(t.restDecoder);o[d]=new ji(Ie(c,f),m),f+=m;break}default:{const m=(p&(is|Un))===0,y=new ht(Ie(c,f),null,(p&Un)===Un?t.readLeftID():null,null,(p&is)===is?t.readRightID():null,m?t.readParentInfo()?e.get(t.readString()):t.readLeftID():null,m&&(p&Ou)===Ou?t.readString():null,q_(t,p));o[d]=y,f+=y.length}}}}return n},T5=(t,e,n)=>{const i=[];let r=il(n.keys()).sort((b,S)=>b-S);if(r.length===0)return null;const s=()=>{if(r.length===0)return null;let b=n.get(r[r.length-1]);for(;b.refs.length===b.i;)if(r.pop(),r.length>0)b=n.get(r[r.length-1]);else return null;return b};let o=s();if(o===null)return null;const c=new w_,f=new Map,d=(b,S)=>{const v=f.get(b);(v==null||v>S)&&f.set(b,S)};let p=o.refs[o.i++];const m=new Map,y=()=>{for(const b of i){const S=b.id.client,v=n.get(S);v?(v.i--,c.clients.set(S,v.refs.slice(v.i)),n.delete(S),v.i=0,v.refs=[]):c.clients.set(S,[b]),r=r.filter(k=>k!==S)}i.length=0};for(;;){if(p.constructor!==ji){const S=Er(m,p.id.client,()=>$t(e,p.id.client))-p.id.clock;if(S<0)i.push(p),d(p.id.client,p.id.clock-1),y();else{const v=p.getMissing(t,e);if(v!==null){i.push(p);const k=n.get(v)||{refs:[],i:0};if(k.refs.length===k.i)d(v,$t(e,v)),y();else{p=k.refs[k.i++];continue}}else(S===0||S<p.length)&&(p.integrate(t,S),m.set(p.id.client,p.id.clock+p.length))}}if(i.length>0)p=i.pop();else if(o!==null&&o.i<o.refs.length)p=o.refs[o.i++];else{if(o=s(),o===null)break;p=o.refs[o.i++]}}if(c.clients.size>0){const b=new eo;return nx(b,c,new Map),et(b.restEncoder,0),{missing:f,update:b.toUint8Array()}}return null},A5=(t,e)=>nx(t,e.doc.store,e.beforeState),M5=(t,e,n,i=new Oa(t))=>wt(e,r=>{r.local=!1;let s=!1;const o=r.doc,c=o.store,f=E5(i,o),d=T5(r,c,f),p=c.pendingStructs;if(p){for(const[y,b]of p.missing)if(b<$t(c,y)){s=!0;break}if(d){for(const[y,b]of d.missing){const S=p.missing.get(y);(S==null||S>b)&&p.missing.set(y,b)}p.update=Uh([p.update,d.update])}}else c.pendingStructs=d;const m=ME(i,r,c);if(c.pendingDs){const y=new Oa(ja(c.pendingDs));Ye(y.restDecoder);const b=ME(y,r,c);m&&b?c.pendingDs=Uh([m,b]):c.pendingDs=m||b}else c.pendingDs=m;if(s){const y=c.pendingStructs.update;c.pendingStructs=null,jh(r.doc,y)}},n,!1),jh=(t,e,n,i=Oa)=>{const r=ja(e);M5(r,t,n,new i(r))},O5=(t,e,n)=>jh(t,e,n,p_),_5=(t,e,n=new Map)=>{nx(t,e.store,n),$a(t,f_(e.store))},D5=(t,e=new Uint8Array([0]),n=new eo)=>{const i=y_(e);_5(n,t,i);const r=[n.toUint8Array()];if(t.store.pendingDs&&r.push(t.store.pendingDs),t.store.pendingStructs&&r.push(J5(t.store.pendingStructs.update,e)),r.length>1){if(n.constructor===lf)return G5(r.map((s,o)=>o===0?s:W5(s)));if(n.constructor===eo)return Uh(r)}return r[0]},N5=(t,e)=>D5(t,e,new lf),R5=t=>{const e=new Map,n=Ye(t.restDecoder);for(let i=0;i<n;i++){const r=Ye(t.restDecoder),s=Ye(t.restDecoder);e.set(r,s)}return e},y_=t=>R5(new h_(ja(t))),b_=(t,e)=>(et(t.restEncoder,e.size),il(e.entries()).sort((n,i)=>i[0]-n[0]).forEach(([n,i])=>{et(t.restEncoder,n),et(t.restEncoder,i)}),t),z5=(t,e)=>b_(t,of(e.store)),L5=(t,e=new g_)=>(t instanceof Map?b_(e,t):z5(e,t),e.toUint8Array()),I5=t=>L5(t,new m_);class B5{constructor(){this.l=[]}}const OE=()=>new B5,_E=(t,e)=>t.l.push(e),DE=(t,e)=>{const n=t.l,i=n.length;t.l=n.filter(r=>e!==r),i===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},x_=(t,e,n)=>K1(t.l,[e,n]);class ha{constructor(e,n){this.client=e,this.clock=n}}const la=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Ie=(t,e)=>new ha(t,e),Lu=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw Dn()},Iu=(t,e)=>{for(;e!==null;){if(e.parent===t)return!0;e=e.parent._item}return!1};class Bu{constructor(e,n,i,r=0){this.type=e,this.tname=n,this.item=i,this.assoc=r}}const Yl=t=>new Bu(t.type==null?null:Ie(t.type.client,t.type.clock),t.tname??null,t.item==null?null:Ie(t.item.client,t.item.clock),t.assoc==null?0:t.assoc);class j5{constructor(e,n,i=0){this.type=e,this.index=n,this.assoc=i}}const U5=(t,e,n=0)=>new j5(t,e,n),Bd=(t,e,n)=>{let i=null,r=null;return t._item===null?r=Lu(t):i=Ie(t._item.id.client,t._item.id.clock),new Bu(i,r,e,n)},c0=(t,e,n=0)=>{let i=t._start;if(n<0){if(e===0)return Bd(t,null,n);e--}for(;i!==null;){if(!i.deleted&&i.countable){if(i.length>e)return Bd(t,Ie(i.id.client,i.id.clock+e),n);e-=i.length}if(i.right===null&&n<0)return Bd(t,i.lastId,n);i=i.right}return Bd(t,null,n)},H5=(t,e)=>{const n=pa(t,e),i=e.clock-n.id.clock;return{item:n,diff:i}},bb=(t,e,n=!0)=>{const i=e.store,r=t.item,s=t.type,o=t.tname,c=t.assoc;let f=null,d=0;if(r!==null){if($t(i,r.client)<=r.clock)return null;const p=n?vb(i,r):H5(i,r),m=p.item;if(!(m instanceof ht))return null;if(f=m.parent,f._item===null||!f._item.deleted){d=m.deleted||!m.countable?0:p.diff+(c>=0?0:1);let y=m.left;for(;y!==null;)!y.deleted&&y.countable&&(d+=y.length),y=y.left}}else{if(o!==null)f=e.get(o);else if(s!==null){if($t(i,s.client)<=s.clock)return null;const{item:p}=n?vb(i,s):{item:pa(i,s)};if(p instanceof ht&&p.content instanceof ir)f=p.content.type;else return null}else throw Dn();c>=0?d=f._length:d=0}return U5(f,d,t.assoc)},NE=(t,e)=>t===e||t!==null&&e!==null&&t.tname===e.tname&&la(t.item,e.item)&&la(t.type,e.type)&&t.assoc===e.assoc;class ix{constructor(e,n){this.ds=e,this.sv=n}}const S_=(t,e)=>new ix(t,e),u0=t=>S_(f_(t.store),of(t.store)),zl=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!Pa(e.ds,t.id),xb=(t,e)=>{const n=Er(t.meta,xb,Ql),i=t.doc.store;n.has(e)||(e.sv.forEach((r,s)=>{r<$t(i,s)&&ti(t,Ie(s,r))}),rl(t,e.ds,r=>{}),n.add(e))};class w_{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const of=t=>{const e=new Map;return t.clients.forEach((n,i)=>{const r=n[n.length-1];e.set(i,r.id.clock+r.length)}),e},$t=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const i=n[n.length-1];return i.id.clock+i.length},v_=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const i=n[n.length-1];if(i.id.clock+i.length!==e.id.clock)throw Dn()}n.push(e)},tr=(t,e)=>{let n=0,i=t.length-1,r=t[i],s=r.id.clock;if(s===e)return i;let o=Qi(e/(s+r.length-1)*i);for(;n<=i;){if(r=t[o],s=r.id.clock,s<=e){if(e<s+r.length)return o;n=o+1}else i=o-1;o=Qi((n+i)/2)}throw Dn()},V5=(t,e)=>{const n=t.clients.get(e.client);return n[tr(n,e.clock)]},pa=V5,Sb=(t,e,n)=>{const i=tr(e,n),r=e[i];return r.id.clock<n&&r instanceof ht?(e.splice(i+1,0,Fh(t,r,n-r.id.clock)),i+1):i},ti=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[Sb(t,n,e.clock)]},RE=(t,e,n)=>{const i=e.clients.get(n.client),r=tr(i,n.clock),s=i[r];return n.clock!==s.id.clock+s.length-1&&s.constructor!==Bi&&i.splice(r+1,0,Fh(t,s,n.clock-s.id.clock+1)),s},P5=(t,e,n)=>{const i=t.clients.get(e.id.client);i[tr(i,e.id.clock)]=n},k_=(t,e,n,i,r)=>{if(i===0)return;const s=n+i;let o=Sb(t,e,n),c;do c=e[o++],s<c.id.clock+c.length&&Sb(t,e,s),r(c);while(o<e.length&&e[o].id.clock<s)};class $5{constructor(e,n,i){this.doc=e,this.deleteSet=new Va,this.beforeState=of(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=i,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const zE=(t,e)=>e.deleteSet.clients.size===0&&!vB(e.afterState,(n,i)=>e.beforeState.get(i)!==n)?!1:(ex(e.deleteSet),A5(t,e),$a(t,e.deleteSet),!0),LE=(t,e,n)=>{const i=e._item;(i===null||i.id.clock<(t.beforeState.get(i.id.client)||0)&&!i.deleted)&&Er(t.changed,e,Ql).add(n)},uh=(t,e)=>{let n=t[e],i=t[e-1],r=e;for(;r>0;n=i,i=t[--r-1]){if(i.deleted===n.deleted&&i.constructor===n.constructor&&i.mergeWith(n)){n instanceof ht&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,i);continue}break}const s=e-r;return s&&t.splice(e+1-s,s),s},F5=(t,e,n)=>{for(const[i,r]of t.clients.entries()){const s=e.clients.get(i);for(let o=r.length-1;o>=0;o--){const c=r[o],f=c.clock+c.len;for(let d=tr(s,c.clock),p=s[d];d<s.length&&p.id.clock<f;p=s[++d]){const m=s[d];if(c.clock+c.len<=m.id.clock)break;m instanceof ht&&m.deleted&&!m.keep&&n(m)&&m.gc(e,!1)}}}},q5=(t,e)=>{t.clients.forEach((n,i)=>{const r=e.clients.get(i);for(let s=n.length-1;s>=0;s--){const o=n[s],c=ns(r.length-1,1+tr(r,o.clock+o.len-1));for(let f=c,d=r[f];f>0&&d.id.clock>=o.clock;d=r[f])f-=1+uh(r,f)}})},C_=(t,e)=>{if(e<t.length){const n=t[e],i=n.doc,r=i.store,s=n.deleteSet,o=n._mergeStructs;try{ex(s),n.afterState=of(n.doc.store),i.emit("beforeObserverCalls",[n,i]);const c=[];n.changed.forEach((f,d)=>c.push(()=>{(d._item===null||!d._item.deleted)&&d._callObserver(n,f)})),c.push(()=>{n.changedParentTypes.forEach((f,d)=>{d._dEH.l.length>0&&(d._item===null||!d._item.deleted)&&(f=f.filter(p=>p.target._item===null||!p.target._item.deleted),f.forEach(p=>{p.currentTarget=d,p._path=null}),f.sort((p,m)=>p.path.length-m.path.length),c.push(()=>{x_(d._dEH,f,n)}))}),c.push(()=>i.emit("afterTransaction",[n,i])),c.push(()=>{n._needFormattingCleanup&&d8(n)})}),K1(c,[])}finally{i.gc&&F5(s,r,i.gcFilter),q5(s,r),n.afterState.forEach((p,m)=>{const y=n.beforeState.get(m)||0;if(y!==p){const b=r.clients.get(m),S=er(tr(b,y),1);for(let v=b.length-1;v>=S;)v-=1+uh(b,v)}});for(let p=o.length-1;p>=0;p--){const{client:m,clock:y}=o[p].id,b=r.clients.get(m),S=tr(b,y);S+1<b.length&&uh(b,S+1)>1||S>0&&uh(b,S)}if(!n.local&&n.afterState.get(i.clientID)!==n.beforeState.get(i.clientID)&&(S5(Q1,i_,"[yjs] ",r_,s_,"Changed the client-id because another client seems to be using it."),i.clientID=d_()),i.emit("afterTransactionCleanup",[n,i]),i._observers.has("update")){const p=new lf;zE(p,n)&&i.emit("update",[p.toUint8Array(),n.origin,i,n])}if(i._observers.has("updateV2")){const p=new eo;zE(p,n)&&i.emit("updateV2",[p.toUint8Array(),n.origin,i,n])}const{subdocsAdded:c,subdocsLoaded:f,subdocsRemoved:d}=n;(c.size>0||d.size>0||f.size>0)&&(c.forEach(p=>{p.clientID=i.clientID,p.collectionid==null&&(p.collectionid=i.collectionid),i.subdocs.add(p)}),d.forEach(p=>i.subdocs.delete(p)),i.emit("subdocs",[{loaded:f,added:c,removed:d},i,n]),d.forEach(p=>p.destroy())),t.length<=e+1?(i._transactionCleanups=[],i.emit("afterAllTransactions",[i,t])):C_(t,e+1)}}},wt=(t,e,n=null,i=!0)=>{const r=t._transactionCleanups;let s=!1,o=null;t._transaction===null&&(s=!0,t._transaction=new $5(t,n,i),r.push(t._transaction),r.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{o=e(t._transaction)}finally{if(s){const c=t._transaction===r[0];t._transaction=null,c&&C_(r,0)}}return o};class Y5{constructor(e,n){this.insertions=n,this.deletions=e,this.meta=new Map}}const IE=(t,e,n)=>{rl(t,n.deletions,i=>{i instanceof ht&&e.scope.some(r=>r===t.doc||Iu(r,i))&&fx(i,!1)})},BE=(t,e,n)=>{let i=null;const r=t.doc,s=t.scope;wt(r,c=>{for(;e.length>0&&t.currStackItem===null;){const f=r.store,d=e.pop(),p=new Set,m=[];let y=!1;rl(c,d.insertions,b=>{if(b instanceof ht){if(b.redone!==null){let{item:S,diff:v}=vb(f,b.id);v>0&&(S=ti(c,Ie(S.id.client,S.id.clock+v))),b=S}!b.deleted&&s.some(S=>S===c.doc||Iu(S,b))&&m.push(b)}}),rl(c,d.deletions,b=>{b instanceof ht&&s.some(S=>S===c.doc||Iu(S,b))&&!Pa(d.insertions,b.id)&&p.add(b)}),p.forEach(b=>{y=F_(c,b,p,d.insertions,t.ignoreRemoteMapChanges,t)!==null||y});for(let b=m.length-1;b>=0;b--){const S=m[b];t.deleteFilter(S)&&(S.delete(c),y=!0)}t.currStackItem=y?d:null}c.changed.forEach((f,d)=>{f.has(null)&&d._searchMarker&&(d._searchMarker.length=0)}),i=c},t);const o=t.currStackItem;if(o!=null){const c=i.changedParentTypes;t.emit("stack-item-popped",[{stackItem:o,type:n,changedParentTypes:c,origin:t},t]),t.currStackItem=null}return o};class E_ extends MO{constructor(e,{captureTimeout:n=500,captureTransaction:i=f=>!0,deleteFilter:r=()=>!0,trackedOrigins:s=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:c=Ca(e)?e[0].doc:e instanceof kr?e:e.doc}={}){super(),this.scope=[],this.doc=c,this.addToScope(e),this.deleteFilter=r,s.add(this),this.trackedOrigins=s,this.captureTransaction=i,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=n,this.afterTransactionHandler=f=>{if(!this.captureTransaction(f)||!this.scope.some(k=>f.changedParentTypes.has(k)||k===this.doc)||!this.trackedOrigins.has(f.origin)&&(!f.origin||!this.trackedOrigins.has(f.origin.constructor)))return;const d=this.undoing,p=this.redoing,m=d?this.redoStack:this.undoStack;d?this.stopCapturing():p||this.clear(!1,!0);const y=new Va;f.afterState.forEach((k,E)=>{const j=f.beforeState.get(E)||0,L=k-j;L>0&&zu(y,E,j,L)});const b=oj();let S=!1;if(this.lastChange>0&&b-this.lastChange<this.captureTimeout&&m.length>0&&!d&&!p){const k=m[m.length-1];k.deletions=yb([k.deletions,f.deleteSet]),k.insertions=yb([k.insertions,y])}else m.push(new Y5(f.deleteSet,y)),S=!0;!d&&!p&&(this.lastChange=b),rl(f,f.deleteSet,k=>{k instanceof ht&&this.scope.some(E=>E===f.doc||Iu(E,k))&&fx(k,!0)});const v=[{stackItem:m[m.length-1],origin:f.origin,type:d?"redo":"undo",changedParentTypes:f.changedParentTypes},this];S?this.emit("stack-item-added",v):this.emit("stack-item-updated",v)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){const n=new Set(this.scope);e=Ca(e)?e:[e],e.forEach(i=>{n.has(i)||(n.add(i),(i instanceof fn?i.doc!==this.doc:i!==this.doc)&&o_("[yjs#509] Not same Y.Doc"),this.scope.push(i))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,n=!0){(e&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(i=>{e&&(this.undoStack.forEach(r=>IE(i,this,r)),this.undoStack=[]),n&&(this.redoStack.forEach(r=>IE(i,this,r)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=BE(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=BE(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*K5(t){const e=Ye(t.restDecoder);for(let n=0;n<e;n++){const i=Ye(t.restDecoder),r=t.readClient();let s=Ye(t.restDecoder);for(let o=0;o<i;o++){const c=t.readInfo();if(c===10){const f=Ye(t.restDecoder);yield new ji(Ie(r,s),f),s+=f}else if((Zp&c)!==0){const f=(c&(is|Un))===0,d=new ht(Ie(r,s),null,(c&Un)===Un?t.readLeftID():null,null,(c&is)===is?t.readRightID():null,f?t.readParentInfo()?t.readString():t.readLeftID():null,f&&(c&Ou)===Ou?t.readString():null,q_(t,c));yield d,s+=d.length}else{const f=t.readLen();yield new Bi(Ie(r,s),f),s+=f}}}}class rx{constructor(e,n){this.gen=K5(e),this.curr=null,this.done=!1,this.filterSkips=n,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===ji);return this.curr}}class sx{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const G5=t=>Uh(t,p_,lf),Z5=(t,e)=>{if(t.constructor===Bi){const{client:n,clock:i}=t.id;return new Bi(Ie(n,i+e),t.length-e)}else if(t.constructor===ji){const{client:n,clock:i}=t.id;return new ji(Ie(n,i+e),t.length-e)}else{const n=t,{client:i,clock:r}=n.id;return new ht(Ie(i,r+e),null,Ie(i,r+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},Uh=(t,e=Oa,n=eo)=>{if(t.length===1)return t[0];const i=t.map(p=>new e(ja(p)));let r=i.map(p=>new rx(p,!0)),s=null;const o=new n,c=new sx(o);for(;r=r.filter(y=>y.curr!==null),r.sort((y,b)=>{if(y.curr.id.client===b.curr.id.client){const S=y.curr.id.clock-b.curr.id.clock;return S===0?y.curr.constructor===b.curr.constructor?0:y.curr.constructor===ji?1:-1:S}else return b.curr.id.client-y.curr.id.client}),r.length!==0;){const p=r[0],m=p.curr.id.client;if(s!==null){let y=p.curr,b=!1;for(;y!==null&&y.id.clock+y.length<=s.struct.id.clock+s.struct.length&&y.id.client>=s.struct.id.client;)y=p.next(),b=!0;if(y===null||y.id.client!==m||b&&y.id.clock>s.struct.id.clock+s.struct.length)continue;if(m!==s.struct.id.client)$s(c,s.struct,s.offset),s={struct:y,offset:0},p.next();else if(s.struct.id.clock+s.struct.length<y.id.clock)if(s.struct.constructor===ji)s.struct.length=y.id.clock+y.length-s.struct.id.clock;else{$s(c,s.struct,s.offset);const S=y.id.clock-s.struct.id.clock-s.struct.length;s={struct:new ji(Ie(m,s.struct.id.clock+s.struct.length),S),offset:0}}else{const S=s.struct.id.clock+s.struct.length-y.id.clock;S>0&&(s.struct.constructor===ji?s.struct.length-=S:y=Z5(y,S)),s.struct.mergeWith(y)||($s(c,s.struct,s.offset),s={struct:y,offset:0},p.next())}}else s={struct:p.curr,offset:0},p.next();for(let y=p.curr;y!==null&&y.id.client===m&&y.id.clock===s.struct.id.clock+s.struct.length&&y.constructor!==ji;y=p.next())$s(c,s.struct,s.offset),s={struct:y,offset:0}}s!==null&&($s(c,s.struct,s.offset),s=null),lx(c);const f=i.map(p=>tx(p)),d=yb(f);return $a(o,d),o.toUint8Array()},J5=(t,e,n=Oa,i=eo)=>{const r=y_(e),s=new i,o=new sx(s),c=new n(ja(t)),f=new rx(c,!1);for(;f.curr;){const p=f.curr,m=p.id.client,y=r.get(m)||0;if(f.curr.constructor===ji){f.next();continue}if(p.id.clock+p.length>y)for($s(o,p,er(y-p.id.clock,0)),f.next();f.curr&&f.curr.id.client===m;)$s(o,f.curr,0),f.next();else for(;f.curr&&f.curr.id.client===m&&f.curr.id.clock+f.curr.length<=y;)f.next()}lx(o);const d=tx(c);return $a(s,d),s.toUint8Array()},T_=t=>{t.written>0&&(t.clientStructs.push({written:t.written,restEncoder:Wi(t.encoder.restEncoder)}),t.encoder.restEncoder=rf(),t.written=0)},$s=(t,e,n)=>{t.written>0&&t.currClient!==e.id.client&&T_(t),t.written===0&&(t.currClient=e.id.client,t.encoder.writeClient(e.id.client),et(t.encoder.restEncoder,e.id.clock+n)),e.write(t.encoder,n),t.written++},lx=t=>{T_(t);const e=t.encoder.restEncoder;et(e,t.clientStructs.length);for(let n=0;n<t.clientStructs.length;n++){const i=t.clientStructs[n];et(e,i.written),Jp(e,i.restEncoder)}},X5=(t,e,n,i)=>{const r=new n(ja(t)),s=new rx(r,!1),o=new i,c=new sx(o);for(let d=s.curr;d!==null;d=s.next())$s(c,e(d),0);lx(c);const f=tx(r);return $a(o,f),o.toUint8Array()},W5=t=>X5(t,yj,Oa,lf),jE="You must not compute changes after the event-handler fired.";class rm{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=Q5(this.currentTarget,this.target))}deletes(e){return Pa(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw vr(jE);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(r=>{if(r!==null){const s=n._map.get(r);let o,c;if(this.adds(s)){let f=s.left;for(;f!==null&&this.adds(f);)f=f.left;if(this.deletes(s))if(f!==null&&this.deletes(f))o="delete",c=t0(f.content.getContent());else return;else f!==null&&this.deletes(f)?(o="update",c=t0(f.content.getContent())):(o="add",c=void 0)}else if(this.deletes(s))o="delete",c=t0(s.content.getContent());else return;e.set(r,{action:o,oldValue:c})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw vr(jE);const n=this.target,i=Ql(),r=Ql(),s=[];if(e={added:i,deleted:r,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let c=null;const f=()=>{c&&s.push(c)};for(let d=n._start;d!==null;d=d.right)d.deleted?this.deletes(d)&&!this.adds(d)&&((c===null||c.delete===void 0)&&(f(),c={delete:0}),c.delete+=d.length,r.add(d)):this.adds(d)?((c===null||c.insert===void 0)&&(f(),c={insert:[]}),c.insert=c.insert.concat(d.content.getContent()),i.add(d)):((c===null||c.retain===void 0)&&(f(),c={retain:0}),c.retain+=d.length);c!==null&&c.retain===void 0&&f()}this._changes=e}return e}}const Q5=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let i=0,r=e._item.parent._start;for(;r!==e._item&&r!==null;)!r.deleted&&r.countable&&(i+=r.length),r=r.right;n.unshift(i)}e=e._item.parent}return n},Mn=()=>{o_("Invalid access: Add Yjs type to a document before reading data.")},A_=80;let ox=0;class e8{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=ox++}}const t8=t=>{t.timestamp=ox++},M_=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=ox++},n8=(t,e,n)=>{if(t.length>=A_){const i=t.reduce((r,s)=>r.timestamp<s.timestamp?r:s);return M_(i,e,n),i}else{const i=new e8(e,n);return t.push(i),i}},sm=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((s,o)=>lh(e-s.index)<lh(e-o.index)?s:o);let i=t._start,r=0;for(n!==null&&(i=n.p,r=n.index,t8(n));i.right!==null&&r<e;){if(!i.deleted&&i.countable){if(e<r+i.length)break;r+=i.length}i=i.right}for(;i.left!==null&&r>e;)i=i.left,!i.deleted&&i.countable&&(r-=i.length);for(;i.left!==null&&i.left.id.client===i.id.client&&i.left.id.clock+i.left.length===i.id.clock;)i=i.left,!i.deleted&&i.countable&&(r-=i.length);return n!==null&&lh(n.index-r)<i.parent.length/A_?(M_(n,i,r),n):n8(t._searchMarker,i,r)},ju=(t,e,n)=>{for(let i=t.length-1;i>=0;i--){const r=t[i];if(n>0){let s=r.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(r.index-=s.length);if(s===null||s.marker===!0){t.splice(i,1);continue}r.p=s,s.marker=!0}(e<r.index||n>0&&e===r.index)&&(r.index=er(e,r.index+n))}},lm=(t,e,n)=>{const i=t,r=e.changedParentTypes;for(;Er(r,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;x_(i._eH,n,e)};class fn{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=OE(),this._dEH=OE(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw Pi()}clone(){throw Pi()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){_E(this._eH,e)}observeDeep(e){_E(this._dEH,e)}unobserve(e){DE(this._eH,e)}unobserveDeep(e){DE(this._dEH,e)}toJSON(){}}const O_=(t,e,n)=>{t.doc??Mn(),e<0&&(e=t._length+e),n<0&&(n=t._length+n);let i=n-e;const r=[];let s=t._start;for(;s!==null&&i>0;){if(s.countable&&!s.deleted){const o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let c=e;c<o.length&&i>0;c++)r.push(o[c]),i--;e=0}}s=s.right}return r},__=t=>{t.doc??Mn();const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const i=n.content.getContent();for(let r=0;r<i.length;r++)e.push(i[r])}n=n.right}return e},D_=(t,e)=>{const n=[];let i=t._start;for(;i!==null;){if(i.countable&&zl(i,e)){const r=i.content.getContent();for(let s=0;s<r.length;s++)n.push(r[s])}i=i.right}return n},Uu=(t,e)=>{let n=0,i=t._start;for(t.doc??Mn();i!==null;){if(i.countable&&!i.deleted){const r=i.content.getContent();for(let s=0;s<r.length;s++)e(r[s],n++,t)}i=i.right}},N_=(t,e)=>{const n=[];return Uu(t,(i,r)=>{n.push(e(i,r,t))}),n},i8=t=>{let e=t._start,n=null,i=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),i=0,e=e.right}const r=n[i++];return n.length<=i&&(n=null),{done:!1,value:r}}}},R_=(t,e)=>{t.doc??Mn();const n=sm(t,e);let i=t._start;for(n!==null&&(i=n.p,e-=n.index);i!==null;i=i.right)if(!i.deleted&&i.countable){if(e<i.length)return i.content.getContent()[e];e-=i.length}},Hh=(t,e,n,i)=>{let r=n;const s=t.doc,o=s.clientID,c=s.store,f=n===null?e._start:n.right;let d=[];const p=()=>{d.length>0&&(r=new ht(Ie(o,$t(c,o)),r,r&&r.lastId,f,f&&f.id,e,null,new no(d)),r.integrate(t,0),d=[])};i.forEach(m=>{if(m===null)d.push(m);else switch(m.constructor){case Number:case Object:case Boolean:case Array:case String:d.push(m);break;default:switch(p(),m.constructor){case Uint8Array:case ArrayBuffer:r=new ht(Ie(o,$t(c,o)),r,r&&r.lastId,f,f&&f.id,e,null,new af(new Uint8Array(m))),r.integrate(t,0);break;case kr:r=new ht(Ie(o,$t(c,o)),r,r&&r.lastId,f,f&&f.id,e,null,new cf(m)),r.integrate(t,0);break;default:if(m instanceof fn)r=new ht(Ie(o,$t(c,o)),r,r&&r.lastId,f,f&&f.id,e,null,new ir(m)),r.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),p()},z_=()=>vr("Length exceeded!"),L_=(t,e,n,i)=>{if(n>e._length)throw z_();if(n===0)return e._searchMarker&&ju(e._searchMarker,n,i.length),Hh(t,e,null,i);const r=n,s=sm(e,n);let o=e._start;for(s!==null&&(o=s.p,n-=s.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&ti(t,Ie(o.id.client,o.id.clock+n));break}n-=o.length}return e._searchMarker&&ju(e._searchMarker,r,i.length),Hh(t,e,o,i)},r8=(t,e,n)=>{let r=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(r)for(;r.right;)r=r.right;return Hh(t,e,r,n)},I_=(t,e,n,i)=>{if(i===0)return;const r=n,s=i,o=sm(e,n);let c=e._start;for(o!==null&&(c=o.p,n-=o.index);c!==null&&n>0;c=c.right)!c.deleted&&c.countable&&(n<c.length&&ti(t,Ie(c.id.client,c.id.clock+n)),n-=c.length);for(;i>0&&c!==null;)c.deleted||(i<c.length&&ti(t,Ie(c.id.client,c.id.clock+i)),c.delete(t),i-=c.length),c=c.right;if(i>0)throw z_();e._searchMarker&&ju(e._searchMarker,r,-s+i)},Vh=(t,e,n)=>{const i=e._map.get(n);i!==void 0&&i.delete(t)},ax=(t,e,n,i)=>{const r=e._map.get(n)||null,s=t.doc,o=s.clientID;let c;if(i==null)c=new no([i]);else switch(i.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:c=new no([i]);break;case Uint8Array:c=new af(i);break;case kr:c=new cf(i);break;default:if(i instanceof fn)c=new ir(i);else throw new Error("Unexpected content type")}new ht(Ie(o,$t(s.store,o)),r,r&&r.lastId,null,null,e,n,c).integrate(t,0)},cx=(t,e)=>{t.doc??Mn();const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},B_=t=>{const e={};return t.doc??Mn(),t._map.forEach((n,i)=>{n.deleted||(e[i]=n.content.getContent()[n.length-1])}),e},j_=(t,e)=>{t.doc??Mn();const n=t._map.get(e);return n!==void 0&&!n.deleted},s8=(t,e)=>{const n={};return t._map.forEach((i,r)=>{let s=i;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&zl(s,e)&&(n[r]=s.content.getContent()[s.length-1])}),n},jd=t=>(t.doc??Mn(),w5(t._map.entries(),e=>!e[1].deleted));class l8 extends rm{}class ma extends fn{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new ma;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new ma}clone(){const e=new ma;return e.insert(0,this.toArray().map(n=>n instanceof fn?n.clone():n)),e}get length(){return this.doc??Mn(),this._length}_callObserver(e,n){super._callObserver(e,n),lm(this,e,new l8(this,e))}insert(e,n){this.doc!==null?wt(this.doc,i=>{L_(i,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?wt(this.doc,n=>{r8(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?wt(this.doc,i=>{I_(i,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return R_(this,e)}toArray(){return __(this)}slice(e=0,n=this.length){return O_(this,e,n)}toJSON(){return this.map(e=>e instanceof fn?e.toJSON():e)}map(e){return N_(this,e)}forEach(e){Uu(this,e)}[Symbol.iterator](){return i8(this)}_write(e){e.writeTypeRef(D8)}}const o8=t=>new ma;class a8 extends rm{constructor(e,n,i){super(e,n),this.keysChanged=i}}class _a extends fn{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((i,r)=>{this.set(r,i)}),this._prelimContent=null}_copy(){return new _a}clone(){const e=new _a;return this.forEach((n,i)=>{e.set(i,n instanceof fn?n.clone():n)}),e}_callObserver(e,n){lm(this,e,new a8(this,e,n))}toJSON(){this.doc??Mn();const e={};return this._map.forEach((n,i)=>{if(!n.deleted){const r=n.content.getContent()[n.length-1];e[i]=r instanceof fn?r.toJSON():r}}),e}get size(){return[...jd(this)].length}keys(){return a0(jd(this),e=>e[0])}values(){return a0(jd(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return a0(jd(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Mn(),this._map.forEach((n,i)=>{n.deleted||e(n.content.getContent()[n.length-1],i,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?wt(this.doc,n=>{Vh(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?wt(this.doc,i=>{ax(i,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return cx(this,e)}has(e){return j_(this,e)}clear(){this.doc!==null?wt(this.doc,e=>{this.forEach(function(n,i,r){Vh(e,r,i)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(N8)}}const c8=t=>new _a,Zs=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&mj(t,e);class wb{constructor(e,n,i,r){this.left=e,this.right=n,this.index=i,this.currentAttributes=r}forward(){switch(this.right===null&&Dn(),this.right.content.constructor){case Wt:this.right.deleted||Fa(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const UE=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case Wt:e.right.deleted||Fa(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n<e.right.length&&ti(t,Ie(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},Ud=(t,e,n,i)=>{const r=new Map,s=i?sm(e,n):null;if(s){const o=new wb(s.p.left,s.p,s.index,r);return UE(t,o,n-s.index)}else{const o=new wb(null,e._start,0,r);return UE(t,o,n)}},U_=(t,e,n,i)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Wt&&Zs(i.get(n.right.content.key),n.right.content.value));)n.right.deleted||i.delete(n.right.content.key),n.forward();const r=t.doc,s=r.clientID;i.forEach((o,c)=>{const f=n.left,d=n.right,p=new ht(Ie(s,$t(r.store,s)),f,f&&f.lastId,d,d&&d.id,e,null,new Wt(c,o));p.integrate(t,0),n.right=p,n.forward()})},Fa=(t,e)=>{const{key:n,value:i}=e;i===null?t.delete(n):t.set(n,i)},H_=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===Wt&&Zs(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},V_=(t,e,n,i)=>{const r=t.doc,s=r.clientID,o=new Map;for(const c in i){const f=i[c],d=n.currentAttributes.get(c)??null;if(!Zs(d,f)){o.set(c,d);const{left:p,right:m}=n;n.right=new ht(Ie(s,$t(r.store,s)),p,p&&p.lastId,m,m&&m.id,e,null,new Wt(c,f)),n.right.integrate(t,0),n.forward()}}return o},f0=(t,e,n,i,r)=>{n.currentAttributes.forEach((y,b)=>{r[b]===void 0&&(r[b]=null)});const s=t.doc,o=s.clientID;H_(n,r);const c=V_(t,e,n,r),f=i.constructor===String?new nr(i):i instanceof fn?new ir(i):new oo(i);let{left:d,right:p,index:m}=n;e._searchMarker&&ju(e._searchMarker,n.index,f.getLength()),p=new ht(Ie(o,$t(s.store,o)),d,d&&d.lastId,p,p&&p.id,e,null,f),p.integrate(t,0),n.right=p,n.index=m,n.forward(),U_(t,e,n,c)},HE=(t,e,n,i,r)=>{const s=t.doc,o=s.clientID;H_(n,r);const c=V_(t,e,n,r);e:for(;n.right!==null&&(i>0||c.size>0&&(n.right.deleted||n.right.content.constructor===Wt));){if(!n.right.deleted)switch(n.right.content.constructor){case Wt:{const{key:f,value:d}=n.right.content,p=r[f];if(p!==void 0){if(Zs(p,d))c.delete(f);else{if(i===0)break e;c.set(f,d)}n.right.delete(t)}else n.currentAttributes.set(f,d);break}default:i<n.right.length&&ti(t,Ie(n.right.id.client,n.right.id.clock+i)),i-=n.right.length;break}n.forward()}if(i>0){let f="";for(;i>0;i--)f+=`
|
|
160
|
-
`;n.right=new
|
|
161
|
-
`?o.insert.slice(0,-1):o.insert;(typeof c!="string"||c.length>0)&&f0(i,this,r,c,o.attributes||{})}else o.retain!==void 0?HE(i,this,r,o.retain,o.attributes||{}):o.delete!==void 0&&VE(i,r,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,i){this.doc??Mn();const r=[],s=new Map,o=this.doc;let c="",f=this._start;function d(){if(c.length>0){const m={};let y=!1;s.forEach((S,v)=>{y=!0,m[v]=S});const b={insert:c};y&&(b.attributes=m),r.push(b),c=""}}const p=()=>{for(;f!==null;){if(zl(f,e)||n!==void 0&&zl(f,n))switch(f.content.constructor){case nr:{const m=s.get("ychange");e!==void 0&&!zl(f,e)?(m===void 0||m.user!==f.id.client||m.type!=="removed")&&(d(),s.set("ychange",i?i("removed",f.id):{type:"removed"})):n!==void 0&&!zl(f,n)?(m===void 0||m.user!==f.id.client||m.type!=="added")&&(d(),s.set("ychange",i?i("added",f.id):{type:"added"})):m!==void 0&&(d(),s.delete("ychange")),c+=f.content.str;break}case ir:case oo:{d();const m={insert:f.content.getContent()[0]};if(s.size>0){const y={};m.attributes=y,s.forEach((b,S)=>{y[S]=b})}r.push(m);break}case Wt:zl(f,e)&&(d(),Fa(s,f.content));break}f=f.right}d()};return e||n?wt(o,m=>{e&&xb(m,e),n&&xb(m,n),p()},"cleanup"):p(),r}insert(e,n,i){if(n.length<=0)return;const r=this.doc;r!==null?wt(r,s=>{const o=Ud(s,this,e,!i);i||(i={},o.currentAttributes.forEach((c,f)=>{i[f]=c})),f0(s,this,o,n,i)}):this._pending.push(()=>this.insert(e,n,i))}insertEmbed(e,n,i){const r=this.doc;r!==null?wt(r,s=>{const o=Ud(s,this,e,!i);f0(s,this,o,n,i||{})}):this._pending.push(()=>this.insertEmbed(e,n,i||{}))}delete(e,n){if(n===0)return;const i=this.doc;i!==null?wt(i,r=>{VE(r,Ud(r,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,i){if(n===0)return;const r=this.doc;r!==null?wt(r,s=>{const o=Ud(s,this,e,!1);o.right!==null&&HE(s,this,o,n,i)}):this._pending.push(()=>this.format(e,n,i))}removeAttribute(e){this.doc!==null?wt(this.doc,n=>{Vh(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?wt(this.doc,i=>{ax(i,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return cx(this,e)}getAttributes(){return B_(this)}_write(e){e.writeTypeRef(R8)}}const p8=t=>new sl;class d0{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Mn()}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===En||n.constructor===to)&&n._start!==null)e=n._start;else for(;e!==null;){const i=e.next;if(i!==null){e=i;break}else e.parent===this._root?e=null:e=e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class to extends fn{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new to}clone(){const e=new to;return e.insert(0,this.toArray().map(n=>n instanceof fn?n.clone():n)),e}get length(){return this.doc??Mn(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new d0(this,e)}querySelector(e){e=e.toUpperCase();const i=new d0(this,r=>r.nodeName&&r.nodeName.toUpperCase()===e).next();return i.done?null:i.value}querySelectorAll(e){return e=e.toUpperCase(),il(new d0(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){lm(this,e,new y8(this,n,e))}toString(){return N_(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},i){const r=e.createDocumentFragment();return i!==void 0&&i._createAssociation(r,this),Uu(this,s=>{r.insertBefore(s.toDOM(e,n,i),null)}),r}insert(e,n){this.doc!==null?wt(this.doc,i=>{L_(i,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)wt(this.doc,i=>{const r=e&&e instanceof fn?e._item:e;Hh(i,this,r,n)});else{const i=this._prelimContent,r=e===null?0:i.findIndex(s=>s===e)+1;if(r===0&&e!==null)throw vr("Reference item not found");i.splice(r,0,...n)}}delete(e,n=1){this.doc!==null?wt(this.doc,i=>{I_(i,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return __(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return R_(this,e)}slice(e=0,n=this.length){return O_(this,e,n)}forEach(e){Uu(this,e)}_write(e){e.writeTypeRef(L8)}}const m8=t=>new to;class En extends to{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((i,r)=>{this.setAttribute(r,i)}),this._prelimAttrs=null}_copy(){return new En(this.nodeName)}clone(){const e=new En(this.nodeName),n=this.getAttributes();return hj(n,(i,r)=>{e.setAttribute(r,i)}),e.insert(0,this.toArray().map(i=>i instanceof fn?i.clone():i)),e}toString(){const e=this.getAttributes(),n=[],i=[];for(const c in e)i.push(c);i.sort();const r=i.length;for(let c=0;c<r;c++){const f=i[c];n.push(f+'="'+e[f]+'"')}const s=this.nodeName.toLocaleLowerCase(),o=n.length>0?" "+n.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}removeAttribute(e){this.doc!==null?wt(this.doc,n=>{Vh(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?wt(this.doc,i=>{ax(i,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return cx(this,e)}hasAttribute(e){return j_(this,e)}getAttributes(e){return e?s8(this,e):B_(this)}toDOM(e=document,n={},i){const r=e.createElement(this.nodeName),s=this.getAttributes();for(const o in s){const c=s[o];typeof c=="string"&&r.setAttribute(o,c)}return Uu(this,o=>{r.appendChild(o.toDOM(e,n,i))}),i!==void 0&&i._createAssociation(r,this),r}_write(e){e.writeTypeRef(z8),e.writeKey(this.nodeName)}}const g8=t=>new En(t.readKey());class y8 extends rm{constructor(e,n,i){super(e,i),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(r=>{r===null?this.childListChanged=!0:this.attributesChanged.add(r)})}}class Ph extends _a{constructor(e){super(),this.hookName=e}_copy(){return new Ph(this.hookName)}clone(){const e=new Ph(this.hookName);return this.forEach((n,i)=>{e.set(i,n)}),e}toDOM(e=document,n={},i){const r=n[this.hookName];let s;return r!==void 0?s=r.createDom(this):s=document.createElement(this.hookName),s.setAttribute("data-yjs-hook",this.hookName),i!==void 0&&i._createAssociation(s,this),s}_write(e){e.writeTypeRef(I8),e.writeKey(this.hookName)}}const b8=t=>new Ph(t.readKey());class Hn extends sl{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Hn}clone(){const e=new Hn;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,i){const r=e.createTextNode(this.toString());return i!==void 0&&i._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{const n=[];for(const r in e.attributes){const s=[];for(const o in e.attributes[r])s.push({key:o,value:e.attributes[r][o]});s.sort((o,c)=>o.key<c.key?-1:1),n.push({nodeName:r,attrs:s})}n.sort((r,s)=>r.nodeName<s.nodeName?-1:1);let i="";for(let r=0;r<n.length;r++){const s=n[r];i+=`<${s.nodeName}`;for(let o=0;o<s.attrs.length;o++){const c=s.attrs[o];i+=` ${c.key}="${c.value}"`}i+=">"}i+=e.insert;for(let r=n.length-1;r>=0;r--)i+=`</${n[r].nodeName}>`;return i}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(B8)}}const x8=t=>new Hn;class ux{constructor(e,n){this.id=e,this.length=n}get deleted(){throw Pi()}mergeWith(e){return!1}write(e,n,i){throw Pi()}integrate(e,n){throw Pi()}}const S8=0;class Bi extends ux{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),v_(e.doc.store,this)}write(e,n){e.writeInfo(S8),e.writeLen(this.length-n)}getMissing(e,n){return null}}class af{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new af(this.content)}splice(e){throw Pi()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}const w8=t=>new af(t.readBuf());class Hu{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Hu(this.len)}splice(e){const n=new Hu(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){zu(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const v8=t=>new Hu(t.readLen()),$_=(t,e)=>new kr({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class cf{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new cf($_(this.doc.guid,this.opts))}splice(e){throw Pi()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}const k8=t=>new cf($_(t.readString(),t.readAny()));class oo{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new oo(this.embed)}splice(e){throw Pi()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}const C8=t=>new oo(t.readJSON());class Wt{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Wt(this.key,this.value)}splice(e){throw Pi()}mergeWith(e){return!1}integrate(e,n){const i=n.parent;i._searchMarker=null,i._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const E8=t=>new Wt(t.readKey(),t.readJSON());class $h{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new $h(this.arr)}splice(e){const n=new $h(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const i=this.arr.length;e.writeLen(i-n);for(let r=n;r<i;r++){const s=this.arr[r];e.writeString(s===void 0?"undefined":JSON.stringify(s))}}getRef(){return 2}}const T8=t=>{const e=t.readLen(),n=[];for(let i=0;i<e;i++){const r=t.readString();r==="undefined"?n.push(void 0):n.push(JSON.parse(r))}return new $h(n)},A8=zh("node_env")==="development";class no{constructor(e){this.arr=e,A8&&BO(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new no(this.arr)}splice(e){const n=new no(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const i=this.arr.length;e.writeLen(i-n);for(let r=n;r<i;r++){const s=this.arr[r];e.writeAny(s)}}getRef(){return 8}}const M8=t=>{const e=t.readLen(),n=[];for(let i=0;i<e;i++)n.push(t.readAny());return new no(n)};class nr{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new nr(this.str)}splice(e){const n=new nr(this.str.slice(e));this.str=this.str.slice(0,e);const i=this.str.charCodeAt(e-1);return i>=55296&&i<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const O8=t=>new nr(t.readString()),_8=[o8,c8,p8,g8,m8,b8,x8],D8=0,N8=1,R8=2,z8=3,L8=4,I8=5,B8=6;class ir{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new ir(this.type._copy())}splice(e){throw Pi()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(i=>{i.deleted?i.id.clock<(e.beforeState.get(i.id.client)||0)&&e._mergeStructs.push(i):i.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(i=>{for(;i!==null;)i.gc(e,!0),i=i.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const j8=t=>new ir(_8[t.readTypeRef()](t)),vb=(t,e)=>{let n=e,i=0,r;do i>0&&(n=Ie(n.client,n.clock+i)),r=pa(t,n),i=n.clock-r.id.clock,n=r.redone;while(n!==null&&r instanceof ht);return{item:r,diff:i}},fx=(t,e)=>{for(;t!==null&&t.keep!==e;)t.keep=e,t=t.parent._item},Fh=(t,e,n)=>{const{client:i,clock:r}=e.id,s=new ht(Ie(i,r+n),e,Ie(i,r+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=Ie(e.redone.client,e.redone.clock+n)),e.right=s,s.right!==null&&(s.right.left=s),t._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=n,s},PE=(t,e)=>V1(t,n=>Pa(n.deletions,e)),F_=(t,e,n,i,r,s)=>{const o=t.doc,c=o.store,f=o.clientID,d=e.redone;if(d!==null)return ti(t,d);let p=e.parent._item,m=null,y;if(p!==null&&p.deleted===!0){if(p.redone===null&&(!n.has(p)||F_(t,p,n,i,r,s)===null))return null;for(;p.redone!==null;)p=ti(t,p.redone)}const b=p===null?e.parent:p.content.type;if(e.parentSub===null){for(m=e.left,y=e;m!==null;){let E=m;for(;E!==null&&E.parent._item!==p;)E=E.redone===null?null:ti(t,E.redone);if(E!==null&&E.parent._item===p){m=E;break}m=m.left}for(;y!==null;){let E=y;for(;E!==null&&E.parent._item!==p;)E=E.redone===null?null:ti(t,E.redone);if(E!==null&&E.parent._item===p){y=E;break}y=y.right}}else if(y=null,e.right&&!r){for(m=e;m!==null&&m.right!==null&&(m.right.redone||Pa(i,m.right.id)||PE(s.undoStack,m.right.id)||PE(s.redoStack,m.right.id));)for(m=m.right;m.redone;)m=ti(t,m.redone);if(m&&m.right!==null)return null}else m=b._map.get(e.parentSub)||null;const S=$t(c,f),v=Ie(f,S),k=new ht(v,m,m&&m.lastId,y,y&&y.id,b,e.parentSub,e.content.copy());return e.redone=v,fx(k,!0),k.integrate(t,0),k};class ht extends ux{constructor(e,n,i,r,s,o,c,f){super(e,f.getLength()),this.origin=i,this.left=n,this.right=r,this.rightOrigin=s,this.parent=o,this.parentSub=c,this.redone=null,this.content=f,this.info=this.content.isCountable()?gE:0}set marker(e){(this.info&i0)>0!==e&&(this.info^=i0)}get marker(){return(this.info&i0)>0}get keep(){return(this.info&mE)>0}set keep(e){this.keep!==e&&(this.info^=mE)}get countable(){return(this.info&gE)>0}get deleted(){return(this.info&n0)>0}set deleted(e){this.deleted!==e&&(this.info^=n0)}markDeleted(){this.info|=n0}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=$t(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=$t(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===ha&&this.id.client!==this.parent.client&&this.parent.clock>=$t(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=RE(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=ti(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Bi||this.right&&this.right.constructor===Bi)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===ht?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===ht&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===ha){const i=pa(n,this.parent);i.constructor===Bi?this.parent=null:this.parent=i.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=RE(e,e.doc.store,Ie(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let i=this.left,r;if(i!==null)r=i.right;else if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start;const s=new Set,o=new Set;for(;r!==null&&r!==this.right;){if(o.add(r),s.add(r),la(this.origin,r.origin)){if(r.id.client<this.id.client)i=r,s.clear();else if(la(this.rightOrigin,r.rightOrigin))break}else if(r.origin!==null&&o.has(pa(e.doc.store,r.origin)))s.has(pa(e.doc.store,r.origin))||(i=r,s.clear());else break;r=r.right}this.left=i}if(this.left!==null){const i=this.left.right;this.right=i,this.left.right=this}else{let i;if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start,this.parent._start=this;this.right=i}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),v_(e.doc.store,this),this.content.integrate(e,this),LE(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new Bi(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Ie(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&la(e.origin,this.lastId)&&this.right===e&&la(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(i=>{i.p===e&&(i.p=this,!this.deleted&&this.countable&&(i.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),zu(e.deleteSet,this.id.client,this.id.clock,this.length),LE(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw Dn();this.content.gc(e),n?P5(e,this,new Bi(this.id,this.length)):this.content=new Hu(this.length)}write(e,n){const i=n>0?Ie(this.id.client,this.id.clock+n-1):this.origin,r=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&Zp|(i===null?0:Un)|(r===null?0:is)|(s===null?0:Ou);if(e.writeInfo(o),i!==null&&e.writeLeftID(i),r!==null&&e.writeRightID(r),i===null&&r===null){const c=this.parent;if(c._item!==void 0){const f=c._item;if(f===null){const d=Lu(c);e.writeParentInfo(!0),e.writeString(d)}else e.writeParentInfo(!1),e.writeLeftID(f.id)}else c.constructor===String?(e.writeParentInfo(!0),e.writeString(c)):c.constructor===ha?(e.writeParentInfo(!1),e.writeLeftID(c)):Dn();s!==null&&e.writeString(s)}this.content.write(e,n)}}const q_=(t,e)=>U8[e&Zp](t),U8=[()=>{Dn()},v8,T8,w8,O8,C8,E8,j8,M8,k8,()=>{Dn()}],H8=10;class ji extends ux{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){Dn()}write(e,n){e.writeInfo(H8),et(e.restEncoder,this.length-n)}getMissing(e,n){return null}}const Y_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},K_="__ $YJS$ __";Y_[K_]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");Y_[K_]=!0;const V8=()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else n!==void 0&&n()}},P8=/[\uD800-\uDBFF]/,$8=/[\uDC00-\uDFFF]/,F8=(t,e)=>{let n=0,i=0;for(;n<t.length&&n<e.length&&t[n]===e[n];)n++;for(n>0&&P8.test(t[n-1])&&n--;i+n<t.length&&i+n<e.length&&t[t.length-i-1]===e[e.length-i-1];)i++;return i>0&&$8.test(t[t.length-i])&&i--,{index:n,remove:t.length-n-i,insert:e.slice(n,e.length-i)}},q8=F8,Rt=new Dt("y-sync"),rs=new Dt("y-undo"),Hd=new Dt("yjs-cursor"),gr=(t,e)=>t>>>e|t<<32-e,Y8=t=>gr(t,2)^gr(t,13)^gr(t,22),K8=t=>gr(t,6)^gr(t,11)^gr(t,25),G8=t=>gr(t,7)^gr(t,18)^t>>>3,Z8=t=>gr(t,17)^gr(t,19)^t>>>10,J8=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),X8=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);class W8{constructor(){const e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(X8),this._W=new Uint32Array(e,64,64)}_updateHash(){const e=this._H,n=this._W;for(let m=16;m<64;m++)n[m]=Z8(n[m-2])+n[m-7]+G8(n[m-15])+n[m-16];let i=e[0],r=e[1],s=e[2],o=e[3],c=e[4],f=e[5],d=e[6],p=e[7];for(let m=0,y,b;m<64;m++)y=p+K8(c)+(c&f^~c&d)+J8[m]+n[m]>>>0,b=Y8(i)+(i&r^i&s^r&s)>>>0,p=d,d=f,f=c,c=o+y>>>0,o=s,s=r,r=i,i=y+b>>>0;e[0]+=i,e[1]+=r,e[2]+=s,e[3]+=o,e[4]+=c,e[5]+=f,e[6]+=d,e[7]+=p}digest(e){let n=0;for(;n+56<=e.length;){let o=0;for(;o<16&&n+3<e.length;o++)this._W[o]=e[n++]<<24|e[n++]<<16|e[n++]<<8|e[n++];if(n%64!==0){for(this._W.fill(0,o,16);n<e.length;)this._W[o]|=e[n]<<(3-n%4)*8,n++;this._W[o]|=Un<<(3-n%4)*8}this._updateHash()}const i=n%64!==0;this._W.fill(0,0,16);let r=0;for(;n<e.length;r++)for(let o=3;o>=0&&n<e.length;o--)this._W[r]|=e[n++]<<o*8;i||(this._W[r-(n%4===0?0:1)]|=Un<<(3-n%4)*8),this._W[14]=e.byteLength/EB,this._W[15]=e.byteLength*8,this._updateHash();const s=new Uint8Array(32);for(let o=0;o<this._H.length;o++)for(let c=0;c<4;c++)s[o*4+c]=this._H[o]>>>(3-c)*8;return s}}const Q8=t=>new W8().digest(t),eU=t=>{for(let n=6;n<t.length;n++)t[n%6]=t[n%6]^t[n];return t.slice(0,6)},tU=t=>Tj(eU(Q8(Mj(t)))),qh=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!Pa(e.ds,t.id),nU=[{light:"#ecd44433",dark:"#ecd444"}],iU=(t,e,n)=>{if(!t.has(n)){if(t.size<e.length){const i=Ql();t.forEach(r=>i.add(r)),e=e.filter(r=>!i.has(r))}t.set(n,rj(e))}return t.get(n)},rU=(t,{colors:e=nU,colorMapping:n=new Map,permanentUserData:i=null,onFirstRender:r=()=>{},mapping:s}={})=>{let o=!1;const c=new lU(t,s),f=new kt({props:{editable:d=>{const p=Rt.getState(d);return p.snapshot==null&&p.prevSnapshot==null}},key:Rt,state:{init:(d,p)=>({type:t,doc:t.doc,binding:c,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:n,permanentUserData:i}),apply:(d,p)=>{const m=d.getMeta(Rt);if(m!==void 0){p=Object.assign({},p);for(const y in m)p[y]=m[y]}return p.addToHistory=d.getMeta("addToHistory")!==!1,p.isChangeOrigin=m!==void 0&&!!m.isChangeOrigin,p.isUndoRedoOperation=m!==void 0&&!!m.isChangeOrigin&&!!m.isUndoRedoOperation,c.prosemirrorView!==null&&m!==void 0&&(m.snapshot!=null||m.prevSnapshot!=null)&&W1(0,()=>{c.prosemirrorView!=null&&(m.restore==null?c._renderSnapshot(m.snapshot,m.prevSnapshot,p):(c._renderSnapshot(m.snapshot,m.snapshot,p),delete p.restore,delete p.snapshot,delete p.prevSnapshot,c.mux(()=>{c._prosemirrorChanged(c.prosemirrorView.state.doc)})))}),p}},view:d=>(c.initView(d),s==null&&c._forceRerender(),r(),{update:()=>{const p=f.getState(d.state);if(p.snapshot==null&&p.prevSnapshot==null&&(o||d.state.doc.content.findDiffStart(d.state.doc.type.createAndFill().content)!==null)){if(o=!0,p.addToHistory===!1&&!p.isChangeOrigin){const m=rs.getState(d.state),y=m&&m.undoManager;y&&y.stopCapturing()}c.mux(()=>{p.doc.transact(m=>{m.meta.set("addToHistory",p.addToHistory),c._prosemirrorChanged(d.state.doc)},Rt)})}},destroy:()=>{c.destroy()}})});return f},sU=(t,e,n)=>{if(e!==null&&e.anchor!==null&&e.head!==null)if(e.type==="all")t.setSelection(new ni(t.doc));else if(e.type==="node"){const i=ga(n.doc,n.type,e.anchor,n.mapping);t.setSelection(Ee.create(t.doc,i))}else{const i=ga(n.doc,n.type,e.anchor,n.mapping),r=ga(n.doc,n.type,e.head,n.mapping);if(i!==null&&r!==null){const s=Ae.between(t.doc.resolve(i),t.doc.resolve(r));t.setSelection(s)}}},kb=(t,e)=>({type:e.selection.jsonID,anchor:Kh(e.selection.anchor,t.type,t.mapping),head:Kh(e.selection.head,t.type,t.mapping)});class lU{constructor(e,n=new Map){this.type=e,this.prosemirrorView=null,this.mux=V8(),this.mapping=n,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=kb(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(UO&&this._domSelectionInView===null&&(W1(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;const n=this.prosemirrorView._root.createRange();n.setStart(e.anchorNode,e.anchorOffset),n.setEnd(e.focusNode,e.focusOffset),n.getClientRects().length===0&&n.startContainer&&n.collapsed&&n.selectNodeContents(n.startContainer);const r=n.getBoundingClientRect(),s=sf.documentElement;return r.bottom>=0&&r.right>=0&&r.left<=(window.innerWidth||s.clientWidth||0)&&r.top<=(window.innerHeight||s.clientHeight||0)}renderSnapshot(e,n){n||(n=S_(u_(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(Rt,{snapshot:e,prevSnapshot:n}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{const e=this.type.toArray().map(i=>fh(i,this.prosemirrorView.state.schema,this)).filter(i=>i!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new de(W.from(e),0,0));n.setMeta(Rt,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(n)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{const e=this.beforeTransactionSelection!==null?null:this.prosemirrorView.state.selection,n=this.type.toArray().map(r=>fh(r,this.prosemirrorView.state.schema,this)).filter(r=>r!==null),i=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new de(W.from(n),0,0));if(e){const r=ns(er(e.anchor,0),i.doc.content.size),s=ns(er(e.head,0),i.doc.content.size);i.setSelection(Ae.create(i.doc,r,s))}this.prosemirrorView.dispatch(i.setMeta(Rt,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,n,i){let r=this.doc,s=this.type;if(e||(e=u0(this.doc)),e instanceof Uint8Array||n instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(n instanceof Uint8Array))&&Dn(),r=new kr({gc:!1}),jh(r,n),n=u0(r),jh(r,e),e=u0(r),s._item===null){const o=Array.from(this.doc.share.keys()).find(c=>this.doc.share.get(c)===this.type);s=r.getXmlFragment(o)}else{const o=r.store.clients.get(s._item.id.client)??[],c=tr(o,s._item.id.clock);s=o[c].content.type}this.mapping.clear(),this.mux(()=>{r.transact(o=>{const c=i.permanentUserData;c&&c.dss.forEach(m=>{rl(o,m,y=>{})});const f=(m,y)=>{const b=m==="added"?c.getUserByClientId(y.client):c.getUserByDeletedId(y);return{user:b,type:m,color:iU(i.colorMapping,i.colors,b)}},d=D_(s,new ix(n.ds,e.sv)).map(m=>!m._item.deleted||qh(m._item,e)||qh(m._item,n)?fh(m,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,n,f):null).filter(m=>m!==null),p=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new de(W.from(d),0,0));this.prosemirrorView.dispatch(p.setMeta(Rt,{isChangeOrigin:!0}))},Rt)})}_typeChanged(e,n){if(this.prosemirrorView==null)return;const i=Rt.getState(this.prosemirrorView.state);if(e.length===0||i.snapshot!=null||i.prevSnapshot!=null){this.renderSnapshot(i.snapshot,i.prevSnapshot);return}this.mux(()=>{const r=(c,f)=>this.mapping.delete(f);rl(n,n.deleteSet,c=>{if(c.constructor===ht){const f=c.content.type;f&&this.mapping.delete(f)}}),n.changed.forEach(r),n.changedParentTypes.forEach(r);const s=this.type.toArray().map(c=>G_(c,this.prosemirrorView.state.schema,this)).filter(c=>c!==null);let o=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new de(W.from(s),0,0));sU(o,this.beforeTransactionSelection,this),o=o.setMeta(Rt,{isChangeOrigin:!0,isUndoRedoOperation:n.origin instanceof E_}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&o.scrollIntoView(),this.prosemirrorView.dispatch(o)})}_prosemirrorChanged(e){this.doc.transact(()=>{Eb(this.doc,this.type,e,this),this.beforeTransactionSelection=kb(this,this.prosemirrorView.state)},Rt)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions))}}const G_=(t,e,n,i,r,s)=>{const o=n.mapping.get(t);if(o===void 0){if(t instanceof En)return fh(t,e,n,i,r,s);throw Pi()}return o},fh=(t,e,n,i,r,s)=>{const o=[],c=f=>{var d,p;if(f instanceof En){const m=G_(f,e,n,i,r,s);m!==null&&o.push(m)}else{const m=(p=(d=f._item.right)==null?void 0:d.content)==null?void 0:p.type;m instanceof sl&&!m._item.deleted&&m._item.id.client===m.doc.clientID&&(f.applyDelta([{retain:f.length},...m.toDelta()]),m.doc.transact(b=>{m._item.delete(b)}));const y=oU(f,e,n,i,r,s);y!==null&&y.forEach(b=>{b!==null&&o.push(b)})}};i===void 0||r===void 0?t.toArray().forEach(c):D_(t,new ix(r.ds,i.sv)).forEach(c);try{const f=t.getAttributes(i);i!==void 0&&(qh(t._item,i)?qh(t._item,r)||(f.ychange=s?s("added",t._item.id):{type:"added"}):f.ychange=s?s("removed",t._item.id):{type:"removed"});const d=e.node(t.nodeName,f,o);return n.mapping.set(t,d),d}catch{return t.doc.transact(d=>{t._item.delete(d)},Rt),n.mapping.delete(t),null}},oU=(t,e,n,i,r,s)=>{const o=[],c=t.toDelta(i,r,s);try{for(let f=0;f<c.length;f++){const d=c[f];o.push(e.text(d.insert,hU(d.attributes,e)))}}catch{return t.doc.transact(d=>{t._item.delete(d)},Rt),null}return o},aU=(t,e)=>{const n=new Hn,i=t.map(r=>({insert:r.text,attributes:J_(r.marks,e)}));return n.applyDelta(i),e.mapping.set(n,t),n},cU=(t,e)=>{const n=new En(t.type.name);for(const i in t.attrs){const r=t.attrs[i];r!==null&&i!=="ychange"&&n.setAttribute(i,r)}return n.insert(0,om(t).map(i=>Cb(i,e))),e.mapping.set(n,t),n},Cb=(t,e)=>t instanceof Array?aU(t,e):cU(t,e),$E=t=>typeof t=="object"&&t!==null,dx=(t,e)=>{const n=Object.keys(t).filter(r=>t[r]!==null);let i=n.length===(e==null?0:Object.keys(e).filter(r=>e[r]!==null).length);for(let r=0;r<n.length&&i;r++){const s=n[r],o=t[s],c=e[s];i=s==="ychange"||o===c||$E(o)&&$E(c)&&dx(o,c)}return i},om=t=>{const e=t.content.content,n=[];for(let i=0;i<e.length;i++){const r=e[i];if(r.isText){const s=[];for(let o=e[i];i<e.length&&o.isText;o=e[++i])s.push(o);i--,n.push(s)}else n.push(r)}return n},Z_=(t,e)=>{const n=t.toDelta();return n.length===e.length&&n.every((i,r)=>i.insert===e[r].text&&IO(i.attributes||{}).length===e[r].marks.length&&Ua(i.attributes,(s,o)=>{var d;const c=hx(o),f=e[r].marks;return dx(s,(d=f.find(p=>p.type.name===c))==null?void 0:d.attrs)}))},Vu=(t,e)=>{if(t instanceof En&&!(e instanceof Array)&&Tb(t,e)){const n=om(e);return t._length===n.length&&dx(t.getAttributes(),e.attrs)&&t.toArray().every((i,r)=>Vu(i,n[r]))}return t instanceof Hn&&e instanceof Array&&Z_(t,e)},Yh=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((n,i)=>e[i]===n),FE=(t,e,n)=>{const i=t.toArray(),r=om(e),s=r.length,o=i.length,c=ns(o,s);let f=0,d=0,p=!1;for(;f<c;f++){const m=i[f],y=r[f];if(Yh(n.mapping.get(m),y))p=!0;else if(!Vu(m,y))break}for(;f+d<c;d++){const m=i[o-d-1],y=r[s-d-1];if(Yh(n.mapping.get(m),y))p=!0;else if(!Vu(m,y))break}return{equalityFactor:f+d,foundMappedChild:p}},uU=t=>{let e="",n=t._start;const i={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof nr?e+=n.content.str:n.content instanceof Wt&&(i[n.content.key]=null)),n=n.right;return{str:e,nAttrs:i}},fU=(t,e,n)=>{n.mapping.set(t,e);const{nAttrs:i,str:r}=uU(t),s=e.map(d=>({insert:d.text,attributes:Object.assign({},i,J_(d.marks,n))})),{insert:o,remove:c,index:f}=q8(r,s.map(d=>d.insert).join(""));t.delete(f,c),t.insert(f,o),t.applyDelta(s.map(d=>({retain:d.insert.length,attributes:d.attributes})))},dU=/(.*)(--[a-zA-Z0-9+/=]{8})$/,hx=t=>{var e;return((e=dU.exec(t))==null?void 0:e[1])??t},hU=(t,e)=>{const n=[];for(const i in t)n.push(e.mark(hx(i),t[i]));return n},J_=(t,e)=>{const n={};return t.forEach(i=>{if(i.type.name!=="ychange"){const r=Er(e.isOMark,i.type,()=>!i.type.excludes(i.type));n[r?`${i.type.name}--${tU(i.toJSON())}`:i.type.name]=i.attrs}}),n},Eb=(t,e,n,i)=>{if(e instanceof En&&e.nodeName!==n.type.name)throw new Error("node name mismatch!");if(i.mapping.set(e,n),e instanceof En){const m=e.getAttributes(),y=n.attrs;for(const b in y)y[b]!==null?m[b]!==y[b]&&b!=="ychange"&&e.setAttribute(b,y[b]):e.removeAttribute(b);for(const b in m)y[b]===void 0&&e.removeAttribute(b)}const r=om(n),s=r.length,o=e.toArray(),c=o.length,f=ns(s,c);let d=0,p=0;for(;d<f;d++){const m=o[d],y=r[d];if(!Yh(i.mapping.get(m),y))if(Vu(m,y))i.mapping.set(m,y);else break}for(;p+d<f;p++){const m=o[c-p-1],y=r[s-p-1];if(!Yh(i.mapping.get(m),y))if(Vu(m,y))i.mapping.set(m,y);else break}t.transact(()=>{for(;c-d-p>0&&s-d-p>0;){const y=o[d],b=r[d],S=o[c-p-1],v=r[s-p-1];if(y instanceof Hn&&b instanceof Array)Z_(y,b)||fU(y,b,i),d+=1;else{let k=y instanceof En&&Tb(y,b),E=S instanceof En&&Tb(S,v);if(k&&E){const j=FE(y,b,i),L=FE(S,v,i);j.foundMappedChild&&!L.foundMappedChild?E=!1:!j.foundMappedChild&&L.foundMappedChild||j.equalityFactor<L.equalityFactor?k=!1:E=!1}k?(Eb(t,y,b,i),d+=1):E?(Eb(t,S,v,i),p+=1):(i.mapping.delete(e.get(d)),e.delete(d,1),e.insert(d,[Cb(b,i)]),d+=1)}}const m=c-d-p;if(c===1&&s===0&&o[0]instanceof Hn?(i.mapping.delete(o[0]),o[0].delete(0,o[0].length)):m>0&&(e.slice(d,d+m).forEach(y=>i.mapping.delete(y)),e.delete(d,m)),d+p<s){const y=[];for(let b=d;b<s-p;b++)y.push(Cb(r[b],i));e.insert(d,y)}},Rt)},Tb=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name;let ru=null;const pU=()=>{const t=ru;ru=null,t.forEach((e,n)=>{const i=n.state.tr,r=Rt.getState(n.state);r&&r.binding&&!r.binding.isDestroyed&&(e.forEach((s,o)=>{i.setMeta(o,s)}),n.dispatch(i))})},mU=(t,e,n)=>{ru||(ru=new Map,W1(0,pU)),Er(ru,t,Vi).set(e,n)},Kh=(t,e,n)=>{if(t===0)return c0(e,0,e.length===0?-1:0);let i=e._first===null?null:e._first.content.type;for(;i!==null&&e!==i;){if(i instanceof Hn){if(i._length>=t)return c0(i,t,e.length===0?-1:0);if(t-=i._length,i._item!==null&&i._item.next!==null)i=i._item.next.content.type;else{do i=i._item===null?null:i._item.parent,t--;while(i!==e&&i!==null&&i._item!==null&&i._item.next===null);i!==null&&i!==e&&(i=i._item===null?null:i._item.next.content.type)}}else{const r=(n.get(i)||{nodeSize:0}).nodeSize;if(i._first!==null&&t<r)i=i._first.content.type,t--;else{if(t===1&&i._length===0&&r>1)return new Bu(i._item===null?null:i._item.id,i._item===null?Lu(i):null,null);if(t-=r,i._item!==null&&i._item.next!==null)i=i._item.next.content.type;else{if(t===0)return i=i._item===null?i:i._item.parent,new Bu(i._item===null?null:i._item.id,i._item===null?Lu(i):null,null);do i=i._item.parent,t--;while(i!==e&&i._item.next===null);i!==e&&(i=i._item.next.content.type)}}}if(i===null)throw Dn();if(t===0&&i.constructor!==Hn&&i!==e)return gU(i._item.parent,i._item)}return c0(e,e._length,e.length===0?-1:0)},gU=(t,e)=>{let n=null,i=null;return t._item===null?i=Lu(t):n=Ie(t._item.id.client,t._item.id.clock),new Bu(n,i,e.id)},ga=(t,e,n,i)=>{const r=bb(n,t);if(r===null||r.type!==e&&!Iu(e,r.type._item))return null;let s=r.type,o=0;if(s.constructor===Hn)o=r.index;else if(s._item===null||!s._item.deleted){let c=s._first,f=0;for(;f<s._length&&f<r.index&&c!==null;){if(!c.deleted){const d=c.content.type;f++,d instanceof Hn?o+=d._length:o+=i.get(d).nodeSize}c=c.right}o+=1}for(;s!==e&&s._item!==null;){const c=s._item.parent;if(c._item===null||!c._item.deleted){o+=1;let f=c._first;for(;f!==null;){const d=f.content.type;if(d===s)break;f.deleted||(d instanceof Hn?o+=d._length:o+=i.get(d).nodeSize),f=f.right}}s=c}return o-1};function yU(t){const e=t.toArray(),n=i=>{let r;if(i instanceof Hn)r=i.toDelta().map(o=>{const c={type:"text",text:o.insert};return o.attributes&&(c.marks=Object.keys(o.attributes).map(f=>{const d=o.attributes[f],m={type:hx(f)};return Object.keys(d)&&(m.attrs=d),m})),c});else if(i instanceof En){r={type:i.nodeName};const s=i.getAttributes();Object.keys(s).length&&(r.attrs=s);const o=i.toArray();o.length&&(r.content=o.map(n).flat())}else Dn();return r};return{type:"doc",content:e.map(n)}}const bU=(t,e,n)=>t!==e,xU=t=>{const e=document.createElement("span");e.classList.add("ProseMirror-yjs-cursor"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name),null);const i=document.createTextNode(""),r=document.createTextNode("");return e.insertBefore(i,null),e.insertBefore(n,null),e.insertBefore(r,null),e},X_=t=>({style:`background-color: ${t.color}70`,class:"ProseMirror-yjs-selection"}),SU=/^#[0-9a-fA-F]{6}$/,qE=(t,e,n,i,r)=>{const s=Rt.getState(t),o=s.doc,c=[];return s.snapshot!=null||s.prevSnapshot!=null||s.binding.mapping.size===0?bt.create(t.doc,[]):(e.getStates().forEach((f,d)=>{if(n(o.clientID,d,f)&&f.cursor!=null){const p=f.user||{};p.color==null?p.color="#ffa500":SU.test(p.color)||console.warn("A user uses an unsupported color format",p),p.name==null&&(p.name=`User: ${d}`);let m=ga(o,s.type,Yl(f.cursor.anchor),s.binding.mapping),y=ga(o,s.type,Yl(f.cursor.head),s.binding.mapping);if(m!==null&&y!==null){const b=er(t.doc.content.size-1,0);m=ns(m,b),y=ns(y,b),c.push(Jt.widget(y,()=>i(p,d),{key:d+"",side:10}));const S=ns(m,y),v=er(m,y);c.push(Jt.inline(S,v,r(p,d),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),bt.create(t.doc,c))},wU=(t,{awarenessStateFilter:e=bU,cursorBuilder:n=xU,selectionBuilder:i=X_,getSelection:r=o=>o.selection}={},s="cursor")=>new kt({key:Hd,state:{init(o,c){return qE(c,t,e,n,i)},apply(o,c,f,d){const p=Rt.getState(d),m=o.getMeta(Hd);return p&&p.isChangeOrigin||m&&m.awarenessUpdated?qE(d,t,e,n,i):c.map(o.mapping,o.doc)}},props:{decorations:o=>Hd.getState(o)},view:o=>{const c=()=>{o.docView&&mU(o,Hd,{awarenessUpdated:!0})},f=()=>{const d=Rt.getState(o.state),p=t.getLocalState()||{};if(o.hasFocus()){const m=r(o.state),y=Kh(m.anchor,d.type,d.binding.mapping),b=Kh(m.head,d.type,d.binding.mapping);(p.cursor==null||!NE(Yl(p.cursor.anchor),y)||!NE(Yl(p.cursor.head),b))&&t.setLocalStateField(s,{anchor:y,head:b})}else p.cursor!=null&&ga(d.doc,d.type,Yl(p.cursor.anchor),d.binding.mapping)!==null&&t.setLocalStateField(s,null)};return t.on("change",c),o.dom.addEventListener("focusin",f),o.dom.addEventListener("focusout",f),{update:f,destroy:()=>{o.dom.removeEventListener("focusin",f),o.dom.removeEventListener("focusout",f),t.off("change",c),t.setLocalStateField(s,null)}}}}),vU=t=>{var e,n;return((n=(e=rs.getState(t))==null?void 0:e.undoManager)==null?void 0:n.undo())!=null},kU=t=>{var e,n;return((n=(e=rs.getState(t))==null?void 0:e.undoManager)==null?void 0:n.redo())!=null},CU=new Set(["paragraph"]),EU=(t,e)=>!(t instanceof ht)||!(t.content instanceof ir)||!(t.content.type instanceof sl||t.content.type instanceof En&&e.has(t.content.type.nodeName))||t.content.type._length===0,TU=({protectedNodes:t=CU,trackedOrigins:e=[],undoManager:n=null}={})=>new kt({key:rs,state:{init:(i,r)=>{const s=Rt.getState(r),o=n||new E_(s.type,{trackedOrigins:new Set([Rt].concat(e)),deleteFilter:c=>EU(c,t),captureTransaction:c=>c.meta.get("addToHistory")!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(i,r,s,o)=>{const c=Rt.getState(o).binding,f=r.undoManager,d=f.undoStack.length>0,p=f.redoStack.length>0;return c?{undoManager:f,prevSel:kb(c,s),hasUndoOps:d,hasRedoOps:p}:d!==r.hasUndoOps||p!==r.hasRedoOps?Object.assign({},r,{hasUndoOps:f.undoStack.length>0,hasRedoOps:f.redoStack.length>0}):r}},view:i=>{const r=Rt.getState(i.state),s=rs.getState(i.state).undoManager;return s.on("stack-item-added",({stackItem:o})=>{const c=r.binding;c&&o.meta.set(c,rs.getState(i.state).prevSel)}),s.on("stack-item-popped",({stackItem:o})=>{const c=r.binding;c&&(c.beforeTransactionSelection=o.meta.get(c)||c.beforeTransactionSelection)}),{destroy:()=>{s.destroy()}}}}),AU=Xt.create({name:"collaboration",priority:1e3,addOptions(){return{document:null,field:"default",fragment:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(t=>t.name==="history")&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".')},addCommands(){return{undo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),rs.getState(e).undoManager.undoStack.length===0?!1:n?vU(e):!0),redo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),rs.getState(e).undoManager.redoStack.length===0?!1:n?kU(e):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){var t;const e=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),n=TU(this.options.yUndoOptions),i=n.spec.view;n.spec.view=o=>{const{undoManager:c}=rs.getState(o.state);c.restore&&(c.restore(),c.restore=()=>{});const f=i?i(o):void 0;return{destroy:()=>{const d=c.trackedOrigins.has(c),p=c._observers;c.restore=()=>{d&&c.trackedOrigins.add(c),c.doc.on("afterTransaction",c.afterTransactionHandler),c._observers=p},f!=null&&f.destroy&&f.destroy()}}};const r={...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender},s=rU(e,r);return this.editor.options.enableContentCheck&&((t=e.doc)===null||t===void 0||t.on("beforeTransaction",()=>{try{const o=yU(e);if(o.content.length===0)return;this.editor.schema.nodeFromJSON(o).check()}catch(o){return this.editor.emit("contentError",{error:o,editor:this.editor,disableCollaboration:()=>{var c;(c=e.doc)===null||c===void 0||c.destroy(),this.storage.isDisabled=!0}}),!1}})),[s,n,this.editor.options.enableContentCheck&&new kt({key:new Dt("filterInvalidContent"),filterTransaction:()=>{var o;return this.storage.isDisabled&&((o=e.doc)===null||o===void 0||o.destroy()),!0}})].filter(Boolean)}}),YE=t=>Array.from(t.entries()).map(([e,n])=>({clientId:e,...n.user})),KE=()=>null,MU=Xt.create({name:"collaborationCursor",priority:999,addOptions(){return{provider:null,user:{name:null,color:null},render:t=>{const e=document.createElement("span");e.classList.add("collaboration-cursor__caret"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");return n.classList.add("collaboration-cursor__label"),n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name),null),e.insertBefore(n,null),e},selectionRender:X_,onUpdate:KE}},onCreate(){if(this.options.onUpdate!==KE&&console.warn('[tiptap warn]: DEPRECATED: The "onUpdate" option is deprecated. Please use `editor.storage.collaborationCursor.users` instead. Read more: https://tiptap.dev/api/extensions/collaboration-cursor'),!this.options.provider)throw new Error('The "provider" option is required for the CollaborationCursor extension')},addStorage(){return{users:[]}},addCommands(){return{updateUser:t=>()=>(this.options.user=t,this.options.provider.awareness.setLocalStateField("user",this.options.user),!0),user:t=>({editor:e})=>(console.warn('[tiptap warn]: DEPRECATED: The "user" command is deprecated. Please use "updateUser" instead. Read more: https://tiptap.dev/api/extensions/collaboration-cursor'),e.commands.updateUser(t))}},addProseMirrorPlugins(){return[wU((this.options.provider.awareness.setLocalStateField("user",this.options.user),this.storage.users=YE(this.options.provider.awareness.states),this.options.provider.awareness.on("update",()=>{this.storage.users=YE(this.options.provider.awareness.states)}),this.options.provider.awareness),{cursorBuilder:this.options.render,selectionBuilder:this.options.selectionRender})]}}),OU=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,_U=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,DU=wr.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",Ut(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Wl({find:OU,type:this.type})]},addPasteRules(){return[nl({find:_U,type:this.type})]}}),NU="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",RU="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ab="numeric",Mb="ascii",Ob="alpha",su="asciinumeric",Jc="alphanumeric",_b="domain",W_="emoji",zU="scheme",LU="slashscheme",h0="whitespace";function IU(t,e){return t in e||(e[t]=[]),e[t]}function jl(t,e,n){e[Ab]&&(e[su]=!0,e[Jc]=!0),e[Mb]&&(e[su]=!0,e[Ob]=!0),e[su]&&(e[Jc]=!0),e[Ob]&&(e[Jc]=!0),e[Jc]&&(e[_b]=!0),e[W_]&&(e[_b]=!0);for(const i in e){const r=IU(i,n);r.indexOf(t)<0&&r.push(t)}}function BU(t,e){const n={};for(const i in e)e[i].indexOf(t)>=0&&(n[i]=!0);return n}function ei(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}ei.groups={};ei.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let i=0;i<e.jr.length;i++){const r=e.jr[i][0],s=e.jr[i][1];if(s&&r.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,i){for(let r=0;r<t.length;r++)this.tt(t[r],e,n,i)},tr(t,e,n,i){i=i||ei.groups;let r;return e&&e.j?r=e:(r=new ei(e),n&&i&&jl(e,n,i)),this.jr.push([t,r]),r},ts(t,e,n,i){let r=this;const s=t.length;if(!s)return r;for(let o=0;o<s-1;o++)r=r.tt(t[o]);return r.tt(t[s-1],e,n,i)},tt(t,e,n,i){i=i||ei.groups;const r=this;if(e&&e.j)return r.j[t]=e,e;const s=e;let o,c=r.go(t);if(c?(o=new ei,Object.assign(o.j,c.j),o.jr.push.apply(o.jr,c.jr),o.jd=c.jd,o.t=c.t):o=new ei,s){if(i)if(o.t&&typeof o.t=="string"){const f=Object.assign(BU(o.t,i),n);jl(s,f,i)}else n&&jl(s,n,i);o.t=s}return r.j[t]=o,o}};const Pe=(t,e,n,i,r)=>t.ta(e,n,i,r),It=(t,e,n,i,r)=>t.tr(e,n,i,r),GE=(t,e,n,i,r)=>t.ts(e,n,i,r),le=(t,e,n,i,r)=>t.tt(e,n,i,r),Jr="WORD",Db="UWORD",Q_="ASCIINUMERICAL",eD="ALPHANUMERICAL",Pu="LOCALHOST",Nb="TLD",Rb="UTLD",dh="SCHEME",na="SLASH_SCHEME",px="NUM",zb="WS",mx="NL",lu="OPENBRACE",ou="CLOSEBRACE",Gh="OPENBRACKET",Zh="CLOSEBRACKET",Jh="OPENPAREN",Xh="CLOSEPAREN",Wh="OPENANGLEBRACKET",Qh="CLOSEANGLEBRACKET",ep="FULLWIDTHLEFTPAREN",tp="FULLWIDTHRIGHTPAREN",np="LEFTCORNERBRACKET",ip="RIGHTCORNERBRACKET",rp="LEFTWHITECORNERBRACKET",sp="RIGHTWHITECORNERBRACKET",lp="FULLWIDTHLESSTHAN",op="FULLWIDTHGREATERTHAN",ap="AMPERSAND",cp="APOSTROPHE",up="ASTERISK",Hs="AT",fp="BACKSLASH",dp="BACKTICK",hp="CARET",Fs="COLON",gx="COMMA",pp="DOLLAR",fr="DOT",mp="EQUALS",yx="EXCLAMATION",Ri="HYPHEN",au="PERCENT",gp="PIPE",yp="PLUS",bp="POUND",cu="QUERY",bx="QUOTE",tD="FULLWIDTHMIDDLEDOT",xx="SEMI",dr="SLASH",uu="TILDE",xp="UNDERSCORE",nD="EMOJI",Sp="SYM";var iD=Object.freeze({__proto__:null,ALPHANUMERICAL:eD,AMPERSAND:ap,APOSTROPHE:cp,ASCIINUMERICAL:Q_,ASTERISK:up,AT:Hs,BACKSLASH:fp,BACKTICK:dp,CARET:hp,CLOSEANGLEBRACKET:Qh,CLOSEBRACE:ou,CLOSEBRACKET:Zh,CLOSEPAREN:Xh,COLON:Fs,COMMA:gx,DOLLAR:pp,DOT:fr,EMOJI:nD,EQUALS:mp,EXCLAMATION:yx,FULLWIDTHGREATERTHAN:op,FULLWIDTHLEFTPAREN:ep,FULLWIDTHLESSTHAN:lp,FULLWIDTHMIDDLEDOT:tD,FULLWIDTHRIGHTPAREN:tp,HYPHEN:Ri,LEFTCORNERBRACKET:np,LEFTWHITECORNERBRACKET:rp,LOCALHOST:Pu,NL:mx,NUM:px,OPENANGLEBRACKET:Wh,OPENBRACE:lu,OPENBRACKET:Gh,OPENPAREN:Jh,PERCENT:au,PIPE:gp,PLUS:yp,POUND:bp,QUERY:cu,QUOTE:bx,RIGHTCORNERBRACKET:ip,RIGHTWHITECORNERBRACKET:sp,SCHEME:dh,SEMI:xx,SLASH:dr,SLASH_SCHEME:na,SYM:Sp,TILDE:uu,TLD:Nb,UNDERSCORE:xp,UTLD:Rb,UWORD:Db,WORD:Jr,WS:zb});const Gr=/[a-z]/,Pc=new RegExp("\\p{L}","u"),p0=new RegExp("\\p{Emoji}","u"),Zr=/\d/,m0=/\s/,ZE="\r",g0=`
|
|
159
|
+
${n.toString()}`)};class i5{constructor(e){this.patterns=[],this.$state=e}if(e,n){return this.patterns.push({if:Ru(e),h:n}),this}else(e){return this.if(Bh,e)}done(){return(e,n)=>{for(let i=0;i<this.patterns.length;i++){const r=this.patterns[i];if(r.if.check(e))return r.h(e,n)}throw vr("Unhandled pattern")}}}const r5=t=>new i5(t),n_=r5(Bh).if(QO,(t,e)=>l0(e,yE,Nh)).if(e_,(t,e)=>Dj(e)).if(e5,(t,e)=>TE(e)).if(Qj,(t,e)=>BigInt(l0(e,yE,Nh))).if(Ih,(t,e)=>Xo(e,o0(e,t.shape))).if(Hj,(t,e)=>{const n={};for(const i in t.shape){let r=t.shape[i];if(Bj.check(r)){if(TE(e))continue;r=r.shape}n[i]=n_(r,e)}return n}).if(Fj,(t,e)=>{const n=[],i=VO(e,0,42);for(let r=0;r<i;r++)n.push(Xo(e,t.shape));return n}).if(PO,(t,e)=>o0(e,t.shape)).if(t5,(t,e)=>null).if(Zj,(t,e)=>{const n=Xo(e,t.res);return()=>n}).if(Wj,(t,e)=>Xo(e,o0(e,[da,Ma,nm,t_,X1,tm,ZO(da),YO(Ha("a","b","c"),da)]))).if(Pj,(t,e)=>{const n={},i=l0(e,0,3);for(let r=0;r<i;r++){const s=Xo(e,t.shape.keys),o=Xo(e,t.shape.values);n[s]=o}return n}).done(),Xo=(t,e)=>n_(Ru(e),t),sf=typeof document<"u"?document:{};pn(t=>t.nodeType===c5);typeof DOMParser<"u"&&new DOMParser;pn(t=>t.nodeType===l5);pn(t=>t.nodeType===o5);const s5=t=>wB(t,(e,n)=>`${n}:${e};`).join(""),l5=sf.ELEMENT_NODE,o5=sf.TEXT_NODE,a5=sf.DOCUMENT_NODE,c5=sf.DOCUMENT_FRAGMENT_NODE;pn(t=>t.nodeType===a5);const u5=t=>class{constructor(n){this._=n}destroy(){t(this._)}},f5=u5(clearTimeout),W1=(t,e)=>new f5(setTimeout(e,t)),as=Symbol,i_=as(),r_=as(),d5=as(),h5=as(),p5=as(),s_=as(),m5=as(),Q1=as(),g5=as(),y5=t=>{var r;t.length===1&&((r=t[0])==null?void 0:r.constructor)===Function&&(t=t[0]());const e=[],n=[];let i=0;for(;i<t.length;i++){const s=t[i];if(s===void 0)break;if(s.constructor===String||s.constructor===Number)e.push(s);else if(s.constructor===Object)break}for(i>0&&n.push(e.join(""));i<t.length;i++){const s=t[i];s instanceof Symbol||n.push(s)}return n},b5={[i_]:Kr("font-weight","bold"),[r_]:Kr("font-weight","normal"),[d5]:Kr("color","blue"),[p5]:Kr("color","green"),[h5]:Kr("color","grey"),[s_]:Kr("color","red"),[m5]:Kr("color","purple"),[Q1]:Kr("color","orange"),[g5]:Kr("color","black")},x5=t=>{var o;t.length===1&&((o=t[0])==null?void 0:o.constructor)===Function&&(t=t[0]());const e=[],n=[],i=Vi();let r=[],s=0;for(;s<t.length;s++){const c=t[s],f=b5[c];if(f!==void 0)i.set(f.left,f.right);else{if(c===void 0)break;if(c.constructor===String||c.constructor===Number){const d=s5(i);s>0||d.length>0?(e.push("%c"+c),n.push(d)):e.push(c)}else break}}for(s>0&&(r=n,r.unshift(e.join("")));s<t.length;s++){const c=t[s];c instanceof Symbol||r.push(c)}return r},l_=vj?x5:y5,S5=(...t)=>{console.log(...l_(t)),a_.forEach(e=>e.print(t))},o_=(...t)=>{console.warn(...l_(t)),t.unshift(Q1),a_.forEach(e=>e.print(t))},a_=Ql(),c_=t=>({[Symbol.iterator](){return this},next:t}),w5=(t,e)=>c_(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),a0=(t,e)=>c_(()=>{const{done:n,value:i}=t.next();return{done:n,value:n?void 0:e(i)}});class im{constructor(e,n){this.clock=e,this.len=n}}class Va{constructor(){this.clients=new Map}}const rl=(t,e,n)=>e.clients.forEach((i,r)=>{const s=t.doc.store.clients.get(r);if(s!=null){const o=s[s.length-1],c=o.id.clock+o.length;for(let f=0,d=i[f];f<i.length&&d.clock<c;d=i[++f])k_(t,s,d.clock,d.len,n)}}),v5=(t,e)=>{let n=0,i=t.length-1;for(;n<=i;){const r=Qi((n+i)/2),s=t[r],o=s.clock;if(o<=e){if(e<o+s.len)return r;n=r+1}else i=r-1}return null},Pa=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&v5(n,e.clock)!==null},ex=t=>{t.clients.forEach(e=>{e.sort((r,s)=>r.clock-s.clock);let n,i;for(n=1,i=1;n<e.length;n++){const r=e[i-1],s=e[n];r.clock+r.len>=s.clock?e[i-1]=new im(r.clock,er(r.len,s.clock+s.len-r.clock)):(i<n&&(e[i]=s),i++)}e.length=i})},yb=t=>{const e=new Va;for(let n=0;n<t.length;n++)t[n].clients.forEach((i,r)=>{if(!e.clients.has(r)){const s=i.slice();for(let o=n+1;o<t.length;o++)kB(s,t[o].clients.get(r)||[]);e.clients.set(r,s)}});return ex(e),e},zu=(t,e,n,i)=>{Er(t.clients,e,()=>[]).push(new im(n,i))},u_=()=>new Va,f_=t=>{const e=u_();return t.clients.forEach((n,i)=>{const r=[];for(let s=0;s<n.length;s++){const o=n[s];if(o.deleted){const c=o.id.clock;let f=o.length;if(s+1<n.length)for(let d=n[s+1];s+1<n.length&&d.deleted;d=n[++s+1])f+=d.length;r.push(new im(c,f))}}r.length>0&&e.clients.set(i,r)}),e},$a=(t,e)=>{et(t.restEncoder,e.clients.size),il(e.clients.entries()).sort((n,i)=>i[0]-n[0]).forEach(([n,i])=>{t.resetDsCurVal(),et(t.restEncoder,n);const r=i.length;et(t.restEncoder,r);for(let s=0;s<r;s++){const o=i[s];t.writeDsClock(o.clock),t.writeDsLen(o.len)}})},tx=t=>{const e=new Va,n=Ye(t.restDecoder);for(let i=0;i<n;i++){t.resetDsCurVal();const r=Ye(t.restDecoder),s=Ye(t.restDecoder);if(s>0){const o=Er(e.clients,r,()=>[]);for(let c=0;c<s;c++)o.push(new im(t.readDsClock(),t.readDsLen()))}}return e},ME=(t,e,n)=>{const i=new Va,r=Ye(t.restDecoder);for(let s=0;s<r;s++){t.resetDsCurVal();const o=Ye(t.restDecoder),c=Ye(t.restDecoder),f=n.clients.get(o)||[],d=$t(n,o);for(let p=0;p<c;p++){const m=t.readDsClock(),y=m+t.readDsLen();if(m<d){d<y&&zu(i,o,d,y-d);let b=tr(f,m),S=f[b];for(!S.deleted&&S.id.clock<m&&(f.splice(b+1,0,Fh(e,S,m-S.id.clock)),b++);b<f.length&&(S=f[b++],S.id.clock<y);)S.deleted||(y<S.id.clock+S.length&&f.splice(b,0,Fh(e,S,y-S.id.clock)),S.delete(e))}else zu(i,o,m,y-m)}}if(i.clients.size>0){const s=new eo;return et(s.restEncoder,0),$a(s,i),s.toUint8Array()}return null},d_=RO;class kr extends MO{constructor({guid:e=lj(),collectionid:n=null,gc:i=!0,gcFilter:r=()=>!0,meta:s=null,autoLoad:o=!1,shouldLoad:c=!0}={}){super(),this.gc=i,this.gcFilter=r,this.clientID=d_(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new w_,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=c,this.autoLoad=o,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=CE(d=>{this.on("load",()=>{this.isLoaded=!0,d(this)})});const f=()=>CE(d=>{const p=m=>{(m===void 0||m===!0)&&(this.off("sync",p),d())};this.on("sync",p)});this.on("sync",d=>{d===!1&&this.isSynced&&(this.whenSynced=f()),this.isSynced=d===void 0||d===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=f()}load(){const e=this._item;e!==null&&!this.shouldLoad&&wt(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(il(this.subdocs).map(e=>e.guid))}transact(e,n=null){return wt(this,e,n)}get(e,n=fn){const i=Er(this.share,e,()=>{const s=new n;return s._integrate(this,null),s}),r=i.constructor;if(n!==fn&&r!==n)if(r===fn){const s=new n;s._map=i._map,i._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=s}),s._start=i._start;for(let o=s._start;o!==null;o=o.right)o.parent=s;return s._length=i._length,this.share.set(e,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return i}getArray(e=""){return this.get(e,ma)}getText(e=""){return this.get(e,sl)}getMap(e=""){return this.get(e,_a)}getXmlElement(e=""){return this.get(e,En)}getXmlFragment(e=""){return this.get(e,to)}toJSON(){const e={};return this.share.forEach((n,i)=>{e[i]=n.toJSON()}),e}destroy(){this.isDestroyed=!0,il(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new kr({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,wt(e.parent.doc,i=>{const r=n.doc;e.deleted||i.subdocsAdded.add(r),i.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class h_{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Ye(this.restDecoder)}readDsLen(){return Ye(this.restDecoder)}}class p_ extends h_{readLeftID(){return Ie(Ye(this.restDecoder),Ye(this.restDecoder))}readRightID(){return Ie(Ye(this.restDecoder),Ye(this.restDecoder))}readClient(){return Ye(this.restDecoder)}readInfo(){return Ta(this.restDecoder)}readString(){return fa(this.restDecoder)}readParentInfo(){return Ye(this.restDecoder)===1}readTypeRef(){return Ye(this.restDecoder)}readLen(){return Ye(this.restDecoder)}readAny(){return Du(this.restDecoder)}readBuf(){return Aj(yi(this.restDecoder))}readJSON(){return JSON.parse(fa(this.restDecoder))}readKey(){return fa(this.restDecoder)}}class k5{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Ye(this.restDecoder),this.dsCurrVal}readDsLen(){const e=Ye(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Oa extends k5{constructor(e){super(e),this.keys=[],Ye(e),this.keyClockDecoder=new s0(yi(e)),this.clientDecoder=new ah(yi(e)),this.leftClockDecoder=new s0(yi(e)),this.rightClockDecoder=new s0(yi(e)),this.infoDecoder=new kE(yi(e),Ta),this.stringDecoder=new tj(yi(e)),this.parentInfoDecoder=new kE(yi(e),Ta),this.typeRefDecoder=new ah(yi(e)),this.lenDecoder=new ah(yi(e))}readLeftID(){return new ha(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new ha(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Du(this.restDecoder)}readBuf(){return yi(this.restDecoder)}readJSON(){return Du(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const n=this.stringDecoder.read();return this.keys.push(n),n}}}class m_{constructor(){this.restEncoder=rf()}toUint8Array(){return Wi(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){et(this.restEncoder,e)}writeDsLen(e){et(this.restEncoder,e)}}class lf extends m_{writeLeftID(e){et(this.restEncoder,e.client),et(this.restEncoder,e.clock)}writeRightID(e){et(this.restEncoder,e.client),et(this.restEncoder,e.clock)}writeClient(e){et(this.restEncoder,e)}writeInfo(e){hb(this.restEncoder,e)}writeString(e){ua(this.restEncoder,e)}writeParentInfo(e){et(this.restEncoder,e?1:0)}writeTypeRef(e){et(this.restEncoder,e)}writeLen(e){et(this.restEncoder,e)}writeAny(e){Ea(this.restEncoder,e)}writeBuf(e){gi(this.restEncoder,e)}writeJSON(e){ua(this.restEncoder,JSON.stringify(e))}writeKey(e){ua(this.restEncoder,e)}}class g_{constructor(){this.restEncoder=rf(),this.dsCurrVal=0}toUint8Array(){return Wi(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,et(this.restEncoder,n)}writeDsLen(e){e===0&&Dn(),et(this.restEncoder,e-1),this.dsCurrVal+=e}}class eo extends g_{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new r0,this.clientEncoder=new oh,this.leftClockEncoder=new r0,this.rightClockEncoder=new r0,this.infoEncoder=new SE(hb),this.stringEncoder=new YB,this.parentInfoEncoder=new SE(hb),this.typeRefEncoder=new oh,this.lenEncoder=new oh}toUint8Array(){const e=rf();return et(e,0),gi(e,this.keyClockEncoder.toUint8Array()),gi(e,this.clientEncoder.toUint8Array()),gi(e,this.leftClockEncoder.toUint8Array()),gi(e,this.rightClockEncoder.toUint8Array()),gi(e,Wi(this.infoEncoder)),gi(e,this.stringEncoder.toUint8Array()),gi(e,Wi(this.parentInfoEncoder)),gi(e,this.typeRefEncoder.toUint8Array()),gi(e,this.lenEncoder.toUint8Array()),Jp(e,Wi(this.restEncoder)),Wi(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Ea(this.restEncoder,e)}writeBuf(e){gi(this.restEncoder,e)}writeJSON(e){Ea(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const C5=(t,e,n,i)=>{i=er(i,e[0].id.clock);const r=tr(e,i);et(t.restEncoder,e.length-r),t.writeClient(n),et(t.restEncoder,i);const s=e[r];s.write(t,i-s.id.clock);for(let o=r+1;o<e.length;o++)e[o].write(t,0)},nx=(t,e,n)=>{const i=new Map;n.forEach((r,s)=>{$t(e,s)>r&&i.set(s,r)}),of(e).forEach((r,s)=>{n.has(s)||i.set(s,0)}),et(t.restEncoder,i.size),il(i.entries()).sort((r,s)=>s[0]-r[0]).forEach(([r,s])=>{C5(t,e.clients.get(r),r,s)})},E5=(t,e)=>{const n=Vi(),i=Ye(t.restDecoder);for(let r=0;r<i;r++){const s=Ye(t.restDecoder),o=new Array(s),c=t.readClient();let f=Ye(t.restDecoder);n.set(c,{i:0,refs:o});for(let d=0;d<s;d++){const p=t.readInfo();switch(Zp&p){case 0:{const m=t.readLen();o[d]=new Bi(Ie(c,f),m),f+=m;break}case 10:{const m=Ye(t.restDecoder);o[d]=new ji(Ie(c,f),m),f+=m;break}default:{const m=(p&(is|Un))===0,y=new pt(Ie(c,f),null,(p&Un)===Un?t.readLeftID():null,null,(p&is)===is?t.readRightID():null,m?t.readParentInfo()?e.get(t.readString()):t.readLeftID():null,m&&(p&Ou)===Ou?t.readString():null,q_(t,p));o[d]=y,f+=y.length}}}}return n},T5=(t,e,n)=>{const i=[];let r=il(n.keys()).sort((b,S)=>b-S);if(r.length===0)return null;const s=()=>{if(r.length===0)return null;let b=n.get(r[r.length-1]);for(;b.refs.length===b.i;)if(r.pop(),r.length>0)b=n.get(r[r.length-1]);else return null;return b};let o=s();if(o===null)return null;const c=new w_,f=new Map,d=(b,S)=>{const v=f.get(b);(v==null||v>S)&&f.set(b,S)};let p=o.refs[o.i++];const m=new Map,y=()=>{for(const b of i){const S=b.id.client,v=n.get(S);v?(v.i--,c.clients.set(S,v.refs.slice(v.i)),n.delete(S),v.i=0,v.refs=[]):c.clients.set(S,[b]),r=r.filter(k=>k!==S)}i.length=0};for(;;){if(p.constructor!==ji){const S=Er(m,p.id.client,()=>$t(e,p.id.client))-p.id.clock;if(S<0)i.push(p),d(p.id.client,p.id.clock-1),y();else{const v=p.getMissing(t,e);if(v!==null){i.push(p);const k=n.get(v)||{refs:[],i:0};if(k.refs.length===k.i)d(v,$t(e,v)),y();else{p=k.refs[k.i++];continue}}else(S===0||S<p.length)&&(p.integrate(t,S),m.set(p.id.client,p.id.clock+p.length))}}if(i.length>0)p=i.pop();else if(o!==null&&o.i<o.refs.length)p=o.refs[o.i++];else{if(o=s(),o===null)break;p=o.refs[o.i++]}}if(c.clients.size>0){const b=new eo;return nx(b,c,new Map),et(b.restEncoder,0),{missing:f,update:b.toUint8Array()}}return null},A5=(t,e)=>nx(t,e.doc.store,e.beforeState),M5=(t,e,n,i=new Oa(t))=>wt(e,r=>{r.local=!1;let s=!1;const o=r.doc,c=o.store,f=E5(i,o),d=T5(r,c,f),p=c.pendingStructs;if(p){for(const[y,b]of p.missing)if(b<$t(c,y)){s=!0;break}if(d){for(const[y,b]of d.missing){const S=p.missing.get(y);(S==null||S>b)&&p.missing.set(y,b)}p.update=Uh([p.update,d.update])}}else c.pendingStructs=d;const m=ME(i,r,c);if(c.pendingDs){const y=new Oa(ja(c.pendingDs));Ye(y.restDecoder);const b=ME(y,r,c);m&&b?c.pendingDs=Uh([m,b]):c.pendingDs=m||b}else c.pendingDs=m;if(s){const y=c.pendingStructs.update;c.pendingStructs=null,jh(r.doc,y)}},n,!1),jh=(t,e,n,i=Oa)=>{const r=ja(e);M5(r,t,n,new i(r))},O5=(t,e,n)=>jh(t,e,n,p_),_5=(t,e,n=new Map)=>{nx(t,e.store,n),$a(t,f_(e.store))},D5=(t,e=new Uint8Array([0]),n=new eo)=>{const i=y_(e);_5(n,t,i);const r=[n.toUint8Array()];if(t.store.pendingDs&&r.push(t.store.pendingDs),t.store.pendingStructs&&r.push(J5(t.store.pendingStructs.update,e)),r.length>1){if(n.constructor===lf)return G5(r.map((s,o)=>o===0?s:W5(s)));if(n.constructor===eo)return Uh(r)}return r[0]},N5=(t,e)=>D5(t,e,new lf),R5=t=>{const e=new Map,n=Ye(t.restDecoder);for(let i=0;i<n;i++){const r=Ye(t.restDecoder),s=Ye(t.restDecoder);e.set(r,s)}return e},y_=t=>R5(new h_(ja(t))),b_=(t,e)=>(et(t.restEncoder,e.size),il(e.entries()).sort((n,i)=>i[0]-n[0]).forEach(([n,i])=>{et(t.restEncoder,n),et(t.restEncoder,i)}),t),z5=(t,e)=>b_(t,of(e.store)),L5=(t,e=new g_)=>(t instanceof Map?b_(e,t):z5(e,t),e.toUint8Array()),I5=t=>L5(t,new m_);class B5{constructor(){this.l=[]}}const OE=()=>new B5,_E=(t,e)=>t.l.push(e),DE=(t,e)=>{const n=t.l,i=n.length;t.l=n.filter(r=>e!==r),i===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},x_=(t,e,n)=>K1(t.l,[e,n]);class ha{constructor(e,n){this.client=e,this.clock=n}}const la=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Ie=(t,e)=>new ha(t,e),Lu=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw Dn()},Iu=(t,e)=>{for(;e!==null;){if(e.parent===t)return!0;e=e.parent._item}return!1};class Bu{constructor(e,n,i,r=0){this.type=e,this.tname=n,this.item=i,this.assoc=r}}const Yl=t=>new Bu(t.type==null?null:Ie(t.type.client,t.type.clock),t.tname??null,t.item==null?null:Ie(t.item.client,t.item.clock),t.assoc==null?0:t.assoc);class j5{constructor(e,n,i=0){this.type=e,this.index=n,this.assoc=i}}const U5=(t,e,n=0)=>new j5(t,e,n),Bd=(t,e,n)=>{let i=null,r=null;return t._item===null?r=Lu(t):i=Ie(t._item.id.client,t._item.id.clock),new Bu(i,r,e,n)},c0=(t,e,n=0)=>{let i=t._start;if(n<0){if(e===0)return Bd(t,null,n);e--}for(;i!==null;){if(!i.deleted&&i.countable){if(i.length>e)return Bd(t,Ie(i.id.client,i.id.clock+e),n);e-=i.length}if(i.right===null&&n<0)return Bd(t,i.lastId,n);i=i.right}return Bd(t,null,n)},H5=(t,e)=>{const n=pa(t,e),i=e.clock-n.id.clock;return{item:n,diff:i}},bb=(t,e,n=!0)=>{const i=e.store,r=t.item,s=t.type,o=t.tname,c=t.assoc;let f=null,d=0;if(r!==null){if($t(i,r.client)<=r.clock)return null;const p=n?vb(i,r):H5(i,r),m=p.item;if(!(m instanceof pt))return null;if(f=m.parent,f._item===null||!f._item.deleted){d=m.deleted||!m.countable?0:p.diff+(c>=0?0:1);let y=m.left;for(;y!==null;)!y.deleted&&y.countable&&(d+=y.length),y=y.left}}else{if(o!==null)f=e.get(o);else if(s!==null){if($t(i,s.client)<=s.clock)return null;const{item:p}=n?vb(i,s):{item:pa(i,s)};if(p instanceof pt&&p.content instanceof ir)f=p.content.type;else return null}else throw Dn();c>=0?d=f._length:d=0}return U5(f,d,t.assoc)},NE=(t,e)=>t===e||t!==null&&e!==null&&t.tname===e.tname&&la(t.item,e.item)&&la(t.type,e.type)&&t.assoc===e.assoc;class ix{constructor(e,n){this.ds=e,this.sv=n}}const S_=(t,e)=>new ix(t,e),u0=t=>S_(f_(t.store),of(t.store)),zl=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!Pa(e.ds,t.id),xb=(t,e)=>{const n=Er(t.meta,xb,Ql),i=t.doc.store;n.has(e)||(e.sv.forEach((r,s)=>{r<$t(i,s)&&ti(t,Ie(s,r))}),rl(t,e.ds,r=>{}),n.add(e))};class w_{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const of=t=>{const e=new Map;return t.clients.forEach((n,i)=>{const r=n[n.length-1];e.set(i,r.id.clock+r.length)}),e},$t=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const i=n[n.length-1];return i.id.clock+i.length},v_=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const i=n[n.length-1];if(i.id.clock+i.length!==e.id.clock)throw Dn()}n.push(e)},tr=(t,e)=>{let n=0,i=t.length-1,r=t[i],s=r.id.clock;if(s===e)return i;let o=Qi(e/(s+r.length-1)*i);for(;n<=i;){if(r=t[o],s=r.id.clock,s<=e){if(e<s+r.length)return o;n=o+1}else i=o-1;o=Qi((n+i)/2)}throw Dn()},V5=(t,e)=>{const n=t.clients.get(e.client);return n[tr(n,e.clock)]},pa=V5,Sb=(t,e,n)=>{const i=tr(e,n),r=e[i];return r.id.clock<n&&r instanceof pt?(e.splice(i+1,0,Fh(t,r,n-r.id.clock)),i+1):i},ti=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[Sb(t,n,e.clock)]},RE=(t,e,n)=>{const i=e.clients.get(n.client),r=tr(i,n.clock),s=i[r];return n.clock!==s.id.clock+s.length-1&&s.constructor!==Bi&&i.splice(r+1,0,Fh(t,s,n.clock-s.id.clock+1)),s},P5=(t,e,n)=>{const i=t.clients.get(e.id.client);i[tr(i,e.id.clock)]=n},k_=(t,e,n,i,r)=>{if(i===0)return;const s=n+i;let o=Sb(t,e,n),c;do c=e[o++],s<c.id.clock+c.length&&Sb(t,e,s),r(c);while(o<e.length&&e[o].id.clock<s)};class $5{constructor(e,n,i){this.doc=e,this.deleteSet=new Va,this.beforeState=of(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=i,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const zE=(t,e)=>e.deleteSet.clients.size===0&&!vB(e.afterState,(n,i)=>e.beforeState.get(i)!==n)?!1:(ex(e.deleteSet),A5(t,e),$a(t,e.deleteSet),!0),LE=(t,e,n)=>{const i=e._item;(i===null||i.id.clock<(t.beforeState.get(i.id.client)||0)&&!i.deleted)&&Er(t.changed,e,Ql).add(n)},uh=(t,e)=>{let n=t[e],i=t[e-1],r=e;for(;r>0;n=i,i=t[--r-1]){if(i.deleted===n.deleted&&i.constructor===n.constructor&&i.mergeWith(n)){n instanceof pt&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,i);continue}break}const s=e-r;return s&&t.splice(e+1-s,s),s},F5=(t,e,n)=>{for(const[i,r]of t.clients.entries()){const s=e.clients.get(i);for(let o=r.length-1;o>=0;o--){const c=r[o],f=c.clock+c.len;for(let d=tr(s,c.clock),p=s[d];d<s.length&&p.id.clock<f;p=s[++d]){const m=s[d];if(c.clock+c.len<=m.id.clock)break;m instanceof pt&&m.deleted&&!m.keep&&n(m)&&m.gc(e,!1)}}}},q5=(t,e)=>{t.clients.forEach((n,i)=>{const r=e.clients.get(i);for(let s=n.length-1;s>=0;s--){const o=n[s],c=ns(r.length-1,1+tr(r,o.clock+o.len-1));for(let f=c,d=r[f];f>0&&d.id.clock>=o.clock;d=r[f])f-=1+uh(r,f)}})},C_=(t,e)=>{if(e<t.length){const n=t[e],i=n.doc,r=i.store,s=n.deleteSet,o=n._mergeStructs;try{ex(s),n.afterState=of(n.doc.store),i.emit("beforeObserverCalls",[n,i]);const c=[];n.changed.forEach((f,d)=>c.push(()=>{(d._item===null||!d._item.deleted)&&d._callObserver(n,f)})),c.push(()=>{n.changedParentTypes.forEach((f,d)=>{d._dEH.l.length>0&&(d._item===null||!d._item.deleted)&&(f=f.filter(p=>p.target._item===null||!p.target._item.deleted),f.forEach(p=>{p.currentTarget=d,p._path=null}),f.sort((p,m)=>p.path.length-m.path.length),c.push(()=>{x_(d._dEH,f,n)}))}),c.push(()=>i.emit("afterTransaction",[n,i])),c.push(()=>{n._needFormattingCleanup&&d8(n)})}),K1(c,[])}finally{i.gc&&F5(s,r,i.gcFilter),q5(s,r),n.afterState.forEach((p,m)=>{const y=n.beforeState.get(m)||0;if(y!==p){const b=r.clients.get(m),S=er(tr(b,y),1);for(let v=b.length-1;v>=S;)v-=1+uh(b,v)}});for(let p=o.length-1;p>=0;p--){const{client:m,clock:y}=o[p].id,b=r.clients.get(m),S=tr(b,y);S+1<b.length&&uh(b,S+1)>1||S>0&&uh(b,S)}if(!n.local&&n.afterState.get(i.clientID)!==n.beforeState.get(i.clientID)&&(S5(Q1,i_,"[yjs] ",r_,s_,"Changed the client-id because another client seems to be using it."),i.clientID=d_()),i.emit("afterTransactionCleanup",[n,i]),i._observers.has("update")){const p=new lf;zE(p,n)&&i.emit("update",[p.toUint8Array(),n.origin,i,n])}if(i._observers.has("updateV2")){const p=new eo;zE(p,n)&&i.emit("updateV2",[p.toUint8Array(),n.origin,i,n])}const{subdocsAdded:c,subdocsLoaded:f,subdocsRemoved:d}=n;(c.size>0||d.size>0||f.size>0)&&(c.forEach(p=>{p.clientID=i.clientID,p.collectionid==null&&(p.collectionid=i.collectionid),i.subdocs.add(p)}),d.forEach(p=>i.subdocs.delete(p)),i.emit("subdocs",[{loaded:f,added:c,removed:d},i,n]),d.forEach(p=>p.destroy())),t.length<=e+1?(i._transactionCleanups=[],i.emit("afterAllTransactions",[i,t])):C_(t,e+1)}}},wt=(t,e,n=null,i=!0)=>{const r=t._transactionCleanups;let s=!1,o=null;t._transaction===null&&(s=!0,t._transaction=new $5(t,n,i),r.push(t._transaction),r.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{o=e(t._transaction)}finally{if(s){const c=t._transaction===r[0];t._transaction=null,c&&C_(r,0)}}return o};class Y5{constructor(e,n){this.insertions=n,this.deletions=e,this.meta=new Map}}const IE=(t,e,n)=>{rl(t,n.deletions,i=>{i instanceof pt&&e.scope.some(r=>r===t.doc||Iu(r,i))&&fx(i,!1)})},BE=(t,e,n)=>{let i=null;const r=t.doc,s=t.scope;wt(r,c=>{for(;e.length>0&&t.currStackItem===null;){const f=r.store,d=e.pop(),p=new Set,m=[];let y=!1;rl(c,d.insertions,b=>{if(b instanceof pt){if(b.redone!==null){let{item:S,diff:v}=vb(f,b.id);v>0&&(S=ti(c,Ie(S.id.client,S.id.clock+v))),b=S}!b.deleted&&s.some(S=>S===c.doc||Iu(S,b))&&m.push(b)}}),rl(c,d.deletions,b=>{b instanceof pt&&s.some(S=>S===c.doc||Iu(S,b))&&!Pa(d.insertions,b.id)&&p.add(b)}),p.forEach(b=>{y=F_(c,b,p,d.insertions,t.ignoreRemoteMapChanges,t)!==null||y});for(let b=m.length-1;b>=0;b--){const S=m[b];t.deleteFilter(S)&&(S.delete(c),y=!0)}t.currStackItem=y?d:null}c.changed.forEach((f,d)=>{f.has(null)&&d._searchMarker&&(d._searchMarker.length=0)}),i=c},t);const o=t.currStackItem;if(o!=null){const c=i.changedParentTypes;t.emit("stack-item-popped",[{stackItem:o,type:n,changedParentTypes:c,origin:t},t]),t.currStackItem=null}return o};class E_ extends MO{constructor(e,{captureTimeout:n=500,captureTransaction:i=f=>!0,deleteFilter:r=()=>!0,trackedOrigins:s=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:c=Ca(e)?e[0].doc:e instanceof kr?e:e.doc}={}){super(),this.scope=[],this.doc=c,this.addToScope(e),this.deleteFilter=r,s.add(this),this.trackedOrigins=s,this.captureTransaction=i,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=n,this.afterTransactionHandler=f=>{if(!this.captureTransaction(f)||!this.scope.some(k=>f.changedParentTypes.has(k)||k===this.doc)||!this.trackedOrigins.has(f.origin)&&(!f.origin||!this.trackedOrigins.has(f.origin.constructor)))return;const d=this.undoing,p=this.redoing,m=d?this.redoStack:this.undoStack;d?this.stopCapturing():p||this.clear(!1,!0);const y=new Va;f.afterState.forEach((k,E)=>{const j=f.beforeState.get(E)||0,L=k-j;L>0&&zu(y,E,j,L)});const b=oj();let S=!1;if(this.lastChange>0&&b-this.lastChange<this.captureTimeout&&m.length>0&&!d&&!p){const k=m[m.length-1];k.deletions=yb([k.deletions,f.deleteSet]),k.insertions=yb([k.insertions,y])}else m.push(new Y5(f.deleteSet,y)),S=!0;!d&&!p&&(this.lastChange=b),rl(f,f.deleteSet,k=>{k instanceof pt&&this.scope.some(E=>E===f.doc||Iu(E,k))&&fx(k,!0)});const v=[{stackItem:m[m.length-1],origin:f.origin,type:d?"redo":"undo",changedParentTypes:f.changedParentTypes},this];S?this.emit("stack-item-added",v):this.emit("stack-item-updated",v)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){const n=new Set(this.scope);e=Ca(e)?e:[e],e.forEach(i=>{n.has(i)||(n.add(i),(i instanceof fn?i.doc!==this.doc:i!==this.doc)&&o_("[yjs#509] Not same Y.Doc"),this.scope.push(i))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,n=!0){(e&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(i=>{e&&(this.undoStack.forEach(r=>IE(i,this,r)),this.undoStack=[]),n&&(this.redoStack.forEach(r=>IE(i,this,r)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=BE(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=BE(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*K5(t){const e=Ye(t.restDecoder);for(let n=0;n<e;n++){const i=Ye(t.restDecoder),r=t.readClient();let s=Ye(t.restDecoder);for(let o=0;o<i;o++){const c=t.readInfo();if(c===10){const f=Ye(t.restDecoder);yield new ji(Ie(r,s),f),s+=f}else if((Zp&c)!==0){const f=(c&(is|Un))===0,d=new pt(Ie(r,s),null,(c&Un)===Un?t.readLeftID():null,null,(c&is)===is?t.readRightID():null,f?t.readParentInfo()?t.readString():t.readLeftID():null,f&&(c&Ou)===Ou?t.readString():null,q_(t,c));yield d,s+=d.length}else{const f=t.readLen();yield new Bi(Ie(r,s),f),s+=f}}}}class rx{constructor(e,n){this.gen=K5(e),this.curr=null,this.done=!1,this.filterSkips=n,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===ji);return this.curr}}class sx{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const G5=t=>Uh(t,p_,lf),Z5=(t,e)=>{if(t.constructor===Bi){const{client:n,clock:i}=t.id;return new Bi(Ie(n,i+e),t.length-e)}else if(t.constructor===ji){const{client:n,clock:i}=t.id;return new ji(Ie(n,i+e),t.length-e)}else{const n=t,{client:i,clock:r}=n.id;return new pt(Ie(i,r+e),null,Ie(i,r+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},Uh=(t,e=Oa,n=eo)=>{if(t.length===1)return t[0];const i=t.map(p=>new e(ja(p)));let r=i.map(p=>new rx(p,!0)),s=null;const o=new n,c=new sx(o);for(;r=r.filter(y=>y.curr!==null),r.sort((y,b)=>{if(y.curr.id.client===b.curr.id.client){const S=y.curr.id.clock-b.curr.id.clock;return S===0?y.curr.constructor===b.curr.constructor?0:y.curr.constructor===ji?1:-1:S}else return b.curr.id.client-y.curr.id.client}),r.length!==0;){const p=r[0],m=p.curr.id.client;if(s!==null){let y=p.curr,b=!1;for(;y!==null&&y.id.clock+y.length<=s.struct.id.clock+s.struct.length&&y.id.client>=s.struct.id.client;)y=p.next(),b=!0;if(y===null||y.id.client!==m||b&&y.id.clock>s.struct.id.clock+s.struct.length)continue;if(m!==s.struct.id.client)$s(c,s.struct,s.offset),s={struct:y,offset:0},p.next();else if(s.struct.id.clock+s.struct.length<y.id.clock)if(s.struct.constructor===ji)s.struct.length=y.id.clock+y.length-s.struct.id.clock;else{$s(c,s.struct,s.offset);const S=y.id.clock-s.struct.id.clock-s.struct.length;s={struct:new ji(Ie(m,s.struct.id.clock+s.struct.length),S),offset:0}}else{const S=s.struct.id.clock+s.struct.length-y.id.clock;S>0&&(s.struct.constructor===ji?s.struct.length-=S:y=Z5(y,S)),s.struct.mergeWith(y)||($s(c,s.struct,s.offset),s={struct:y,offset:0},p.next())}}else s={struct:p.curr,offset:0},p.next();for(let y=p.curr;y!==null&&y.id.client===m&&y.id.clock===s.struct.id.clock+s.struct.length&&y.constructor!==ji;y=p.next())$s(c,s.struct,s.offset),s={struct:y,offset:0}}s!==null&&($s(c,s.struct,s.offset),s=null),lx(c);const f=i.map(p=>tx(p)),d=yb(f);return $a(o,d),o.toUint8Array()},J5=(t,e,n=Oa,i=eo)=>{const r=y_(e),s=new i,o=new sx(s),c=new n(ja(t)),f=new rx(c,!1);for(;f.curr;){const p=f.curr,m=p.id.client,y=r.get(m)||0;if(f.curr.constructor===ji){f.next();continue}if(p.id.clock+p.length>y)for($s(o,p,er(y-p.id.clock,0)),f.next();f.curr&&f.curr.id.client===m;)$s(o,f.curr,0),f.next();else for(;f.curr&&f.curr.id.client===m&&f.curr.id.clock+f.curr.length<=y;)f.next()}lx(o);const d=tx(c);return $a(s,d),s.toUint8Array()},T_=t=>{t.written>0&&(t.clientStructs.push({written:t.written,restEncoder:Wi(t.encoder.restEncoder)}),t.encoder.restEncoder=rf(),t.written=0)},$s=(t,e,n)=>{t.written>0&&t.currClient!==e.id.client&&T_(t),t.written===0&&(t.currClient=e.id.client,t.encoder.writeClient(e.id.client),et(t.encoder.restEncoder,e.id.clock+n)),e.write(t.encoder,n),t.written++},lx=t=>{T_(t);const e=t.encoder.restEncoder;et(e,t.clientStructs.length);for(let n=0;n<t.clientStructs.length;n++){const i=t.clientStructs[n];et(e,i.written),Jp(e,i.restEncoder)}},X5=(t,e,n,i)=>{const r=new n(ja(t)),s=new rx(r,!1),o=new i,c=new sx(o);for(let d=s.curr;d!==null;d=s.next())$s(c,e(d),0);lx(c);const f=tx(r);return $a(o,f),o.toUint8Array()},W5=t=>X5(t,yj,Oa,lf),jE="You must not compute changes after the event-handler fired.";class rm{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=Q5(this.currentTarget,this.target))}deletes(e){return Pa(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw vr(jE);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(r=>{if(r!==null){const s=n._map.get(r);let o,c;if(this.adds(s)){let f=s.left;for(;f!==null&&this.adds(f);)f=f.left;if(this.deletes(s))if(f!==null&&this.deletes(f))o="delete",c=t0(f.content.getContent());else return;else f!==null&&this.deletes(f)?(o="update",c=t0(f.content.getContent())):(o="add",c=void 0)}else if(this.deletes(s))o="delete",c=t0(s.content.getContent());else return;e.set(r,{action:o,oldValue:c})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw vr(jE);const n=this.target,i=Ql(),r=Ql(),s=[];if(e={added:i,deleted:r,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let c=null;const f=()=>{c&&s.push(c)};for(let d=n._start;d!==null;d=d.right)d.deleted?this.deletes(d)&&!this.adds(d)&&((c===null||c.delete===void 0)&&(f(),c={delete:0}),c.delete+=d.length,r.add(d)):this.adds(d)?((c===null||c.insert===void 0)&&(f(),c={insert:[]}),c.insert=c.insert.concat(d.content.getContent()),i.add(d)):((c===null||c.retain===void 0)&&(f(),c={retain:0}),c.retain+=d.length);c!==null&&c.retain===void 0&&f()}this._changes=e}return e}}const Q5=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let i=0,r=e._item.parent._start;for(;r!==e._item&&r!==null;)!r.deleted&&r.countable&&(i+=r.length),r=r.right;n.unshift(i)}e=e._item.parent}return n},Mn=()=>{o_("Invalid access: Add Yjs type to a document before reading data.")},A_=80;let ox=0;class e8{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=ox++}}const t8=t=>{t.timestamp=ox++},M_=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=ox++},n8=(t,e,n)=>{if(t.length>=A_){const i=t.reduce((r,s)=>r.timestamp<s.timestamp?r:s);return M_(i,e,n),i}else{const i=new e8(e,n);return t.push(i),i}},sm=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((s,o)=>lh(e-s.index)<lh(e-o.index)?s:o);let i=t._start,r=0;for(n!==null&&(i=n.p,r=n.index,t8(n));i.right!==null&&r<e;){if(!i.deleted&&i.countable){if(e<r+i.length)break;r+=i.length}i=i.right}for(;i.left!==null&&r>e;)i=i.left,!i.deleted&&i.countable&&(r-=i.length);for(;i.left!==null&&i.left.id.client===i.id.client&&i.left.id.clock+i.left.length===i.id.clock;)i=i.left,!i.deleted&&i.countable&&(r-=i.length);return n!==null&&lh(n.index-r)<i.parent.length/A_?(M_(n,i,r),n):n8(t._searchMarker,i,r)},ju=(t,e,n)=>{for(let i=t.length-1;i>=0;i--){const r=t[i];if(n>0){let s=r.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(r.index-=s.length);if(s===null||s.marker===!0){t.splice(i,1);continue}r.p=s,s.marker=!0}(e<r.index||n>0&&e===r.index)&&(r.index=er(e,r.index+n))}},lm=(t,e,n)=>{const i=t,r=e.changedParentTypes;for(;Er(r,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;x_(i._eH,n,e)};class fn{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=OE(),this._dEH=OE(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw Pi()}clone(){throw Pi()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){_E(this._eH,e)}observeDeep(e){_E(this._dEH,e)}unobserve(e){DE(this._eH,e)}unobserveDeep(e){DE(this._dEH,e)}toJSON(){}}const O_=(t,e,n)=>{t.doc??Mn(),e<0&&(e=t._length+e),n<0&&(n=t._length+n);let i=n-e;const r=[];let s=t._start;for(;s!==null&&i>0;){if(s.countable&&!s.deleted){const o=s.content.getContent();if(o.length<=e)e-=o.length;else{for(let c=e;c<o.length&&i>0;c++)r.push(o[c]),i--;e=0}}s=s.right}return r},__=t=>{t.doc??Mn();const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const i=n.content.getContent();for(let r=0;r<i.length;r++)e.push(i[r])}n=n.right}return e},D_=(t,e)=>{const n=[];let i=t._start;for(;i!==null;){if(i.countable&&zl(i,e)){const r=i.content.getContent();for(let s=0;s<r.length;s++)n.push(r[s])}i=i.right}return n},Uu=(t,e)=>{let n=0,i=t._start;for(t.doc??Mn();i!==null;){if(i.countable&&!i.deleted){const r=i.content.getContent();for(let s=0;s<r.length;s++)e(r[s],n++,t)}i=i.right}},N_=(t,e)=>{const n=[];return Uu(t,(i,r)=>{n.push(e(i,r,t))}),n},i8=t=>{let e=t._start,n=null,i=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),i=0,e=e.right}const r=n[i++];return n.length<=i&&(n=null),{done:!1,value:r}}}},R_=(t,e)=>{t.doc??Mn();const n=sm(t,e);let i=t._start;for(n!==null&&(i=n.p,e-=n.index);i!==null;i=i.right)if(!i.deleted&&i.countable){if(e<i.length)return i.content.getContent()[e];e-=i.length}},Hh=(t,e,n,i)=>{let r=n;const s=t.doc,o=s.clientID,c=s.store,f=n===null?e._start:n.right;let d=[];const p=()=>{d.length>0&&(r=new pt(Ie(o,$t(c,o)),r,r&&r.lastId,f,f&&f.id,e,null,new no(d)),r.integrate(t,0),d=[])};i.forEach(m=>{if(m===null)d.push(m);else switch(m.constructor){case Number:case Object:case Boolean:case Array:case String:d.push(m);break;default:switch(p(),m.constructor){case Uint8Array:case ArrayBuffer:r=new pt(Ie(o,$t(c,o)),r,r&&r.lastId,f,f&&f.id,e,null,new af(new Uint8Array(m))),r.integrate(t,0);break;case kr:r=new pt(Ie(o,$t(c,o)),r,r&&r.lastId,f,f&&f.id,e,null,new cf(m)),r.integrate(t,0);break;default:if(m instanceof fn)r=new pt(Ie(o,$t(c,o)),r,r&&r.lastId,f,f&&f.id,e,null,new ir(m)),r.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),p()},z_=()=>vr("Length exceeded!"),L_=(t,e,n,i)=>{if(n>e._length)throw z_();if(n===0)return e._searchMarker&&ju(e._searchMarker,n,i.length),Hh(t,e,null,i);const r=n,s=sm(e,n);let o=e._start;for(s!==null&&(o=s.p,n-=s.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&ti(t,Ie(o.id.client,o.id.clock+n));break}n-=o.length}return e._searchMarker&&ju(e._searchMarker,r,i.length),Hh(t,e,o,i)},r8=(t,e,n)=>{let r=(e._searchMarker||[]).reduce((s,o)=>o.index>s.index?o:s,{index:0,p:e._start}).p;if(r)for(;r.right;)r=r.right;return Hh(t,e,r,n)},I_=(t,e,n,i)=>{if(i===0)return;const r=n,s=i,o=sm(e,n);let c=e._start;for(o!==null&&(c=o.p,n-=o.index);c!==null&&n>0;c=c.right)!c.deleted&&c.countable&&(n<c.length&&ti(t,Ie(c.id.client,c.id.clock+n)),n-=c.length);for(;i>0&&c!==null;)c.deleted||(i<c.length&&ti(t,Ie(c.id.client,c.id.clock+i)),c.delete(t),i-=c.length),c=c.right;if(i>0)throw z_();e._searchMarker&&ju(e._searchMarker,r,-s+i)},Vh=(t,e,n)=>{const i=e._map.get(n);i!==void 0&&i.delete(t)},ax=(t,e,n,i)=>{const r=e._map.get(n)||null,s=t.doc,o=s.clientID;let c;if(i==null)c=new no([i]);else switch(i.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:c=new no([i]);break;case Uint8Array:c=new af(i);break;case kr:c=new cf(i);break;default:if(i instanceof fn)c=new ir(i);else throw new Error("Unexpected content type")}new pt(Ie(o,$t(s.store,o)),r,r&&r.lastId,null,null,e,n,c).integrate(t,0)},cx=(t,e)=>{t.doc??Mn();const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},B_=t=>{const e={};return t.doc??Mn(),t._map.forEach((n,i)=>{n.deleted||(e[i]=n.content.getContent()[n.length-1])}),e},j_=(t,e)=>{t.doc??Mn();const n=t._map.get(e);return n!==void 0&&!n.deleted},s8=(t,e)=>{const n={};return t._map.forEach((i,r)=>{let s=i;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&zl(s,e)&&(n[r]=s.content.getContent()[s.length-1])}),n},jd=t=>(t.doc??Mn(),w5(t._map.entries(),e=>!e[1].deleted));class l8 extends rm{}class ma extends fn{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new ma;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new ma}clone(){const e=new ma;return e.insert(0,this.toArray().map(n=>n instanceof fn?n.clone():n)),e}get length(){return this.doc??Mn(),this._length}_callObserver(e,n){super._callObserver(e,n),lm(this,e,new l8(this,e))}insert(e,n){this.doc!==null?wt(this.doc,i=>{L_(i,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?wt(this.doc,n=>{r8(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?wt(this.doc,i=>{I_(i,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return R_(this,e)}toArray(){return __(this)}slice(e=0,n=this.length){return O_(this,e,n)}toJSON(){return this.map(e=>e instanceof fn?e.toJSON():e)}map(e){return N_(this,e)}forEach(e){Uu(this,e)}[Symbol.iterator](){return i8(this)}_write(e){e.writeTypeRef(D8)}}const o8=t=>new ma;class a8 extends rm{constructor(e,n,i){super(e,n),this.keysChanged=i}}class _a extends fn{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((i,r)=>{this.set(r,i)}),this._prelimContent=null}_copy(){return new _a}clone(){const e=new _a;return this.forEach((n,i)=>{e.set(i,n instanceof fn?n.clone():n)}),e}_callObserver(e,n){lm(this,e,new a8(this,e,n))}toJSON(){this.doc??Mn();const e={};return this._map.forEach((n,i)=>{if(!n.deleted){const r=n.content.getContent()[n.length-1];e[i]=r instanceof fn?r.toJSON():r}}),e}get size(){return[...jd(this)].length}keys(){return a0(jd(this),e=>e[0])}values(){return a0(jd(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return a0(jd(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Mn(),this._map.forEach((n,i)=>{n.deleted||e(n.content.getContent()[n.length-1],i,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?wt(this.doc,n=>{Vh(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?wt(this.doc,i=>{ax(i,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return cx(this,e)}has(e){return j_(this,e)}clear(){this.doc!==null?wt(this.doc,e=>{this.forEach(function(n,i,r){Vh(e,r,i)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(N8)}}const c8=t=>new _a,Zs=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&mj(t,e);class wb{constructor(e,n,i,r){this.left=e,this.right=n,this.index=i,this.currentAttributes=r}forward(){switch(this.right===null&&Dn(),this.right.content.constructor){case Wt:this.right.deleted||Fa(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const UE=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case Wt:e.right.deleted||Fa(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n<e.right.length&&ti(t,Ie(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},Ud=(t,e,n,i)=>{const r=new Map,s=i?sm(e,n):null;if(s){const o=new wb(s.p.left,s.p,s.index,r);return UE(t,o,n-s.index)}else{const o=new wb(null,e._start,0,r);return UE(t,o,n)}},U_=(t,e,n,i)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===Wt&&Zs(i.get(n.right.content.key),n.right.content.value));)n.right.deleted||i.delete(n.right.content.key),n.forward();const r=t.doc,s=r.clientID;i.forEach((o,c)=>{const f=n.left,d=n.right,p=new pt(Ie(s,$t(r.store,s)),f,f&&f.lastId,d,d&&d.id,e,null,new Wt(c,o));p.integrate(t,0),n.right=p,n.forward()})},Fa=(t,e)=>{const{key:n,value:i}=e;i===null?t.delete(n):t.set(n,i)},H_=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===Wt&&Zs(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},V_=(t,e,n,i)=>{const r=t.doc,s=r.clientID,o=new Map;for(const c in i){const f=i[c],d=n.currentAttributes.get(c)??null;if(!Zs(d,f)){o.set(c,d);const{left:p,right:m}=n;n.right=new pt(Ie(s,$t(r.store,s)),p,p&&p.lastId,m,m&&m.id,e,null,new Wt(c,f)),n.right.integrate(t,0),n.forward()}}return o},f0=(t,e,n,i,r)=>{n.currentAttributes.forEach((y,b)=>{r[b]===void 0&&(r[b]=null)});const s=t.doc,o=s.clientID;H_(n,r);const c=V_(t,e,n,r),f=i.constructor===String?new nr(i):i instanceof fn?new ir(i):new oo(i);let{left:d,right:p,index:m}=n;e._searchMarker&&ju(e._searchMarker,n.index,f.getLength()),p=new pt(Ie(o,$t(s.store,o)),d,d&&d.lastId,p,p&&p.id,e,null,f),p.integrate(t,0),n.right=p,n.index=m,n.forward(),U_(t,e,n,c)},HE=(t,e,n,i,r)=>{const s=t.doc,o=s.clientID;H_(n,r);const c=V_(t,e,n,r);e:for(;n.right!==null&&(i>0||c.size>0&&(n.right.deleted||n.right.content.constructor===Wt));){if(!n.right.deleted)switch(n.right.content.constructor){case Wt:{const{key:f,value:d}=n.right.content,p=r[f];if(p!==void 0){if(Zs(p,d))c.delete(f);else{if(i===0)break e;c.set(f,d)}n.right.delete(t)}else n.currentAttributes.set(f,d);break}default:i<n.right.length&&ti(t,Ie(n.right.id.client,n.right.id.clock+i)),i-=n.right.length;break}n.forward()}if(i>0){let f="";for(;i>0;i--)f+=`
|
|
160
|
+
`;n.right=new pt(Ie(o,$t(s.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new nr(f)),n.right.integrate(t,0),n.forward()}U_(t,e,n,c)},P_=(t,e,n,i,r)=>{let s=e;const o=Vi();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===Wt){const d=s.content;o.set(d.key,d)}s=s.right}let c=0,f=!1;for(;e!==s;){if(n===e&&(f=!0),!e.deleted){const d=e.content;switch(d.constructor){case Wt:{const{key:p,value:m}=d,y=i.get(p)??null;(o.get(p)!==d||y===m)&&(e.delete(t),c++,!f&&(r.get(p)??null)===m&&y!==m&&(y===null?r.delete(p):r.set(p,y))),!f&&!e.deleted&&Fa(r,d);break}}}e=e.right}return c},u8=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===Wt){const i=e.content.key;n.has(i)?e.delete(t):n.add(i)}e=e.left}},f8=t=>{let e=0;return wt(t.doc,n=>{let i=t._start,r=t._start,s=Vi();const o=fb(s);for(;r;){if(r.deleted===!1)switch(r.content.constructor){case Wt:Fa(o,r.content);break;default:e+=P_(n,i,r,s,o),s=fb(o),i=r;break}r=r.right}}),e},d8=t=>{const e=new Set,n=t.doc;for(const[i,r]of t.afterState.entries()){const s=t.beforeState.get(i)||0;r!==s&&k_(t,n.store.clients.get(i),s,r,o=>{!o.deleted&&o.content.constructor===Wt&&o.constructor!==Bi&&e.add(o.parent)})}wt(n,i=>{rl(t,t.deleteSet,r=>{if(r instanceof Bi||!r.parent._hasFormatting||e.has(r.parent))return;const s=r.parent;r.content.constructor===Wt?e.add(s):u8(i,r)});for(const r of e)f8(r)})},VE=(t,e,n)=>{const i=n,r=fb(e.currentAttributes),s=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case ir:case oo:case nr:n<e.right.length&&ti(t,Ie(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}s&&P_(t,s,e.right,r,e.currentAttributes);const o=(e.left||e.right).parent;return o._searchMarker&&ju(o._searchMarker,e.index,-i+n),e};class h8 extends rm{constructor(e,n,i){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,i.forEach(r=>{r===null?this.childListChanged=!0:this.keysChanged.add(r)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];wt(e,i=>{const r=new Map,s=new Map;let o=this.target._start,c=null;const f={};let d="",p=0,m=0;const y=()=>{if(c!==null){let b=null;switch(c){case"delete":m>0&&(b={delete:m}),m=0;break;case"insert":(typeof d=="object"||d.length>0)&&(b={insert:d},r.size>0&&(b.attributes={},r.forEach((S,v)=>{S!==null&&(b.attributes[v]=S)}))),d="";break;case"retain":p>0&&(b={retain:p},pj(f)||(b.attributes=dj({},f))),p=0;break}b&&n.push(b),c=null}};for(;o!==null;){switch(o.content.constructor){case ir:case oo:this.adds(o)?this.deletes(o)||(y(),c="insert",d=o.content.getContent()[0],y()):this.deletes(o)?(c!=="delete"&&(y(),c="delete"),m+=1):o.deleted||(c!=="retain"&&(y(),c="retain"),p+=1);break;case nr:this.adds(o)?this.deletes(o)||(c!=="insert"&&(y(),c="insert"),d+=o.content.str):this.deletes(o)?(c!=="delete"&&(y(),c="delete"),m+=o.length):o.deleted||(c!=="retain"&&(y(),c="retain"),p+=o.length);break;case Wt:{const{key:b,value:S}=o.content;if(this.adds(o)){if(!this.deletes(o)){const v=r.get(b)??null;Zs(v,S)?S!==null&&o.delete(i):(c==="retain"&&y(),Zs(S,s.get(b)??null)?delete f[b]:f[b]=S)}}else if(this.deletes(o)){s.set(b,S);const v=r.get(b)??null;Zs(v,S)||(c==="retain"&&y(),f[b]=v)}else if(!o.deleted){s.set(b,S);const v=f[b];v!==void 0&&(Zs(v,S)?v!==null&&o.delete(i):(c==="retain"&&y(),S===null?delete f[b]:f[b]=S))}o.deleted||(c==="insert"&&y(),Fa(r,o.content));break}}o=o.right}for(y();n.length>0;){const b=n[n.length-1];if(b.retain!==void 0&&b.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class sl extends fn{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Mn(),this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(i=>i())}catch(i){console.error(i)}this._pending=null}_copy(){return new sl}clone(){const e=new sl;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const i=new h8(this,e,n);lm(this,e,i),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Mn();let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===nr&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?wt(this.doc,i=>{const r=new wb(null,this._start,0,new Map);for(let s=0;s<e.length;s++){const o=e[s];if(o.insert!==void 0){const c=!n&&typeof o.insert=="string"&&s===e.length-1&&r.right===null&&o.insert.slice(-1)===`
|
|
161
|
+
`?o.insert.slice(0,-1):o.insert;(typeof c!="string"||c.length>0)&&f0(i,this,r,c,o.attributes||{})}else o.retain!==void 0?HE(i,this,r,o.retain,o.attributes||{}):o.delete!==void 0&&VE(i,r,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,i){this.doc??Mn();const r=[],s=new Map,o=this.doc;let c="",f=this._start;function d(){if(c.length>0){const m={};let y=!1;s.forEach((S,v)=>{y=!0,m[v]=S});const b={insert:c};y&&(b.attributes=m),r.push(b),c=""}}const p=()=>{for(;f!==null;){if(zl(f,e)||n!==void 0&&zl(f,n))switch(f.content.constructor){case nr:{const m=s.get("ychange");e!==void 0&&!zl(f,e)?(m===void 0||m.user!==f.id.client||m.type!=="removed")&&(d(),s.set("ychange",i?i("removed",f.id):{type:"removed"})):n!==void 0&&!zl(f,n)?(m===void 0||m.user!==f.id.client||m.type!=="added")&&(d(),s.set("ychange",i?i("added",f.id):{type:"added"})):m!==void 0&&(d(),s.delete("ychange")),c+=f.content.str;break}case ir:case oo:{d();const m={insert:f.content.getContent()[0]};if(s.size>0){const y={};m.attributes=y,s.forEach((b,S)=>{y[S]=b})}r.push(m);break}case Wt:zl(f,e)&&(d(),Fa(s,f.content));break}f=f.right}d()};return e||n?wt(o,m=>{e&&xb(m,e),n&&xb(m,n),p()},"cleanup"):p(),r}insert(e,n,i){if(n.length<=0)return;const r=this.doc;r!==null?wt(r,s=>{const o=Ud(s,this,e,!i);i||(i={},o.currentAttributes.forEach((c,f)=>{i[f]=c})),f0(s,this,o,n,i)}):this._pending.push(()=>this.insert(e,n,i))}insertEmbed(e,n,i){const r=this.doc;r!==null?wt(r,s=>{const o=Ud(s,this,e,!i);f0(s,this,o,n,i||{})}):this._pending.push(()=>this.insertEmbed(e,n,i||{}))}delete(e,n){if(n===0)return;const i=this.doc;i!==null?wt(i,r=>{VE(r,Ud(r,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,i){if(n===0)return;const r=this.doc;r!==null?wt(r,s=>{const o=Ud(s,this,e,!1);o.right!==null&&HE(s,this,o,n,i)}):this._pending.push(()=>this.format(e,n,i))}removeAttribute(e){this.doc!==null?wt(this.doc,n=>{Vh(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?wt(this.doc,i=>{ax(i,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return cx(this,e)}getAttributes(){return B_(this)}_write(e){e.writeTypeRef(R8)}}const p8=t=>new sl;class d0{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Mn()}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===En||n.constructor===to)&&n._start!==null)e=n._start;else for(;e!==null;){const i=e.next;if(i!==null){e=i;break}else e.parent===this._root?e=null:e=e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class to extends fn{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new to}clone(){const e=new to;return e.insert(0,this.toArray().map(n=>n instanceof fn?n.clone():n)),e}get length(){return this.doc??Mn(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new d0(this,e)}querySelector(e){e=e.toUpperCase();const i=new d0(this,r=>r.nodeName&&r.nodeName.toUpperCase()===e).next();return i.done?null:i.value}querySelectorAll(e){return e=e.toUpperCase(),il(new d0(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){lm(this,e,new y8(this,n,e))}toString(){return N_(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},i){const r=e.createDocumentFragment();return i!==void 0&&i._createAssociation(r,this),Uu(this,s=>{r.insertBefore(s.toDOM(e,n,i),null)}),r}insert(e,n){this.doc!==null?wt(this.doc,i=>{L_(i,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)wt(this.doc,i=>{const r=e&&e instanceof fn?e._item:e;Hh(i,this,r,n)});else{const i=this._prelimContent,r=e===null?0:i.findIndex(s=>s===e)+1;if(r===0&&e!==null)throw vr("Reference item not found");i.splice(r,0,...n)}}delete(e,n=1){this.doc!==null?wt(this.doc,i=>{I_(i,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return __(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return R_(this,e)}slice(e=0,n=this.length){return O_(this,e,n)}forEach(e){Uu(this,e)}_write(e){e.writeTypeRef(L8)}}const m8=t=>new to;class En extends to{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((i,r)=>{this.setAttribute(r,i)}),this._prelimAttrs=null}_copy(){return new En(this.nodeName)}clone(){const e=new En(this.nodeName),n=this.getAttributes();return hj(n,(i,r)=>{e.setAttribute(r,i)}),e.insert(0,this.toArray().map(i=>i instanceof fn?i.clone():i)),e}toString(){const e=this.getAttributes(),n=[],i=[];for(const c in e)i.push(c);i.sort();const r=i.length;for(let c=0;c<r;c++){const f=i[c];n.push(f+'="'+e[f]+'"')}const s=this.nodeName.toLocaleLowerCase(),o=n.length>0?" "+n.join(" "):"";return`<${s}${o}>${super.toString()}</${s}>`}removeAttribute(e){this.doc!==null?wt(this.doc,n=>{Vh(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?wt(this.doc,i=>{ax(i,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return cx(this,e)}hasAttribute(e){return j_(this,e)}getAttributes(e){return e?s8(this,e):B_(this)}toDOM(e=document,n={},i){const r=e.createElement(this.nodeName),s=this.getAttributes();for(const o in s){const c=s[o];typeof c=="string"&&r.setAttribute(o,c)}return Uu(this,o=>{r.appendChild(o.toDOM(e,n,i))}),i!==void 0&&i._createAssociation(r,this),r}_write(e){e.writeTypeRef(z8),e.writeKey(this.nodeName)}}const g8=t=>new En(t.readKey());class y8 extends rm{constructor(e,n,i){super(e,i),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(r=>{r===null?this.childListChanged=!0:this.attributesChanged.add(r)})}}class Ph extends _a{constructor(e){super(),this.hookName=e}_copy(){return new Ph(this.hookName)}clone(){const e=new Ph(this.hookName);return this.forEach((n,i)=>{e.set(i,n)}),e}toDOM(e=document,n={},i){const r=n[this.hookName];let s;return r!==void 0?s=r.createDom(this):s=document.createElement(this.hookName),s.setAttribute("data-yjs-hook",this.hookName),i!==void 0&&i._createAssociation(s,this),s}_write(e){e.writeTypeRef(I8),e.writeKey(this.hookName)}}const b8=t=>new Ph(t.readKey());class Hn extends sl{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Hn}clone(){const e=new Hn;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,i){const r=e.createTextNode(this.toString());return i!==void 0&&i._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{const n=[];for(const r in e.attributes){const s=[];for(const o in e.attributes[r])s.push({key:o,value:e.attributes[r][o]});s.sort((o,c)=>o.key<c.key?-1:1),n.push({nodeName:r,attrs:s})}n.sort((r,s)=>r.nodeName<s.nodeName?-1:1);let i="";for(let r=0;r<n.length;r++){const s=n[r];i+=`<${s.nodeName}`;for(let o=0;o<s.attrs.length;o++){const c=s.attrs[o];i+=` ${c.key}="${c.value}"`}i+=">"}i+=e.insert;for(let r=n.length-1;r>=0;r--)i+=`</${n[r].nodeName}>`;return i}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(B8)}}const x8=t=>new Hn;class ux{constructor(e,n){this.id=e,this.length=n}get deleted(){throw Pi()}mergeWith(e){return!1}write(e,n,i){throw Pi()}integrate(e,n){throw Pi()}}const S8=0;class Bi extends ux{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),v_(e.doc.store,this)}write(e,n){e.writeInfo(S8),e.writeLen(this.length-n)}getMissing(e,n){return null}}class af{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new af(this.content)}splice(e){throw Pi()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}const w8=t=>new af(t.readBuf());class Hu{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Hu(this.len)}splice(e){const n=new Hu(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){zu(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const v8=t=>new Hu(t.readLen()),$_=(t,e)=>new kr({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class cf{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new cf($_(this.doc.guid,this.opts))}splice(e){throw Pi()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}const k8=t=>new cf($_(t.readString(),t.readAny()));class oo{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new oo(this.embed)}splice(e){throw Pi()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}const C8=t=>new oo(t.readJSON());class Wt{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Wt(this.key,this.value)}splice(e){throw Pi()}mergeWith(e){return!1}integrate(e,n){const i=n.parent;i._searchMarker=null,i._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const E8=t=>new Wt(t.readKey(),t.readJSON());class $h{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new $h(this.arr)}splice(e){const n=new $h(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const i=this.arr.length;e.writeLen(i-n);for(let r=n;r<i;r++){const s=this.arr[r];e.writeString(s===void 0?"undefined":JSON.stringify(s))}}getRef(){return 2}}const T8=t=>{const e=t.readLen(),n=[];for(let i=0;i<e;i++){const r=t.readString();r==="undefined"?n.push(void 0):n.push(JSON.parse(r))}return new $h(n)},A8=zh("node_env")==="development";class no{constructor(e){this.arr=e,A8&&BO(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new no(this.arr)}splice(e){const n=new no(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const i=this.arr.length;e.writeLen(i-n);for(let r=n;r<i;r++){const s=this.arr[r];e.writeAny(s)}}getRef(){return 8}}const M8=t=>{const e=t.readLen(),n=[];for(let i=0;i<e;i++)n.push(t.readAny());return new no(n)};class nr{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new nr(this.str)}splice(e){const n=new nr(this.str.slice(e));this.str=this.str.slice(0,e);const i=this.str.charCodeAt(e-1);return i>=55296&&i<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const O8=t=>new nr(t.readString()),_8=[o8,c8,p8,g8,m8,b8,x8],D8=0,N8=1,R8=2,z8=3,L8=4,I8=5,B8=6;class ir{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new ir(this.type._copy())}splice(e){throw Pi()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(i=>{i.deleted?i.id.clock<(e.beforeState.get(i.id.client)||0)&&e._mergeStructs.push(i):i.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(i=>{for(;i!==null;)i.gc(e,!0),i=i.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const j8=t=>new ir(_8[t.readTypeRef()](t)),vb=(t,e)=>{let n=e,i=0,r;do i>0&&(n=Ie(n.client,n.clock+i)),r=pa(t,n),i=n.clock-r.id.clock,n=r.redone;while(n!==null&&r instanceof pt);return{item:r,diff:i}},fx=(t,e)=>{for(;t!==null&&t.keep!==e;)t.keep=e,t=t.parent._item},Fh=(t,e,n)=>{const{client:i,clock:r}=e.id,s=new pt(Ie(i,r+n),e,Ie(i,r+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&s.markDeleted(),e.keep&&(s.keep=!0),e.redone!==null&&(s.redone=Ie(e.redone.client,e.redone.clock+n)),e.right=s,s.right!==null&&(s.right.left=s),t._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),e.length=n,s},PE=(t,e)=>V1(t,n=>Pa(n.deletions,e)),F_=(t,e,n,i,r,s)=>{const o=t.doc,c=o.store,f=o.clientID,d=e.redone;if(d!==null)return ti(t,d);let p=e.parent._item,m=null,y;if(p!==null&&p.deleted===!0){if(p.redone===null&&(!n.has(p)||F_(t,p,n,i,r,s)===null))return null;for(;p.redone!==null;)p=ti(t,p.redone)}const b=p===null?e.parent:p.content.type;if(e.parentSub===null){for(m=e.left,y=e;m!==null;){let E=m;for(;E!==null&&E.parent._item!==p;)E=E.redone===null?null:ti(t,E.redone);if(E!==null&&E.parent._item===p){m=E;break}m=m.left}for(;y!==null;){let E=y;for(;E!==null&&E.parent._item!==p;)E=E.redone===null?null:ti(t,E.redone);if(E!==null&&E.parent._item===p){y=E;break}y=y.right}}else if(y=null,e.right&&!r){for(m=e;m!==null&&m.right!==null&&(m.right.redone||Pa(i,m.right.id)||PE(s.undoStack,m.right.id)||PE(s.redoStack,m.right.id));)for(m=m.right;m.redone;)m=ti(t,m.redone);if(m&&m.right!==null)return null}else m=b._map.get(e.parentSub)||null;const S=$t(c,f),v=Ie(f,S),k=new pt(v,m,m&&m.lastId,y,y&&y.id,b,e.parentSub,e.content.copy());return e.redone=v,fx(k,!0),k.integrate(t,0),k};class pt extends ux{constructor(e,n,i,r,s,o,c,f){super(e,f.getLength()),this.origin=i,this.left=n,this.right=r,this.rightOrigin=s,this.parent=o,this.parentSub=c,this.redone=null,this.content=f,this.info=this.content.isCountable()?gE:0}set marker(e){(this.info&i0)>0!==e&&(this.info^=i0)}get marker(){return(this.info&i0)>0}get keep(){return(this.info&mE)>0}set keep(e){this.keep!==e&&(this.info^=mE)}get countable(){return(this.info&gE)>0}get deleted(){return(this.info&n0)>0}set deleted(e){this.deleted!==e&&(this.info^=n0)}markDeleted(){this.info|=n0}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=$t(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=$t(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===ha&&this.id.client!==this.parent.client&&this.parent.clock>=$t(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=RE(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=ti(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Bi||this.right&&this.right.constructor===Bi)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===pt?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===pt&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===ha){const i=pa(n,this.parent);i.constructor===Bi?this.parent=null:this.parent=i.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=RE(e,e.doc.store,Ie(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let i=this.left,r;if(i!==null)r=i.right;else if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start;const s=new Set,o=new Set;for(;r!==null&&r!==this.right;){if(o.add(r),s.add(r),la(this.origin,r.origin)){if(r.id.client<this.id.client)i=r,s.clear();else if(la(this.rightOrigin,r.rightOrigin))break}else if(r.origin!==null&&o.has(pa(e.doc.store,r.origin)))s.has(pa(e.doc.store,r.origin))||(i=r,s.clear());else break;r=r.right}this.left=i}if(this.left!==null){const i=this.left.right;this.right=i,this.left.right=this}else{let i;if(this.parentSub!==null)for(i=this.parent._map.get(this.parentSub)||null;i!==null&&i.left!==null;)i=i.left;else i=this.parent._start,this.parent._start=this;this.right=i}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),v_(e.doc.store,this),this.content.integrate(e,this),LE(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new Bi(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Ie(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&la(e.origin,this.lastId)&&this.right===e&&la(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(i=>{i.p===e&&(i.p=this,!this.deleted&&this.countable&&(i.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),zu(e.deleteSet,this.id.client,this.id.clock,this.length),LE(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw Dn();this.content.gc(e),n?P5(e,this,new Bi(this.id,this.length)):this.content=new Hu(this.length)}write(e,n){const i=n>0?Ie(this.id.client,this.id.clock+n-1):this.origin,r=this.rightOrigin,s=this.parentSub,o=this.content.getRef()&Zp|(i===null?0:Un)|(r===null?0:is)|(s===null?0:Ou);if(e.writeInfo(o),i!==null&&e.writeLeftID(i),r!==null&&e.writeRightID(r),i===null&&r===null){const c=this.parent;if(c._item!==void 0){const f=c._item;if(f===null){const d=Lu(c);e.writeParentInfo(!0),e.writeString(d)}else e.writeParentInfo(!1),e.writeLeftID(f.id)}else c.constructor===String?(e.writeParentInfo(!0),e.writeString(c)):c.constructor===ha?(e.writeParentInfo(!1),e.writeLeftID(c)):Dn();s!==null&&e.writeString(s)}this.content.write(e,n)}}const q_=(t,e)=>U8[e&Zp](t),U8=[()=>{Dn()},v8,T8,w8,O8,C8,E8,j8,M8,k8,()=>{Dn()}],H8=10;class ji extends ux{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){Dn()}write(e,n){e.writeInfo(H8),et(e.restEncoder,this.length-n)}getMissing(e,n){return null}}const Y_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},K_="__ $YJS$ __";Y_[K_]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");Y_[K_]=!0;const V8=()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else n!==void 0&&n()}},P8=/[\uD800-\uDBFF]/,$8=/[\uDC00-\uDFFF]/,F8=(t,e)=>{let n=0,i=0;for(;n<t.length&&n<e.length&&t[n]===e[n];)n++;for(n>0&&P8.test(t[n-1])&&n--;i+n<t.length&&i+n<e.length&&t[t.length-i-1]===e[e.length-i-1];)i++;return i>0&&$8.test(t[t.length-i])&&i--,{index:n,remove:t.length-n-i,insert:e.slice(n,e.length-i)}},q8=F8,Rt=new Dt("y-sync"),rs=new Dt("y-undo"),Hd=new Dt("yjs-cursor"),gr=(t,e)=>t>>>e|t<<32-e,Y8=t=>gr(t,2)^gr(t,13)^gr(t,22),K8=t=>gr(t,6)^gr(t,11)^gr(t,25),G8=t=>gr(t,7)^gr(t,18)^t>>>3,Z8=t=>gr(t,17)^gr(t,19)^t>>>10,J8=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),X8=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);class W8{constructor(){const e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(X8),this._W=new Uint32Array(e,64,64)}_updateHash(){const e=this._H,n=this._W;for(let m=16;m<64;m++)n[m]=Z8(n[m-2])+n[m-7]+G8(n[m-15])+n[m-16];let i=e[0],r=e[1],s=e[2],o=e[3],c=e[4],f=e[5],d=e[6],p=e[7];for(let m=0,y,b;m<64;m++)y=p+K8(c)+(c&f^~c&d)+J8[m]+n[m]>>>0,b=Y8(i)+(i&r^i&s^r&s)>>>0,p=d,d=f,f=c,c=o+y>>>0,o=s,s=r,r=i,i=y+b>>>0;e[0]+=i,e[1]+=r,e[2]+=s,e[3]+=o,e[4]+=c,e[5]+=f,e[6]+=d,e[7]+=p}digest(e){let n=0;for(;n+56<=e.length;){let o=0;for(;o<16&&n+3<e.length;o++)this._W[o]=e[n++]<<24|e[n++]<<16|e[n++]<<8|e[n++];if(n%64!==0){for(this._W.fill(0,o,16);n<e.length;)this._W[o]|=e[n]<<(3-n%4)*8,n++;this._W[o]|=Un<<(3-n%4)*8}this._updateHash()}const i=n%64!==0;this._W.fill(0,0,16);let r=0;for(;n<e.length;r++)for(let o=3;o>=0&&n<e.length;o--)this._W[r]|=e[n++]<<o*8;i||(this._W[r-(n%4===0?0:1)]|=Un<<(3-n%4)*8),this._W[14]=e.byteLength/EB,this._W[15]=e.byteLength*8,this._updateHash();const s=new Uint8Array(32);for(let o=0;o<this._H.length;o++)for(let c=0;c<4;c++)s[o*4+c]=this._H[o]>>>(3-c)*8;return s}}const Q8=t=>new W8().digest(t),eU=t=>{for(let n=6;n<t.length;n++)t[n%6]=t[n%6]^t[n];return t.slice(0,6)},tU=t=>Tj(eU(Q8(Mj(t)))),qh=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!Pa(e.ds,t.id),nU=[{light:"#ecd44433",dark:"#ecd444"}],iU=(t,e,n)=>{if(!t.has(n)){if(t.size<e.length){const i=Ql();t.forEach(r=>i.add(r)),e=e.filter(r=>!i.has(r))}t.set(n,rj(e))}return t.get(n)},rU=(t,{colors:e=nU,colorMapping:n=new Map,permanentUserData:i=null,onFirstRender:r=()=>{},mapping:s}={})=>{let o=!1;const c=new lU(t,s),f=new kt({props:{editable:d=>{const p=Rt.getState(d);return p.snapshot==null&&p.prevSnapshot==null}},key:Rt,state:{init:(d,p)=>({type:t,doc:t.doc,binding:c,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:n,permanentUserData:i}),apply:(d,p)=>{const m=d.getMeta(Rt);if(m!==void 0){p=Object.assign({},p);for(const y in m)p[y]=m[y]}return p.addToHistory=d.getMeta("addToHistory")!==!1,p.isChangeOrigin=m!==void 0&&!!m.isChangeOrigin,p.isUndoRedoOperation=m!==void 0&&!!m.isChangeOrigin&&!!m.isUndoRedoOperation,c.prosemirrorView!==null&&m!==void 0&&(m.snapshot!=null||m.prevSnapshot!=null)&&W1(0,()=>{c.prosemirrorView!=null&&(m.restore==null?c._renderSnapshot(m.snapshot,m.prevSnapshot,p):(c._renderSnapshot(m.snapshot,m.snapshot,p),delete p.restore,delete p.snapshot,delete p.prevSnapshot,c.mux(()=>{c._prosemirrorChanged(c.prosemirrorView.state.doc)})))}),p}},view:d=>(c.initView(d),s==null&&c._forceRerender(),r(),{update:()=>{const p=f.getState(d.state);if(p.snapshot==null&&p.prevSnapshot==null&&(o||d.state.doc.content.findDiffStart(d.state.doc.type.createAndFill().content)!==null)){if(o=!0,p.addToHistory===!1&&!p.isChangeOrigin){const m=rs.getState(d.state),y=m&&m.undoManager;y&&y.stopCapturing()}c.mux(()=>{p.doc.transact(m=>{m.meta.set("addToHistory",p.addToHistory),c._prosemirrorChanged(d.state.doc)},Rt)})}},destroy:()=>{c.destroy()}})});return f},sU=(t,e,n)=>{if(e!==null&&e.anchor!==null&&e.head!==null)if(e.type==="all")t.setSelection(new ni(t.doc));else if(e.type==="node"){const i=ga(n.doc,n.type,e.anchor,n.mapping);t.setSelection(Ee.create(t.doc,i))}else{const i=ga(n.doc,n.type,e.anchor,n.mapping),r=ga(n.doc,n.type,e.head,n.mapping);if(i!==null&&r!==null){const s=Ae.between(t.doc.resolve(i),t.doc.resolve(r));t.setSelection(s)}}},kb=(t,e)=>({type:e.selection.jsonID,anchor:Kh(e.selection.anchor,t.type,t.mapping),head:Kh(e.selection.head,t.type,t.mapping)});class lU{constructor(e,n=new Map){this.type=e,this.prosemirrorView=null,this.mux=V8(),this.mapping=n,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=kb(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(UO&&this._domSelectionInView===null&&(W1(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;const n=this.prosemirrorView._root.createRange();n.setStart(e.anchorNode,e.anchorOffset),n.setEnd(e.focusNode,e.focusOffset),n.getClientRects().length===0&&n.startContainer&&n.collapsed&&n.selectNodeContents(n.startContainer);const r=n.getBoundingClientRect(),s=sf.documentElement;return r.bottom>=0&&r.right>=0&&r.left<=(window.innerWidth||s.clientWidth||0)&&r.top<=(window.innerHeight||s.clientHeight||0)}renderSnapshot(e,n){n||(n=S_(u_(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(Rt,{snapshot:e,prevSnapshot:n}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{const e=this.type.toArray().map(i=>fh(i,this.prosemirrorView.state.schema,this)).filter(i=>i!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new de(W.from(e),0,0));n.setMeta(Rt,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(n)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{const e=this.beforeTransactionSelection!==null?null:this.prosemirrorView.state.selection,n=this.type.toArray().map(r=>fh(r,this.prosemirrorView.state.schema,this)).filter(r=>r!==null),i=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new de(W.from(n),0,0));if(e){const r=ns(er(e.anchor,0),i.doc.content.size),s=ns(er(e.head,0),i.doc.content.size);i.setSelection(Ae.create(i.doc,r,s))}this.prosemirrorView.dispatch(i.setMeta(Rt,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,n,i){let r=this.doc,s=this.type;if(e||(e=u0(this.doc)),e instanceof Uint8Array||n instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(n instanceof Uint8Array))&&Dn(),r=new kr({gc:!1}),jh(r,n),n=u0(r),jh(r,e),e=u0(r),s._item===null){const o=Array.from(this.doc.share.keys()).find(c=>this.doc.share.get(c)===this.type);s=r.getXmlFragment(o)}else{const o=r.store.clients.get(s._item.id.client)??[],c=tr(o,s._item.id.clock);s=o[c].content.type}this.mapping.clear(),this.mux(()=>{r.transact(o=>{const c=i.permanentUserData;c&&c.dss.forEach(m=>{rl(o,m,y=>{})});const f=(m,y)=>{const b=m==="added"?c.getUserByClientId(y.client):c.getUserByDeletedId(y);return{user:b,type:m,color:iU(i.colorMapping,i.colors,b)}},d=D_(s,new ix(n.ds,e.sv)).map(m=>!m._item.deleted||qh(m._item,e)||qh(m._item,n)?fh(m,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,n,f):null).filter(m=>m!==null),p=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new de(W.from(d),0,0));this.prosemirrorView.dispatch(p.setMeta(Rt,{isChangeOrigin:!0}))},Rt)})}_typeChanged(e,n){if(this.prosemirrorView==null)return;const i=Rt.getState(this.prosemirrorView.state);if(e.length===0||i.snapshot!=null||i.prevSnapshot!=null){this.renderSnapshot(i.snapshot,i.prevSnapshot);return}this.mux(()=>{const r=(c,f)=>this.mapping.delete(f);rl(n,n.deleteSet,c=>{if(c.constructor===pt){const f=c.content.type;f&&this.mapping.delete(f)}}),n.changed.forEach(r),n.changedParentTypes.forEach(r);const s=this.type.toArray().map(c=>G_(c,this.prosemirrorView.state.schema,this)).filter(c=>c!==null);let o=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new de(W.from(s),0,0));sU(o,this.beforeTransactionSelection,this),o=o.setMeta(Rt,{isChangeOrigin:!0,isUndoRedoOperation:n.origin instanceof E_}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&o.scrollIntoView(),this.prosemirrorView.dispatch(o)})}_prosemirrorChanged(e){this.doc.transact(()=>{Eb(this.doc,this.type,e,this),this.beforeTransactionSelection=kb(this,this.prosemirrorView.state)},Rt)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions))}}const G_=(t,e,n,i,r,s)=>{const o=n.mapping.get(t);if(o===void 0){if(t instanceof En)return fh(t,e,n,i,r,s);throw Pi()}return o},fh=(t,e,n,i,r,s)=>{const o=[],c=f=>{var d,p;if(f instanceof En){const m=G_(f,e,n,i,r,s);m!==null&&o.push(m)}else{const m=(p=(d=f._item.right)==null?void 0:d.content)==null?void 0:p.type;m instanceof sl&&!m._item.deleted&&m._item.id.client===m.doc.clientID&&(f.applyDelta([{retain:f.length},...m.toDelta()]),m.doc.transact(b=>{m._item.delete(b)}));const y=oU(f,e,n,i,r,s);y!==null&&y.forEach(b=>{b!==null&&o.push(b)})}};i===void 0||r===void 0?t.toArray().forEach(c):D_(t,new ix(r.ds,i.sv)).forEach(c);try{const f=t.getAttributes(i);i!==void 0&&(qh(t._item,i)?qh(t._item,r)||(f.ychange=s?s("added",t._item.id):{type:"added"}):f.ychange=s?s("removed",t._item.id):{type:"removed"});const d=e.node(t.nodeName,f,o);return n.mapping.set(t,d),d}catch{return t.doc.transact(d=>{t._item.delete(d)},Rt),n.mapping.delete(t),null}},oU=(t,e,n,i,r,s)=>{const o=[],c=t.toDelta(i,r,s);try{for(let f=0;f<c.length;f++){const d=c[f];o.push(e.text(d.insert,hU(d.attributes,e)))}}catch{return t.doc.transact(d=>{t._item.delete(d)},Rt),null}return o},aU=(t,e)=>{const n=new Hn,i=t.map(r=>({insert:r.text,attributes:J_(r.marks,e)}));return n.applyDelta(i),e.mapping.set(n,t),n},cU=(t,e)=>{const n=new En(t.type.name);for(const i in t.attrs){const r=t.attrs[i];r!==null&&i!=="ychange"&&n.setAttribute(i,r)}return n.insert(0,om(t).map(i=>Cb(i,e))),e.mapping.set(n,t),n},Cb=(t,e)=>t instanceof Array?aU(t,e):cU(t,e),$E=t=>typeof t=="object"&&t!==null,dx=(t,e)=>{const n=Object.keys(t).filter(r=>t[r]!==null);let i=n.length===(e==null?0:Object.keys(e).filter(r=>e[r]!==null).length);for(let r=0;r<n.length&&i;r++){const s=n[r],o=t[s],c=e[s];i=s==="ychange"||o===c||$E(o)&&$E(c)&&dx(o,c)}return i},om=t=>{const e=t.content.content,n=[];for(let i=0;i<e.length;i++){const r=e[i];if(r.isText){const s=[];for(let o=e[i];i<e.length&&o.isText;o=e[++i])s.push(o);i--,n.push(s)}else n.push(r)}return n},Z_=(t,e)=>{const n=t.toDelta();return n.length===e.length&&n.every((i,r)=>i.insert===e[r].text&&IO(i.attributes||{}).length===e[r].marks.length&&Ua(i.attributes,(s,o)=>{var d;const c=hx(o),f=e[r].marks;return dx(s,(d=f.find(p=>p.type.name===c))==null?void 0:d.attrs)}))},Vu=(t,e)=>{if(t instanceof En&&!(e instanceof Array)&&Tb(t,e)){const n=om(e);return t._length===n.length&&dx(t.getAttributes(),e.attrs)&&t.toArray().every((i,r)=>Vu(i,n[r]))}return t instanceof Hn&&e instanceof Array&&Z_(t,e)},Yh=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((n,i)=>e[i]===n),FE=(t,e,n)=>{const i=t.toArray(),r=om(e),s=r.length,o=i.length,c=ns(o,s);let f=0,d=0,p=!1;for(;f<c;f++){const m=i[f],y=r[f];if(Yh(n.mapping.get(m),y))p=!0;else if(!Vu(m,y))break}for(;f+d<c;d++){const m=i[o-d-1],y=r[s-d-1];if(Yh(n.mapping.get(m),y))p=!0;else if(!Vu(m,y))break}return{equalityFactor:f+d,foundMappedChild:p}},uU=t=>{let e="",n=t._start;const i={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof nr?e+=n.content.str:n.content instanceof Wt&&(i[n.content.key]=null)),n=n.right;return{str:e,nAttrs:i}},fU=(t,e,n)=>{n.mapping.set(t,e);const{nAttrs:i,str:r}=uU(t),s=e.map(d=>({insert:d.text,attributes:Object.assign({},i,J_(d.marks,n))})),{insert:o,remove:c,index:f}=q8(r,s.map(d=>d.insert).join(""));t.delete(f,c),t.insert(f,o),t.applyDelta(s.map(d=>({retain:d.insert.length,attributes:d.attributes})))},dU=/(.*)(--[a-zA-Z0-9+/=]{8})$/,hx=t=>{var e;return((e=dU.exec(t))==null?void 0:e[1])??t},hU=(t,e)=>{const n=[];for(const i in t)n.push(e.mark(hx(i),t[i]));return n},J_=(t,e)=>{const n={};return t.forEach(i=>{if(i.type.name!=="ychange"){const r=Er(e.isOMark,i.type,()=>!i.type.excludes(i.type));n[r?`${i.type.name}--${tU(i.toJSON())}`:i.type.name]=i.attrs}}),n},Eb=(t,e,n,i)=>{if(e instanceof En&&e.nodeName!==n.type.name)throw new Error("node name mismatch!");if(i.mapping.set(e,n),e instanceof En){const m=e.getAttributes(),y=n.attrs;for(const b in y)y[b]!==null?m[b]!==y[b]&&b!=="ychange"&&e.setAttribute(b,y[b]):e.removeAttribute(b);for(const b in m)y[b]===void 0&&e.removeAttribute(b)}const r=om(n),s=r.length,o=e.toArray(),c=o.length,f=ns(s,c);let d=0,p=0;for(;d<f;d++){const m=o[d],y=r[d];if(!Yh(i.mapping.get(m),y))if(Vu(m,y))i.mapping.set(m,y);else break}for(;p+d<f;p++){const m=o[c-p-1],y=r[s-p-1];if(!Yh(i.mapping.get(m),y))if(Vu(m,y))i.mapping.set(m,y);else break}t.transact(()=>{for(;c-d-p>0&&s-d-p>0;){const y=o[d],b=r[d],S=o[c-p-1],v=r[s-p-1];if(y instanceof Hn&&b instanceof Array)Z_(y,b)||fU(y,b,i),d+=1;else{let k=y instanceof En&&Tb(y,b),E=S instanceof En&&Tb(S,v);if(k&&E){const j=FE(y,b,i),L=FE(S,v,i);j.foundMappedChild&&!L.foundMappedChild?E=!1:!j.foundMappedChild&&L.foundMappedChild||j.equalityFactor<L.equalityFactor?k=!1:E=!1}k?(Eb(t,y,b,i),d+=1):E?(Eb(t,S,v,i),p+=1):(i.mapping.delete(e.get(d)),e.delete(d,1),e.insert(d,[Cb(b,i)]),d+=1)}}const m=c-d-p;if(c===1&&s===0&&o[0]instanceof Hn?(i.mapping.delete(o[0]),o[0].delete(0,o[0].length)):m>0&&(e.slice(d,d+m).forEach(y=>i.mapping.delete(y)),e.delete(d,m)),d+p<s){const y=[];for(let b=d;b<s-p;b++)y.push(Cb(r[b],i));e.insert(d,y)}},Rt)},Tb=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name;let ru=null;const pU=()=>{const t=ru;ru=null,t.forEach((e,n)=>{const i=n.state.tr,r=Rt.getState(n.state);r&&r.binding&&!r.binding.isDestroyed&&(e.forEach((s,o)=>{i.setMeta(o,s)}),n.dispatch(i))})},mU=(t,e,n)=>{ru||(ru=new Map,W1(0,pU)),Er(ru,t,Vi).set(e,n)},Kh=(t,e,n)=>{if(t===0)return c0(e,0,e.length===0?-1:0);let i=e._first===null?null:e._first.content.type;for(;i!==null&&e!==i;){if(i instanceof Hn){if(i._length>=t)return c0(i,t,e.length===0?-1:0);if(t-=i._length,i._item!==null&&i._item.next!==null)i=i._item.next.content.type;else{do i=i._item===null?null:i._item.parent,t--;while(i!==e&&i!==null&&i._item!==null&&i._item.next===null);i!==null&&i!==e&&(i=i._item===null?null:i._item.next.content.type)}}else{const r=(n.get(i)||{nodeSize:0}).nodeSize;if(i._first!==null&&t<r)i=i._first.content.type,t--;else{if(t===1&&i._length===0&&r>1)return new Bu(i._item===null?null:i._item.id,i._item===null?Lu(i):null,null);if(t-=r,i._item!==null&&i._item.next!==null)i=i._item.next.content.type;else{if(t===0)return i=i._item===null?i:i._item.parent,new Bu(i._item===null?null:i._item.id,i._item===null?Lu(i):null,null);do i=i._item.parent,t--;while(i!==e&&i._item.next===null);i!==e&&(i=i._item.next.content.type)}}}if(i===null)throw Dn();if(t===0&&i.constructor!==Hn&&i!==e)return gU(i._item.parent,i._item)}return c0(e,e._length,e.length===0?-1:0)},gU=(t,e)=>{let n=null,i=null;return t._item===null?i=Lu(t):n=Ie(t._item.id.client,t._item.id.clock),new Bu(n,i,e.id)},ga=(t,e,n,i)=>{const r=bb(n,t);if(r===null||r.type!==e&&!Iu(e,r.type._item))return null;let s=r.type,o=0;if(s.constructor===Hn)o=r.index;else if(s._item===null||!s._item.deleted){let c=s._first,f=0;for(;f<s._length&&f<r.index&&c!==null;){if(!c.deleted){const d=c.content.type;f++,d instanceof Hn?o+=d._length:o+=i.get(d).nodeSize}c=c.right}o+=1}for(;s!==e&&s._item!==null;){const c=s._item.parent;if(c._item===null||!c._item.deleted){o+=1;let f=c._first;for(;f!==null;){const d=f.content.type;if(d===s)break;f.deleted||(d instanceof Hn?o+=d._length:o+=i.get(d).nodeSize),f=f.right}}s=c}return o-1};function yU(t){const e=t.toArray(),n=i=>{let r;if(i instanceof Hn)r=i.toDelta().map(o=>{const c={type:"text",text:o.insert};return o.attributes&&(c.marks=Object.keys(o.attributes).map(f=>{const d=o.attributes[f],m={type:hx(f)};return Object.keys(d)&&(m.attrs=d),m})),c});else if(i instanceof En){r={type:i.nodeName};const s=i.getAttributes();Object.keys(s).length&&(r.attrs=s);const o=i.toArray();o.length&&(r.content=o.map(n).flat())}else Dn();return r};return{type:"doc",content:e.map(n)}}const bU=(t,e,n)=>t!==e,xU=t=>{const e=document.createElement("span");e.classList.add("ProseMirror-yjs-cursor"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name),null);const i=document.createTextNode(""),r=document.createTextNode("");return e.insertBefore(i,null),e.insertBefore(n,null),e.insertBefore(r,null),e},X_=t=>({style:`background-color: ${t.color}70`,class:"ProseMirror-yjs-selection"}),SU=/^#[0-9a-fA-F]{6}$/,qE=(t,e,n,i,r)=>{const s=Rt.getState(t),o=s.doc,c=[];return s.snapshot!=null||s.prevSnapshot!=null||s.binding.mapping.size===0?bt.create(t.doc,[]):(e.getStates().forEach((f,d)=>{if(n(o.clientID,d,f)&&f.cursor!=null){const p=f.user||{};p.color==null?p.color="#ffa500":SU.test(p.color)||console.warn("A user uses an unsupported color format",p),p.name==null&&(p.name=`User: ${d}`);let m=ga(o,s.type,Yl(f.cursor.anchor),s.binding.mapping),y=ga(o,s.type,Yl(f.cursor.head),s.binding.mapping);if(m!==null&&y!==null){const b=er(t.doc.content.size-1,0);m=ns(m,b),y=ns(y,b),c.push(Jt.widget(y,()=>i(p,d),{key:d+"",side:10}));const S=ns(m,y),v=er(m,y);c.push(Jt.inline(S,v,r(p,d),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),bt.create(t.doc,c))},wU=(t,{awarenessStateFilter:e=bU,cursorBuilder:n=xU,selectionBuilder:i=X_,getSelection:r=o=>o.selection}={},s="cursor")=>new kt({key:Hd,state:{init(o,c){return qE(c,t,e,n,i)},apply(o,c,f,d){const p=Rt.getState(d),m=o.getMeta(Hd);return p&&p.isChangeOrigin||m&&m.awarenessUpdated?qE(d,t,e,n,i):c.map(o.mapping,o.doc)}},props:{decorations:o=>Hd.getState(o)},view:o=>{const c=()=>{o.docView&&mU(o,Hd,{awarenessUpdated:!0})},f=()=>{const d=Rt.getState(o.state),p=t.getLocalState()||{};if(o.hasFocus()){const m=r(o.state),y=Kh(m.anchor,d.type,d.binding.mapping),b=Kh(m.head,d.type,d.binding.mapping);(p.cursor==null||!NE(Yl(p.cursor.anchor),y)||!NE(Yl(p.cursor.head),b))&&t.setLocalStateField(s,{anchor:y,head:b})}else p.cursor!=null&&ga(d.doc,d.type,Yl(p.cursor.anchor),d.binding.mapping)!==null&&t.setLocalStateField(s,null)};return t.on("change",c),o.dom.addEventListener("focusin",f),o.dom.addEventListener("focusout",f),{update:f,destroy:()=>{o.dom.removeEventListener("focusin",f),o.dom.removeEventListener("focusout",f),t.off("change",c),t.setLocalStateField(s,null)}}}}),vU=t=>{var e,n;return((n=(e=rs.getState(t))==null?void 0:e.undoManager)==null?void 0:n.undo())!=null},kU=t=>{var e,n;return((n=(e=rs.getState(t))==null?void 0:e.undoManager)==null?void 0:n.redo())!=null},CU=new Set(["paragraph"]),EU=(t,e)=>!(t instanceof pt)||!(t.content instanceof ir)||!(t.content.type instanceof sl||t.content.type instanceof En&&e.has(t.content.type.nodeName))||t.content.type._length===0,TU=({protectedNodes:t=CU,trackedOrigins:e=[],undoManager:n=null}={})=>new kt({key:rs,state:{init:(i,r)=>{const s=Rt.getState(r),o=n||new E_(s.type,{trackedOrigins:new Set([Rt].concat(e)),deleteFilter:c=>EU(c,t),captureTransaction:c=>c.meta.get("addToHistory")!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(i,r,s,o)=>{const c=Rt.getState(o).binding,f=r.undoManager,d=f.undoStack.length>0,p=f.redoStack.length>0;return c?{undoManager:f,prevSel:kb(c,s),hasUndoOps:d,hasRedoOps:p}:d!==r.hasUndoOps||p!==r.hasRedoOps?Object.assign({},r,{hasUndoOps:f.undoStack.length>0,hasRedoOps:f.redoStack.length>0}):r}},view:i=>{const r=Rt.getState(i.state),s=rs.getState(i.state).undoManager;return s.on("stack-item-added",({stackItem:o})=>{const c=r.binding;c&&o.meta.set(c,rs.getState(i.state).prevSel)}),s.on("stack-item-popped",({stackItem:o})=>{const c=r.binding;c&&(c.beforeTransactionSelection=o.meta.get(c)||c.beforeTransactionSelection)}),{destroy:()=>{s.destroy()}}}}),AU=Xt.create({name:"collaboration",priority:1e3,addOptions(){return{document:null,field:"default",fragment:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(t=>t.name==="history")&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".')},addCommands(){return{undo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),rs.getState(e).undoManager.undoStack.length===0?!1:n?vU(e):!0),redo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),rs.getState(e).undoManager.redoStack.length===0?!1:n?kU(e):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){var t;const e=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),n=TU(this.options.yUndoOptions),i=n.spec.view;n.spec.view=o=>{const{undoManager:c}=rs.getState(o.state);c.restore&&(c.restore(),c.restore=()=>{});const f=i?i(o):void 0;return{destroy:()=>{const d=c.trackedOrigins.has(c),p=c._observers;c.restore=()=>{d&&c.trackedOrigins.add(c),c.doc.on("afterTransaction",c.afterTransactionHandler),c._observers=p},f!=null&&f.destroy&&f.destroy()}}};const r={...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender},s=rU(e,r);return this.editor.options.enableContentCheck&&((t=e.doc)===null||t===void 0||t.on("beforeTransaction",()=>{try{const o=yU(e);if(o.content.length===0)return;this.editor.schema.nodeFromJSON(o).check()}catch(o){return this.editor.emit("contentError",{error:o,editor:this.editor,disableCollaboration:()=>{var c;(c=e.doc)===null||c===void 0||c.destroy(),this.storage.isDisabled=!0}}),!1}})),[s,n,this.editor.options.enableContentCheck&&new kt({key:new Dt("filterInvalidContent"),filterTransaction:()=>{var o;return this.storage.isDisabled&&((o=e.doc)===null||o===void 0||o.destroy()),!0}})].filter(Boolean)}}),YE=t=>Array.from(t.entries()).map(([e,n])=>({clientId:e,...n.user})),KE=()=>null,MU=Xt.create({name:"collaborationCursor",priority:999,addOptions(){return{provider:null,user:{name:null,color:null},render:t=>{const e=document.createElement("span");e.classList.add("collaboration-cursor__caret"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");return n.classList.add("collaboration-cursor__label"),n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name),null),e.insertBefore(n,null),e},selectionRender:X_,onUpdate:KE}},onCreate(){if(this.options.onUpdate!==KE&&console.warn('[tiptap warn]: DEPRECATED: The "onUpdate" option is deprecated. Please use `editor.storage.collaborationCursor.users` instead. Read more: https://tiptap.dev/api/extensions/collaboration-cursor'),!this.options.provider)throw new Error('The "provider" option is required for the CollaborationCursor extension')},addStorage(){return{users:[]}},addCommands(){return{updateUser:t=>()=>(this.options.user=t,this.options.provider.awareness.setLocalStateField("user",this.options.user),!0),user:t=>({editor:e})=>(console.warn('[tiptap warn]: DEPRECATED: The "user" command is deprecated. Please use "updateUser" instead. Read more: https://tiptap.dev/api/extensions/collaboration-cursor'),e.commands.updateUser(t))}},addProseMirrorPlugins(){return[wU((this.options.provider.awareness.setLocalStateField("user",this.options.user),this.storage.users=YE(this.options.provider.awareness.states),this.options.provider.awareness.on("update",()=>{this.storage.users=YE(this.options.provider.awareness.states)}),this.options.provider.awareness),{cursorBuilder:this.options.render,selectionBuilder:this.options.selectionRender})]}}),OU=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,_U=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,DU=wr.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",Ut(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Wl({find:OU,type:this.type})]},addPasteRules(){return[nl({find:_U,type:this.type})]}}),NU="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",RU="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Ab="numeric",Mb="ascii",Ob="alpha",su="asciinumeric",Jc="alphanumeric",_b="domain",W_="emoji",zU="scheme",LU="slashscheme",h0="whitespace";function IU(t,e){return t in e||(e[t]=[]),e[t]}function jl(t,e,n){e[Ab]&&(e[su]=!0,e[Jc]=!0),e[Mb]&&(e[su]=!0,e[Ob]=!0),e[su]&&(e[Jc]=!0),e[Ob]&&(e[Jc]=!0),e[Jc]&&(e[_b]=!0),e[W_]&&(e[_b]=!0);for(const i in e){const r=IU(i,n);r.indexOf(t)<0&&r.push(t)}}function BU(t,e){const n={};for(const i in e)e[i].indexOf(t)>=0&&(n[i]=!0);return n}function ei(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}ei.groups={};ei.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let i=0;i<e.jr.length;i++){const r=e.jr[i][0],s=e.jr[i][1];if(s&&r.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,i){for(let r=0;r<t.length;r++)this.tt(t[r],e,n,i)},tr(t,e,n,i){i=i||ei.groups;let r;return e&&e.j?r=e:(r=new ei(e),n&&i&&jl(e,n,i)),this.jr.push([t,r]),r},ts(t,e,n,i){let r=this;const s=t.length;if(!s)return r;for(let o=0;o<s-1;o++)r=r.tt(t[o]);return r.tt(t[s-1],e,n,i)},tt(t,e,n,i){i=i||ei.groups;const r=this;if(e&&e.j)return r.j[t]=e,e;const s=e;let o,c=r.go(t);if(c?(o=new ei,Object.assign(o.j,c.j),o.jr.push.apply(o.jr,c.jr),o.jd=c.jd,o.t=c.t):o=new ei,s){if(i)if(o.t&&typeof o.t=="string"){const f=Object.assign(BU(o.t,i),n);jl(s,f,i)}else n&&jl(s,n,i);o.t=s}return r.j[t]=o,o}};const Pe=(t,e,n,i,r)=>t.ta(e,n,i,r),It=(t,e,n,i,r)=>t.tr(e,n,i,r),GE=(t,e,n,i,r)=>t.ts(e,n,i,r),le=(t,e,n,i,r)=>t.tt(e,n,i,r),Jr="WORD",Db="UWORD",Q_="ASCIINUMERICAL",eD="ALPHANUMERICAL",Pu="LOCALHOST",Nb="TLD",Rb="UTLD",dh="SCHEME",na="SLASH_SCHEME",px="NUM",zb="WS",mx="NL",lu="OPENBRACE",ou="CLOSEBRACE",Gh="OPENBRACKET",Zh="CLOSEBRACKET",Jh="OPENPAREN",Xh="CLOSEPAREN",Wh="OPENANGLEBRACKET",Qh="CLOSEANGLEBRACKET",ep="FULLWIDTHLEFTPAREN",tp="FULLWIDTHRIGHTPAREN",np="LEFTCORNERBRACKET",ip="RIGHTCORNERBRACKET",rp="LEFTWHITECORNERBRACKET",sp="RIGHTWHITECORNERBRACKET",lp="FULLWIDTHLESSTHAN",op="FULLWIDTHGREATERTHAN",ap="AMPERSAND",cp="APOSTROPHE",up="ASTERISK",Hs="AT",fp="BACKSLASH",dp="BACKTICK",hp="CARET",Fs="COLON",gx="COMMA",pp="DOLLAR",fr="DOT",mp="EQUALS",yx="EXCLAMATION",Ri="HYPHEN",au="PERCENT",gp="PIPE",yp="PLUS",bp="POUND",cu="QUERY",bx="QUOTE",tD="FULLWIDTHMIDDLEDOT",xx="SEMI",dr="SLASH",uu="TILDE",xp="UNDERSCORE",nD="EMOJI",Sp="SYM";var iD=Object.freeze({__proto__:null,ALPHANUMERICAL:eD,AMPERSAND:ap,APOSTROPHE:cp,ASCIINUMERICAL:Q_,ASTERISK:up,AT:Hs,BACKSLASH:fp,BACKTICK:dp,CARET:hp,CLOSEANGLEBRACKET:Qh,CLOSEBRACE:ou,CLOSEBRACKET:Zh,CLOSEPAREN:Xh,COLON:Fs,COMMA:gx,DOLLAR:pp,DOT:fr,EMOJI:nD,EQUALS:mp,EXCLAMATION:yx,FULLWIDTHGREATERTHAN:op,FULLWIDTHLEFTPAREN:ep,FULLWIDTHLESSTHAN:lp,FULLWIDTHMIDDLEDOT:tD,FULLWIDTHRIGHTPAREN:tp,HYPHEN:Ri,LEFTCORNERBRACKET:np,LEFTWHITECORNERBRACKET:rp,LOCALHOST:Pu,NL:mx,NUM:px,OPENANGLEBRACKET:Wh,OPENBRACE:lu,OPENBRACKET:Gh,OPENPAREN:Jh,PERCENT:au,PIPE:gp,PLUS:yp,POUND:bp,QUERY:cu,QUOTE:bx,RIGHTCORNERBRACKET:ip,RIGHTWHITECORNERBRACKET:sp,SCHEME:dh,SEMI:xx,SLASH:dr,SLASH_SCHEME:na,SYM:Sp,TILDE:uu,TLD:Nb,UNDERSCORE:xp,UTLD:Rb,UWORD:Db,WORD:Jr,WS:zb});const Gr=/[a-z]/,Pc=new RegExp("\\p{L}","u"),p0=new RegExp("\\p{Emoji}","u"),Zr=/\d/,m0=/\s/,ZE="\r",g0=`
|
|
162
162
|
`,jU="️",UU="",y0="";let Vd=null,Pd=null;function HU(t=[]){const e={};ei.groups=e;const n=new ei;Vd==null&&(Vd=JE(NU)),Pd==null&&(Pd=JE(RU)),le(n,"'",cp),le(n,"{",lu),le(n,"}",ou),le(n,"[",Gh),le(n,"]",Zh),le(n,"(",Jh),le(n,")",Xh),le(n,"<",Wh),le(n,">",Qh),le(n,"(",ep),le(n,")",tp),le(n,"「",np),le(n,"」",ip),le(n,"『",rp),le(n,"』",sp),le(n,"<",lp),le(n,">",op),le(n,"&",ap),le(n,"*",up),le(n,"@",Hs),le(n,"`",dp),le(n,"^",hp),le(n,":",Fs),le(n,",",gx),le(n,"$",pp),le(n,".",fr),le(n,"=",mp),le(n,"!",yx),le(n,"-",Ri),le(n,"%",au),le(n,"|",gp),le(n,"+",yp),le(n,"#",bp),le(n,"?",cu),le(n,'"',bx),le(n,"/",dr),le(n,";",xx),le(n,"~",uu),le(n,"_",xp),le(n,"\\",fp),le(n,"・",tD);const i=It(n,Zr,px,{[Ab]:!0});It(i,Zr,i);const r=It(i,Gr,Q_,{[su]:!0}),s=It(i,Pc,eD,{[Jc]:!0}),o=It(n,Gr,Jr,{[Mb]:!0});It(o,Zr,r),It(o,Gr,o),It(r,Zr,r),It(r,Gr,r);const c=It(n,Pc,Db,{[Ob]:!0});It(c,Gr),It(c,Zr,s),It(c,Pc,c),It(s,Zr,s),It(s,Gr),It(s,Pc,s);const f=le(n,g0,mx,{[h0]:!0}),d=le(n,ZE,zb,{[h0]:!0}),p=It(n,m0,zb,{[h0]:!0});le(n,y0,p),le(d,g0,f),le(d,y0,p),It(d,m0,p),le(p,ZE),le(p,g0),It(p,m0,p),le(p,y0,p);const m=It(n,p0,nD,{[W_]:!0});le(m,"#"),It(m,p0,m),le(m,jU,m);const y=le(m,UU);le(y,"#"),It(y,p0,m);const b=[[Gr,o],[Zr,r]],S=[[Gr,null],[Pc,c],[Zr,s]];for(let v=0;v<Vd.length;v++)Ls(n,Vd[v],Nb,Jr,b);for(let v=0;v<Pd.length;v++)Ls(n,Pd[v],Rb,Db,S);jl(Nb,{tld:!0,ascii:!0},e),jl(Rb,{utld:!0,alpha:!0},e),Ls(n,"file",dh,Jr,b),Ls(n,"mailto",dh,Jr,b),Ls(n,"http",na,Jr,b),Ls(n,"https",na,Jr,b),Ls(n,"ftp",na,Jr,b),Ls(n,"ftps",na,Jr,b),jl(dh,{scheme:!0,ascii:!0},e),jl(na,{slashscheme:!0,ascii:!0},e),t=t.sort((v,k)=>v[0]>k[0]?1:-1);for(let v=0;v<t.length;v++){const k=t[v][0],j=t[v][1]?{[zU]:!0}:{[LU]:!0};k.indexOf("-")>=0?j[_b]=!0:Gr.test(k)?Zr.test(k)?j[su]=!0:j[Mb]=!0:j[Ab]=!0,GE(n,k,k,j)}return GE(n,"localhost",Pu,{ascii:!0}),n.jd=new ei(Sp),{start:n,tokens:Object.assign({groups:e},iD)}}function rD(t,e){const n=VU(e.replace(/[A-Z]/g,c=>c.toLowerCase())),i=n.length,r=[];let s=0,o=0;for(;o<i;){let c=t,f=null,d=0,p=null,m=-1,y=-1;for(;o<i&&(f=c.go(n[o]));)c=f,c.accepts()?(m=0,y=0,p=c):m>=0&&(m+=n[o].length,y++),d+=n[o].length,s+=n[o].length,o++;s-=m,o-=y,d-=m,r.push({t:p.t,v:e.slice(s-d,s),s:s-d,e:s})}return r}function VU(t){const e=[],n=t.length;let i=0;for(;i<n;){let r=t.charCodeAt(i),s,o=r<55296||r>56319||i+1===n||(s=t.charCodeAt(i+1))<56320||s>57343?t[i]:t.slice(i,i+2);e.push(o),i+=o.length}return e}function Ls(t,e,n,i,r){let s;const o=e.length;for(let c=0;c<o-1;c++){const f=e[c];t.j[f]?s=t.j[f]:(s=new ei(i),s.jr=r.slice(),t.j[f]=s),t=s}return s=new ei(n),s.jr=r.slice(),t.j[e[o-1]]=s,s}function JE(t){const e=[],n=[];let i=0,r="0123456789";for(;i<t.length;){let s=0;for(;r.indexOf(t[i+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let o=parseInt(t.substring(i,i+s),10);o>0;o--)n.pop();i+=s}else n.push(t[i]),i++}return e}const $u={defaultProtocol:"http",events:null,format:XE,formatHref:XE,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Sx(t,e=null){let n=Object.assign({},$u);t&&(n=Object.assign(n,t instanceof Sx?t.o:t));const i=n.ignoreTags,r=[];for(let s=0;s<i.length;s++)r.push(i[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=r}Sx.prototype={o:$u,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const i=e!=null;let r=this.o[t];return r&&(typeof r=="object"?(r=n.t in r?r[n.t]:$u[t],typeof r=="function"&&i&&(r=r(e,n))):typeof r=="function"&&i&&(r=r(e,n.t,n)),r)},getObj(t,e,n){let i=this.o[t];return typeof i=="function"&&e!=null&&(i=i(e,n.t,n)),i},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function XE(t){return t}function sD(t,e){this.t="token",this.v=t,this.tk=e}sD.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),i=t.get("format",e,this);return n&&i.length>n?i.substring(0,n)+"…":i},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=$u.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),i=t.get("formatHref",n,this),r=t.get("tagName",n,e),s=this.toFormattedString(t),o={},c=t.get("className",n,e),f=t.get("target",n,e),d=t.get("rel",n,e),p=t.getObj("attributes",n,e),m=t.getObj("events",n,e);return o.href=i,c&&(o.class=c),f&&(o.target=f),d&&(o.rel=d),p&&Object.assign(o,p),{tagName:r,attributes:o,content:s,eventListeners:m}}};function am(t,e){class n extends sD{constructor(r,s){super(r,s),this.t=t}}for(const i in e)n.prototype[i]=e[i];return n.t=t,n}const WE=am("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),QE=am("text"),PU=am("nl"),$d=am("url",{isLink:!0,toHref(t=$u.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Pu&&t[1].t===Fs}}),Ni=t=>new ei(t);function $U({groups:t}){const e=t.domain.concat([ap,up,Hs,fp,dp,hp,pp,mp,Ri,px,au,gp,yp,bp,dr,Sp,uu,xp]),n=[cp,Fs,gx,fr,yx,au,cu,bx,xx,Wh,Qh,lu,ou,Zh,Gh,Jh,Xh,ep,tp,np,ip,rp,sp,lp,op],i=[ap,cp,up,fp,dp,hp,pp,mp,Ri,lu,ou,au,gp,yp,bp,cu,dr,Sp,uu,xp],r=Ni(),s=le(r,uu);Pe(s,i,s),Pe(s,t.domain,s);const o=Ni(),c=Ni(),f=Ni();Pe(r,t.domain,o),Pe(r,t.scheme,c),Pe(r,t.slashscheme,f),Pe(o,i,s),Pe(o,t.domain,o);const d=le(o,Hs);le(s,Hs,d),le(c,Hs,d),le(f,Hs,d);const p=le(s,fr);Pe(p,i,s),Pe(p,t.domain,s);const m=Ni();Pe(d,t.domain,m),Pe(m,t.domain,m);const y=le(m,fr);Pe(y,t.domain,m);const b=Ni(WE);Pe(y,t.tld,b),Pe(y,t.utld,b),le(d,Pu,b);const S=le(m,Ri);le(S,Ri,S),Pe(S,t.domain,m),Pe(b,t.domain,m),le(b,fr,y),le(b,Ri,S);const v=le(b,Fs);Pe(v,t.numeric,WE);const k=le(o,Ri),E=le(o,fr);le(k,Ri,k),Pe(k,t.domain,o),Pe(E,i,s),Pe(E,t.domain,o);const j=Ni($d);Pe(E,t.tld,j),Pe(E,t.utld,j),Pe(j,t.domain,o),Pe(j,i,s),le(j,fr,E),le(j,Ri,k),le(j,Hs,d);const L=le(j,Fs),re=Ni($d);Pe(L,t.numeric,re);const P=Ni($d),O=Ni();Pe(P,e,P),Pe(P,n,O),Pe(O,e,P),Pe(O,n,O),le(j,dr,P),le(re,dr,P);const z=le(c,Fs),F=le(f,Fs),se=le(F,dr),te=le(se,dr);Pe(c,t.domain,o),le(c,fr,E),le(c,Ri,k),Pe(f,t.domain,o),le(f,fr,E),le(f,Ri,k),Pe(z,t.domain,P),le(z,dr,P),le(z,cu,P),Pe(te,t.domain,P),Pe(te,e,P),le(te,dr,P);const he=[[lu,ou],[Gh,Zh],[Jh,Xh],[Wh,Qh],[ep,tp],[np,ip],[rp,sp],[lp,op]];for(let ce=0;ce<he.length;ce++){const[Q,ie]=he[ce],Z=le(P,Q);le(O,Q,Z),le(Z,ie,P);const I=Ni($d);Pe(Z,e,I);const K=Ni();Pe(Z,n),Pe(I,e,I),Pe(I,n,K),Pe(K,e,I),Pe(K,n,K),le(I,ie,P),le(K,ie,P)}return le(r,Pu,j),le(r,mx,PU),{start:r,tokens:iD}}function FU(t,e,n){let i=n.length,r=0,s=[],o=[];for(;r<i;){let c=t,f=null,d=null,p=0,m=null,y=-1;for(;r<i&&!(f=c.go(n[r].t));)o.push(n[r++]);for(;r<i&&(d=f||c.go(n[r].t));)f=null,c=d,c.accepts()?(y=0,m=c):y>=0&&y++,r++,p++;if(y<0)r-=p,r<i&&(o.push(n[r]),r++);else{o.length>0&&(s.push(b0(QE,e,o)),o=[]),r-=y,p-=y;const b=m.t,S=n.slice(r-p,r);s.push(b0(b,e,S))}}return o.length>0&&s.push(b0(QE,e,o)),s}function b0(t,e,n){const i=n[0].s,r=n[n.length-1].e,s=e.slice(i,r);return new t(s,n)}const qU=typeof console<"u"&&console&&console.warn||(()=>{}),YU="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ot={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function KU(){return ei.groups={},Ot.scanner=null,Ot.parser=null,Ot.tokenQueue=[],Ot.pluginQueue=[],Ot.customSchemes=[],Ot.initialized=!1,Ot}function eT(t,e=!1){if(Ot.initialized&&qU(`linkifyjs: already initialized - will not register custom scheme "${t}" ${YU}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
163
163
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
164
164
|
2. Cannot start or end with "-"
|
|
@@ -253,10 +253,10 @@ Your original file will be backed up.`;if(o.length>0&&(d+=`
|
|
|
253
253
|
|
|
254
254
|
⚠ ${o.length} annotation(s) are still pending review and will not be applied.`),!!confirm(d)){r(!0);try{const p=await fetch(`${qu}/apply-changes`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({documentId:n})}),m=await p.json().catch(b=>(console.error("[ApplyChanges] Failed to parse response JSON:",b),null));if(!p.ok){alert((m==null?void 0:m.message)??`Apply failed (HTTP ${p.status}).`);return}const y=m==null?void 0:m.data;if(y){const b=[`Applied ${y.applied??0} tracked change(s).`];y.rejected>0&&b.push(`${y.rejected} could not be applied.`),y.backupPath&&b.push(`
|
|
255
255
|
Backup saved to:
|
|
256
|
-
${y.backupPath}`),alert(b.join(" "))}else alert("Changes applied successfully.")}catch(p){console.error("[ApplyChanges] Request failed:",p),alert(p instanceof TypeError?"Could not reach the server.":`Apply failed: ${p instanceof Error?p.message:String(p)}`)}finally{r(!1)}}}return A.jsx("button",{type:"button","data-testid":"apply-changes-btn",onClick:f,disabled:c,title:s.length===0?"No accepted suggestions to apply":void 0,style:{width:"100%",padding:"6px 12px",fontSize:"12px",fontWeight:500,border:"1px solid #bfdbfe",borderRadius:"4px",background:c?"#f3f4f6":"#2563eb",color:c?"#9ca3af":"white",cursor:c?"default":"pointer",opacity:i?.6:1,whiteSpace:"nowrap"},children:i?"Applying…":`Apply as Tracked Changes (${s.length})`})}function w0({value:t,onChange:e,options:n}){return A.jsx("select",{value:t,onChange:i=>e(i.target.value),style:{padding:"2px 4px",fontSize:"11px",border:"1px solid #e5e7eb",borderRadius:"3px",background:"#fff",color:"#374151",cursor:"pointer"},children:n.map(i=>A.jsx("option",{value:i.value,children:i.label},i.value))})}function S9(t,e){N.useEffect(()=>{function n(i){if(i.ctrlKey&&i.shiftKey&&i.key==="R"){i.preventDefault(),e.onToggleReviewMode();return}if(t)if(i.key==="Tab"&&!i.ctrlKey&&!i.altKey)i.preventDefault(),e.navigateReview(i.shiftKey?"prev":"next");else if(i.key==="y"||i.key==="Y"){if(i.target instanceof HTMLInputElement||i.target instanceof HTMLTextAreaElement)return;i.preventDefault(),e.acceptCurrent()}else if(i.key==="n"||i.key==="N"){if(i.target instanceof HTMLInputElement||i.target instanceof HTMLTextAreaElement)return;i.preventDefault(),e.dismissCurrent()}else if(i.key==="z"||i.key==="Z"){if(i.target instanceof HTMLInputElement||i.target instanceof HTMLTextAreaElement)return;i.preventDefault(),e.undoLast()}else if(i.key==="e"||i.key==="E"){if(i.target instanceof HTMLInputElement||i.target instanceof HTMLTextAreaElement)return;i.preventDefault(),e.scrollToCurrentAndExit()}else i.key==="Escape"&&e.cancelBulkOrExit()}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t,e])}const Jd={padding:"2px 8px",fontSize:"11px",border:"1px solid #d1d5db",borderRadius:"3px",cursor:"pointer"};function w9(t,e,n){if(t.type!=="suggestion")return!1;let i;try{i=JSON.parse(t.content).newText}catch{return console.warn("[SidePanel] Malformed suggestion content for",t.id),!1}if(typeof i!="string")return!1;const r=vp(t,e.state.doc,n);return r?(e.chain().focus().deleteRange({from:r.from,to:r.to}).insertContentAt(r.from,i).run(),!0):(console.warn("[SidePanel] Could not resolve range for suggestion",t.id),!1)}function v9({annotations:t,editor:e,ydoc:n,heldCount:i=0,interruptionMode:r,onModeChange:s,activeDocFormat:o,documentId:c,reviewMode:f,onToggleReviewMode:d,onExitReviewMode:p,activeAnnotationId:m,onActiveAnnotationChange:y}){const[b,S]=N.useState("all"),[v,k]=N.useState("all"),[E,j]=N.useState("all"),[L,re]=N.useState(0),P=N.useRef(0),[O,z]=N.useState(null),F=N.useRef(O);F.current=O;const se=N.useRef(null),[te,he]=N.useState(new Set),ce=N.useRef(null),Q=N.useRef(new Map);N.useEffect(()=>{const ee=Q.current;return()=>{for(const Le of ee.values())clearTimeout(Le)}},[]);const ie=N.useRef(n),Z=N.useRef(e);ie.current=n,Z.current=e;const{filtered:I,pending:K,resolved:pe,allPending:fe}=N.useMemo(()=>{const ee=[],Le=[];for(const pt of t){pt.status==="pending"&&Le.push(pt);const Y=b==="all"||pt.type===b,oe=v==="all"||pt.author===v,we=E==="all"||pt.status===E;Y&&oe&&we&&ee.push(pt)}const it=ee.filter(pt=>pt.status==="pending"),qe=ee.filter(pt=>pt.status!=="pending");return{filtered:ee,pending:it,resolved:qe,allPending:Le}},[t,b,v,E]),M=fe,_=N.useRef(M);_.current=M;function U(ee,Le){const it=ie.current;if(!it)return;const qe=it.getMap(oa),pt=qe.get(ee);if(!pt)return;qe.set(ee,{...pt,status:Le}),Le==="accepted"&&Z.current&&w9(pt,Z.current,ie.current),ce.current=ee,he(we=>new Set(we).add(ee));const Y=Q.current.get(ee);Y&&clearTimeout(Y);const oe=setTimeout(()=>{Q.current.delete(ee),he(we=>{const Ue=new Set(we);return Ue.delete(ee),Ue}),ce.current===ee&&(ce.current=null)},1e4);Q.current.set(ee,oe)}function T(ee){const Le=ie.current;if(!Le)return;const it=Le.getMap(oa),qe=it.get(ee);if(!qe||qe.status==="pending")return;if(qe.status==="accepted"&&qe.type==="suggestion"&&Z.current)try{const{newText:Y}=JSON.parse(qe.content),oe=qe.textSnapshot;if(typeof Y=="string"&&typeof oe=="string"){const we=vp(qe,Z.current.state.doc,Le);if(!we){console.warn(`[undo] Cannot resolve range for annotation ${ee}, skipping`);return}if(Z.current.state.doc.textBetween(we.from,we.to)!==Y){console.warn(`[undo] Text changed since accept for annotation ${ee}, skipping`);return}Z.current.chain().focus().deleteRange({from:we.from,to:we.to}).insertContentAt(we.from,oe).run()}}catch(Y){console.warn(`[undo] Failed to revert text for annotation ${ee}:`,Y);return}it.set(ee,{...qe,status:"pending"});const pt=Q.current.get(ee);pt&&(clearTimeout(pt),Q.current.delete(ee)),he(Y=>{const oe=new Set(Y);return oe.delete(ee),oe}),ce.current===ee&&(ce.current=null)}function ne(ee){U(ee,"accepted")}function me(ee){U(ee,"dismissed")}function ge(ee){T(ee)}function Oe(ee,Le){const it=ie.current;if(!it)return;const qe=it.getMap(oa),pt=qe.get(ee);pt&&qe.set(ee,{...pt,content:Le,editedAt:Date.now()})}function Ge(){for(const ee of K)U(ee.id,"accepted");z(null)}function Fe(){for(const ee of K)U(ee.id,"dismissed");z(null)}const ct=N.useCallback(ee=>{const Le=Z.current;if(!Le)return;const it=vp(ee,Le.state.doc,ie.current);if(!it)return;Le.chain().focus().setTextSelection({from:it.from,to:it.to}).run();const qe=Le.view.domAtPos(it.from),pt=qe.node instanceof HTMLElement?qe.node:qe.node.parentElement;pt==null||pt.scrollIntoView({behavior:"smooth",block:"center"})},[]),Ce=N.useCallback(ee=>{const Le=_.current;if(Le.length===0)return;let it=P.current;it=ee==="next"?(it+1)%Le.length:(it-1+Le.length)%Le.length,P.current=it,re(it),ct(Le[it])},[ct]),Xe=N.useCallback(()=>{const ee=_.current;if(ee.length===0)return;const Le=ee[P.current];Le&&U(Le.id,"accepted")},[]),Ht=N.useCallback(()=>{const ee=_.current;if(ee.length===0)return;const Le=ee[P.current];Le&&U(Le.id,"dismissed")},[]),Nt=N.useRef(!1);N.useEffect(()=>{f&&!Nt.current&&M.length>0&&(P.current=0,re(0),ct(M[0])),Nt.current=f},[f,M,ct]),N.useEffect(()=>{var ee;f&&M.length>0?y(((ee=M[L])==null?void 0:ee.id)??null):y(null)},[f,L,M,y]);const je=N.useCallback(()=>{const Le=_.current[P.current];Le&&ct(Le),p()},[ct,p]),Fn=N.useCallback(()=>{const ee=ce.current;ee&&T(ee)},[]),Fi=N.useCallback(()=>{F.current?z(null):p()},[p]),qi=N.useMemo(()=>({onToggleReviewMode:d,onExitReviewMode:p,navigateReview:Ce,acceptCurrent:Xe,dismissCurrent:Ht,scrollToCurrentAndExit:je,cancelBulkOrExit:Fi,undoLast:Fn}),[d,p,Ce,Xe,Ht,je,Fi,Fn]);S9(f,qi),N.useEffect(()=>{var ee;O&&((ee=se.current)==null||ee.focus())},[O]),N.useEffect(()=>{z(null)},[K.length]),N.useEffect(()=>{if(f&&P.current>=M.length){const ee=Math.max(0,M.length-1);P.current=ee,re(ee)}},[f,M.length]),N.useEffect(()=>{f&&M.length===0&&p()},[f,M.length,p]);const Yi=b!=="all"||v!=="all"||E!=="all",li=f&&M.length>0?M[L]:null;return A.jsxs("div",{style:{width:"100%",background:"#fafafa",display:"flex",flexDirection:"column",overflowY:"auto"},children:[i>0&&A.jsxs("div",{style:{padding:"6px 16px",background:"#fef3c7",borderBottom:"1px solid #fde68a",fontSize:"12px",color:"#92400e",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[A.jsxs("span",{children:[i," annotation",i!==1?"s":""," held"]}),A.jsx("button",{onClick:()=>s==null?void 0:s("all"),style:{fontSize:"11px",padding:"1px 8px",border:"1px solid #fbbf24",borderRadius:"4px",background:"#fff",color:"#92400e",cursor:"pointer",fontWeight:500},children:"Show all"})]}),A.jsx("div",{style:{padding:"12px 16px",borderBottom:"1px solid #e5e7eb"},children:A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[A.jsxs("h3",{style:{fontSize:"14px",fontWeight:600,margin:0},children:["Annotations",fe.length>0&&A.jsx("span",{style:{marginLeft:"8px",padding:"1px 6px",fontSize:"11px",background:"#6366f1",color:"white",borderRadius:"10px"},children:fe.length})]}),fe.length>0&&A.jsx("button",{"data-testid":"review-mode-btn",onClick:d,title:"Keyboard review mode (Ctrl+Shift+R)",style:{padding:"2px 8px",fontSize:"11px",border:`1px solid ${f?"#6366f1":"#d1d5db"}`,borderRadius:"3px",background:f?"#eef2ff":"#fff",color:f?"#6366f1":"#6b7280",cursor:"pointer",fontWeight:f?600:400},children:f?"Exit Review":"Review"})]})}),f&&M.length>0&&A.jsxs("div",{style:{padding:"8px 16px",background:"#eef2ff",borderBottom:"1px solid #e5e7eb",fontSize:"12px",color:"#4338ca"},children:[A.jsxs("div",{style:{fontWeight:600,marginBottom:"2px"},children:["Reviewing ",L+1," / ",M.length]}),A.jsx("div",{style:{color:"#6366f1"},children:"Tab: next · Shift+Tab: prev · Y: accept · N: dismiss · Z: undo · E: examine · Esc: exit"})]}),A.jsxs("div",{style:{padding:"8px 16px",borderBottom:"1px solid #e5e7eb",display:"flex",gap:"4px",flexWrap:"wrap",alignItems:"center"},children:[A.jsx(w0,{value:b,onChange:ee=>S(ee),options:[{value:"all",label:"All types"},{value:"highlight",label:"Highlights"},{value:"comment",label:"Comments"},{value:"suggestion",label:"Suggestions"},{value:"question",label:"Questions"},{value:"flag",label:"Flags"}]}),A.jsx(w0,{value:v,onChange:ee=>k(ee),options:[{value:"all",label:"Anyone"},{value:"claude",label:"Claude"},{value:"user",label:"You"},{value:"import",label:"Imported"}]}),A.jsx(w0,{value:E,onChange:ee=>j(ee),options:[{value:"all",label:"Any status"},{value:"pending",label:"Pending"},{value:"accepted",label:"Accepted"},{value:"dismissed",label:"Dismissed"}]}),Yi&&A.jsx("button",{onClick:()=>{S("all"),k("all"),j("all")},style:{background:"none",border:"none",color:"#6366f1",fontSize:"11px",cursor:"pointer",padding:"2px 4px"},children:"Clear"})]}),A.jsx("div",{style:{padding:"4px 16px 0"},children:A.jsx(x9,{annotations:t,activeDocFormat:o,documentId:c})}),K.length>1&&A.jsx("div",{style:{padding:"6px 16px",borderBottom:"1px solid #e5e7eb",display:"flex",gap:"6px",alignItems:"center"},children:O?(()=>{const ee=O==="accept";return A.jsxs(A.Fragment,{children:[A.jsxs("span",{style:{fontSize:"11px",color:"#374151"},children:[ee?"Accept":"Dismiss"," ",K.length===fe.length?`${K.length} annotations?`:`${K.length} of ${fe.length} pending?`]}),A.jsx("button",{ref:se,onClick:ee?Ge:Fe,style:{...Jd,background:ee?"#f0fdf4":"#fef2f2",color:ee?"#166534":"#991b1b",fontWeight:600},children:"Confirm"}),A.jsx("button",{onClick:()=>z(null),style:{...Jd,background:"#fff",color:"#6b7280"},children:"Cancel"})]})})():A.jsxs(A.Fragment,{children:[A.jsxs("button",{onClick:()=>z("accept"),style:{...Jd,background:"#f0fdf4",color:"#166534"},children:["Accept All (",K.length,")"]}),A.jsx("button",{onClick:()=>z("dismiss"),style:{...Jd,background:"#fef2f2",color:"#991b1b"},children:"Dismiss All"})]})}),A.jsx("div",{style:{padding:"8px 16px",flex:1},children:I.length===0?A.jsx("p",{style:{fontSize:"13px",color:"#9ca3af",marginTop:"8px"},children:Yi?"No annotations match filters.":"No annotations yet. Open a document to get started."}):A.jsxs(A.Fragment,{children:[K.map(ee=>A.jsx(xT,{annotation:ee,isReviewTarget:(li==null?void 0:li.id)===ee.id,onAccept:ne,onDismiss:me,onEdit:Oe,onClick:()=>ct(ee)},ee.id)),pe.length>0&&A.jsxs("details",{style:{marginTop:"12px"},children:[A.jsxs("summary",{style:{fontSize:"12px",color:"#9ca3af",cursor:"pointer"},children:[pe.length," resolved"]}),pe.map(ee=>A.jsx(xT,{annotation:ee,onUndo:ge,undoable:te.has(ee.id),onClick:()=>ct(ee)},ee.id))]})]})})]})}function k9(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const C9=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,E9=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,T9={};function ST(t,e){return(T9.jsx?E9:C9).test(t)}const A9=/[ \t\n\f\r]/g;function M9(t){return typeof t=="object"?t.type==="text"?wT(t.value):!1:wT(t)}function wT(t){return t.replace(A9,"")===""}class uf{constructor(e,n,i){this.normal=n,this.property=e,i&&(this.space=i)}}uf.prototype.normal={};uf.prototype.property={};uf.prototype.space=void 0;function bD(t,e){const n={},i={};for(const r of t)Object.assign(n,r.property),Object.assign(i,r.normal);return new uf(n,i,e)}function Vb(t){return t.toLowerCase()}class si{constructor(e,n){this.attribute=n,this.property=e}}si.prototype.attribute="";si.prototype.booleanish=!1;si.prototype.boolean=!1;si.prototype.commaOrSpaceSeparated=!1;si.prototype.commaSeparated=!1;si.prototype.defined=!1;si.prototype.mustUseProperty=!1;si.prototype.number=!1;si.prototype.overloadedBoolean=!1;si.prototype.property="";si.prototype.spaceSeparated=!1;si.prototype.space=void 0;let O9=0;const Ve=ao(),Gt=ao(),Pb=ao(),ae=ao(),Ct=ao(),ya=ao(),mi=ao();function ao(){return 2**++O9}const $b=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Gt,commaOrSpaceSeparated:mi,commaSeparated:ya,number:ae,overloadedBoolean:Pb,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),v0=Object.keys($b);class Cx extends si{constructor(e,n,i,r){let s=-1;if(super(e,n),vT(this,"space",r),typeof i=="number")for(;++s<v0.length;){const o=v0[s];vT(this,v0[s],(i&$b[o])===$b[o])}}}Cx.prototype.defined=!0;function vT(t,e,n){n&&(t[e]=n)}function qa(t){const e={},n={};for(const[i,r]of Object.entries(t.properties)){const s=new Cx(i,t.transform(t.attributes||{},i),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),e[i]=s,n[Vb(i)]=i,n[Vb(s.attribute)]=i}return new uf(e,n,t.space)}const xD=qa({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:Ct,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:ae,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:Ct,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:Gt,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function SD(t,e){return e in t?t[e]:e}function wD(t,e){return SD(t,e.toLowerCase())}const _9=qa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ya,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:Ct,autoFocus:Ve,autoPlay:Ve,blocking:Ct,capture:null,charSet:null,checked:Ve,cite:null,className:Ct,cols:ae,colSpan:null,content:null,contentEditable:Gt,controls:Ve,controlsList:Ct,coords:ae|ya,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:Pb,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:Ct,height:ae,hidden:Pb,high:ae,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:Ve,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ve,optimum:ae,pattern:null,ping:Ct,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:Ct,required:Ve,reversed:Ve,rows:ae,rowSpan:ae,sandbox:Ct,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Gt,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:wD}),D9=qa({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:mi,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:Ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ya,g2:ya,glyphName:ya,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:mi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ae,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mi,rev:mi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mi,requiredFeatures:mi,requiredFonts:mi,requiredFormats:mi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:mi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mi,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:SD}),vD=qa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),kD=qa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wD}),CD=qa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),N9={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},R9=/[A-Z]/g,kT=/-[a-z]/g,z9=/^data[-\w.:]+$/i;function L9(t,e){const n=Vb(e);let i=e,r=si;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&z9.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(kT,B9);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!kT.test(s)){let o=s.replace(R9,I9);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}r=Cx}return new r(i,e)}function I9(t){return"-"+t.toLowerCase()}function B9(t){return t.charAt(1).toUpperCase()}const j9=bD([xD,_9,vD,kD,CD],"html"),Ex=bD([xD,D9,vD,kD,CD],"svg");function U9(t){return t.join(" ").trim()}var Wo={},k0,CT;function H9(){if(CT)return k0;CT=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
|
|
256
|
+
${y.backupPath}`),alert(b.join(" "))}else alert("Changes applied successfully.")}catch(p){console.error("[ApplyChanges] Request failed:",p),alert(p instanceof TypeError?"Could not reach the server.":`Apply failed: ${p instanceof Error?p.message:String(p)}`)}finally{r(!1)}}}return A.jsx("button",{type:"button","data-testid":"apply-changes-btn",onClick:f,disabled:c,title:s.length===0?"No accepted suggestions to apply":void 0,style:{width:"100%",padding:"6px 12px",fontSize:"12px",fontWeight:500,border:"1px solid #bfdbfe",borderRadius:"4px",background:c?"#f3f4f6":"#2563eb",color:c?"#9ca3af":"white",cursor:c?"default":"pointer",opacity:i?.6:1,whiteSpace:"nowrap"},children:i?"Applying…":`Apply as Tracked Changes (${s.length})`})}function w0({value:t,onChange:e,options:n}){return A.jsx("select",{value:t,onChange:i=>e(i.target.value),style:{padding:"2px 4px",fontSize:"11px",border:"1px solid #e5e7eb",borderRadius:"3px",background:"#fff",color:"#374151",cursor:"pointer"},children:n.map(i=>A.jsx("option",{value:i.value,children:i.label},i.value))})}function S9(t,e){N.useEffect(()=>{function n(i){if(i.ctrlKey&&i.shiftKey&&i.key==="R"){i.preventDefault(),e.onToggleReviewMode();return}if(t)if(i.key==="Tab"&&!i.ctrlKey&&!i.altKey)i.preventDefault(),e.navigateReview(i.shiftKey?"prev":"next");else if(i.key==="y"||i.key==="Y"){if(i.target instanceof HTMLInputElement||i.target instanceof HTMLTextAreaElement)return;i.preventDefault(),e.acceptCurrent()}else if(i.key==="n"||i.key==="N"){if(i.target instanceof HTMLInputElement||i.target instanceof HTMLTextAreaElement)return;i.preventDefault(),e.dismissCurrent()}else if(i.key==="z"||i.key==="Z"){if(i.target instanceof HTMLInputElement||i.target instanceof HTMLTextAreaElement)return;i.preventDefault(),e.undoLast()}else if(i.key==="e"||i.key==="E"){if(i.target instanceof HTMLInputElement||i.target instanceof HTMLTextAreaElement)return;i.preventDefault(),e.scrollToCurrentAndExit()}else i.key==="Escape"&&e.cancelBulkOrExit()}return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t,e])}const Jd={padding:"2px 8px",fontSize:"11px",border:"1px solid #d1d5db",borderRadius:"3px",cursor:"pointer"};function w9(t,e,n){if(t.type!=="suggestion")return!1;let i;try{i=JSON.parse(t.content).newText}catch{return console.warn("[SidePanel] Malformed suggestion content for",t.id),!1}if(typeof i!="string")return!1;const r=vp(t,e.state.doc,n);if(!r)return console.warn("[SidePanel] Could not resolve range for suggestion",t.id),!1;try{e.chain().focus().deleteRange({from:r.from,to:r.to}).insertContentAt(r.from,i).run()}catch(s){return console.error("[SidePanel] Editor mutation failed for suggestion",t.id,s),!1}return!0}function v9({annotations:t,editor:e,ydoc:n,heldCount:i=0,interruptionMode:r,onModeChange:s,activeDocFormat:o,documentId:c,reviewMode:f,onToggleReviewMode:d,onExitReviewMode:p,activeAnnotationId:m,onActiveAnnotationChange:y}){const[b,S]=N.useState("all"),[v,k]=N.useState("all"),[E,j]=N.useState("all"),[L,re]=N.useState(0),P=N.useRef(0),[O,z]=N.useState(null),F=N.useRef(O);F.current=O;const se=N.useRef(null),[te,he]=N.useState(new Set),ce=N.useRef(null),Q=N.useRef(new Map);N.useEffect(()=>{const ee=Q.current;return()=>{for(const Le of ee.values())clearTimeout(Le)}},[]);const ie=N.useRef(n),Z=N.useRef(e);ie.current=n,Z.current=e;const{filtered:I,pending:K,resolved:pe,allPending:fe}=N.useMemo(()=>{const ee=[],Le=[];for(const ft of t){ft.status==="pending"&&Le.push(ft);const Y=b==="all"||ft.type===b,oe=v==="all"||ft.author===v,Se=E==="all"||ft.status===E;Y&&oe&&Se&&ee.push(ft)}const it=ee.filter(ft=>ft.status==="pending"),qe=ee.filter(ft=>ft.status!=="pending");return{filtered:ee,pending:it,resolved:qe,allPending:Le}},[t,b,v,E]),M=fe,_=N.useRef(M);_.current=M;function U(ee,Le){const it=ie.current;if(!it)return;const qe=it.getMap(oa),ft=qe.get(ee);if(!ft)return;if(qe.set(ee,{...ft,status:Le}),Le==="accepted"&&Z.current&&!w9(ft,Z.current,ie.current)){qe.set(ee,{...ft,status:"pending"});return}ce.current=ee,he(Se=>new Set(Se).add(ee));const Y=Q.current.get(ee);Y&&clearTimeout(Y);const oe=setTimeout(()=>{Q.current.delete(ee),he(Se=>{const Ue=new Set(Se);return Ue.delete(ee),Ue}),ce.current===ee&&(ce.current=null)},1e4);Q.current.set(ee,oe)}function T(ee){const Le=ie.current;if(!Le)return;const it=Le.getMap(oa),qe=it.get(ee);if(!qe||qe.status==="pending")return;if(qe.status==="accepted"&&qe.type==="suggestion"&&Z.current)try{const{newText:Y}=JSON.parse(qe.content),oe=qe.textSnapshot;if(typeof Y=="string"&&typeof oe=="string"){const Se=vp(qe,Z.current.state.doc,Le);if(!Se){console.warn(`[undo] Cannot resolve range for annotation ${ee}, skipping`);return}if(Z.current.state.doc.textBetween(Se.from,Se.to)!==Y){console.warn(`[undo] Text changed since accept for annotation ${ee}, skipping`);return}Z.current.chain().focus().deleteRange({from:Se.from,to:Se.to}).insertContentAt(Se.from,oe).run()}}catch(Y){console.warn(`[undo] Failed to revert text for annotation ${ee}:`,Y);return}it.set(ee,{...qe,status:"pending"});const ft=Q.current.get(ee);ft&&(clearTimeout(ft),Q.current.delete(ee)),he(Y=>{const oe=new Set(Y);return oe.delete(ee),oe}),ce.current===ee&&(ce.current=null)}function ne(ee){U(ee,"accepted")}function me(ee){U(ee,"dismissed")}function ge(ee){T(ee)}function Oe(ee,Le){const it=ie.current;if(!it)return;const qe=it.getMap(oa),ft=qe.get(ee);ft&&qe.set(ee,{...ft,content:Le,editedAt:Date.now()})}function Ge(){for(const ee of K)U(ee.id,"accepted");z(null)}function Fe(){for(const ee of K)U(ee.id,"dismissed");z(null)}const ct=N.useCallback(ee=>{const Le=Z.current;if(!Le)return;const it=vp(ee,Le.state.doc,ie.current);if(!it)return;Le.chain().focus().setTextSelection({from:it.from,to:it.to}).run();const qe=Le.view.domAtPos(it.from),ft=qe.node instanceof HTMLElement?qe.node:qe.node.parentElement;ft==null||ft.scrollIntoView({behavior:"smooth",block:"center"})},[]),Ce=N.useCallback(ee=>{const Le=_.current;if(Le.length===0)return;let it=P.current;it=ee==="next"?(it+1)%Le.length:(it-1+Le.length)%Le.length,P.current=it,re(it),ct(Le[it])},[ct]),Xe=N.useCallback(()=>{const ee=_.current;if(ee.length===0)return;const Le=ee[P.current];Le&&U(Le.id,"accepted")},[]),Ht=N.useCallback(()=>{const ee=_.current;if(ee.length===0)return;const Le=ee[P.current];Le&&U(Le.id,"dismissed")},[]),Nt=N.useRef(!1);N.useEffect(()=>{f&&!Nt.current&&M.length>0&&(P.current=0,re(0),ct(M[0])),Nt.current=f},[f,M,ct]),N.useEffect(()=>{var ee;f&&M.length>0?y(((ee=M[L])==null?void 0:ee.id)??null):y(null)},[f,L,M,y]);const je=N.useCallback(()=>{const Le=_.current[P.current];Le&&ct(Le),p()},[ct,p]),Fn=N.useCallback(()=>{const ee=ce.current;ee&&T(ee)},[]),Fi=N.useCallback(()=>{F.current?z(null):p()},[p]),qi=N.useMemo(()=>({onToggleReviewMode:d,onExitReviewMode:p,navigateReview:Ce,acceptCurrent:Xe,dismissCurrent:Ht,scrollToCurrentAndExit:je,cancelBulkOrExit:Fi,undoLast:Fn}),[d,p,Ce,Xe,Ht,je,Fi,Fn]);S9(f,qi),N.useEffect(()=>{var ee;O&&((ee=se.current)==null||ee.focus())},[O]),N.useEffect(()=>{z(null)},[K.length]),N.useEffect(()=>{if(f&&P.current>=M.length){const ee=Math.max(0,M.length-1);P.current=ee,re(ee)}},[f,M.length]),N.useEffect(()=>{f&&M.length===0&&p()},[f,M.length,p]);const Yi=b!=="all"||v!=="all"||E!=="all",li=f&&M.length>0?M[L]:null;return A.jsxs("div",{style:{width:"100%",background:"#fafafa",display:"flex",flexDirection:"column",overflowY:"auto"},children:[i>0&&A.jsxs("div",{style:{padding:"6px 16px",background:"#fef3c7",borderBottom:"1px solid #fde68a",fontSize:"12px",color:"#92400e",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[A.jsxs("span",{children:[i," annotation",i!==1?"s":""," held"]}),A.jsx("button",{onClick:()=>s==null?void 0:s("all"),style:{fontSize:"11px",padding:"1px 8px",border:"1px solid #fbbf24",borderRadius:"4px",background:"#fff",color:"#92400e",cursor:"pointer",fontWeight:500},children:"Show all"})]}),A.jsx("div",{style:{padding:"12px 16px",borderBottom:"1px solid #e5e7eb"},children:A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[A.jsxs("h3",{style:{fontSize:"14px",fontWeight:600,margin:0},children:["Annotations",fe.length>0&&A.jsx("span",{style:{marginLeft:"8px",padding:"1px 6px",fontSize:"11px",background:"#6366f1",color:"white",borderRadius:"10px"},children:fe.length})]}),fe.length>0&&A.jsx("button",{"data-testid":"review-mode-btn",onClick:d,title:"Keyboard review mode (Ctrl+Shift+R)",style:{padding:"2px 8px",fontSize:"11px",border:`1px solid ${f?"#6366f1":"#d1d5db"}`,borderRadius:"3px",background:f?"#eef2ff":"#fff",color:f?"#6366f1":"#6b7280",cursor:"pointer",fontWeight:f?600:400},children:f?"Exit Review":"Review"})]})}),f&&M.length>0&&A.jsxs("div",{style:{padding:"8px 16px",background:"#eef2ff",borderBottom:"1px solid #e5e7eb",fontSize:"12px",color:"#4338ca"},children:[A.jsxs("div",{style:{fontWeight:600,marginBottom:"2px"},children:["Reviewing ",L+1," / ",M.length]}),A.jsx("div",{style:{color:"#6366f1"},children:"Tab: next · Shift+Tab: prev · Y: accept · N: dismiss · Z: undo · E: examine · Esc: exit"})]}),A.jsxs("div",{style:{padding:"8px 16px",borderBottom:"1px solid #e5e7eb",display:"flex",gap:"4px",flexWrap:"wrap",alignItems:"center"},children:[A.jsx(w0,{value:b,onChange:ee=>S(ee),options:[{value:"all",label:"All types"},{value:"highlight",label:"Highlights"},{value:"comment",label:"Comments"},{value:"suggestion",label:"Suggestions"},{value:"question",label:"Questions"},{value:"flag",label:"Flags"}]}),A.jsx(w0,{value:v,onChange:ee=>k(ee),options:[{value:"all",label:"Anyone"},{value:"claude",label:"Claude"},{value:"user",label:"You"},{value:"import",label:"Imported"}]}),A.jsx(w0,{value:E,onChange:ee=>j(ee),options:[{value:"all",label:"Any status"},{value:"pending",label:"Pending"},{value:"accepted",label:"Accepted"},{value:"dismissed",label:"Dismissed"}]}),Yi&&A.jsx("button",{onClick:()=>{S("all"),k("all"),j("all")},style:{background:"none",border:"none",color:"#6366f1",fontSize:"11px",cursor:"pointer",padding:"2px 4px"},children:"Clear"})]}),A.jsx("div",{style:{padding:"4px 16px 0"},children:A.jsx(x9,{annotations:t,activeDocFormat:o,documentId:c})}),K.length>1&&A.jsx("div",{style:{padding:"6px 16px",borderBottom:"1px solid #e5e7eb",display:"flex",gap:"6px",alignItems:"center"},children:O?(()=>{const ee=O==="accept";return A.jsxs(A.Fragment,{children:[A.jsxs("span",{style:{fontSize:"11px",color:"#374151"},children:[ee?"Accept":"Dismiss"," ",K.length===fe.length?`${K.length} annotations?`:`${K.length} of ${fe.length} pending?`]}),A.jsx("button",{ref:se,onClick:ee?Ge:Fe,style:{...Jd,background:ee?"#f0fdf4":"#fef2f2",color:ee?"#166534":"#991b1b",fontWeight:600},children:"Confirm"}),A.jsx("button",{onClick:()=>z(null),style:{...Jd,background:"#fff",color:"#6b7280"},children:"Cancel"})]})})():A.jsxs(A.Fragment,{children:[A.jsxs("button",{onClick:()=>z("accept"),style:{...Jd,background:"#f0fdf4",color:"#166534"},children:["Accept All (",K.length,")"]}),A.jsx("button",{onClick:()=>z("dismiss"),style:{...Jd,background:"#fef2f2",color:"#991b1b"},children:"Dismiss All"})]})}),A.jsx("div",{style:{padding:"8px 16px",flex:1},children:I.length===0?A.jsx("p",{style:{fontSize:"13px",color:"#9ca3af",marginTop:"8px"},children:Yi?"No annotations match filters.":"No annotations yet. Open a document to get started."}):A.jsxs(A.Fragment,{children:[K.map(ee=>A.jsx(xT,{annotation:ee,isReviewTarget:(li==null?void 0:li.id)===ee.id,onAccept:ne,onDismiss:me,onEdit:Oe,onClick:()=>ct(ee)},ee.id)),pe.length>0&&A.jsxs("details",{style:{marginTop:"12px"},children:[A.jsxs("summary",{style:{fontSize:"12px",color:"#9ca3af",cursor:"pointer"},children:[pe.length," resolved"]}),pe.map(ee=>A.jsx(xT,{annotation:ee,onUndo:ge,undoable:te.has(ee.id),onClick:()=>ct(ee)},ee.id))]})]})})]})}function k9(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const C9=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,E9=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,T9={};function ST(t,e){return(T9.jsx?E9:C9).test(t)}const A9=/[ \t\n\f\r]/g;function M9(t){return typeof t=="object"?t.type==="text"?wT(t.value):!1:wT(t)}function wT(t){return t.replace(A9,"")===""}class uf{constructor(e,n,i){this.normal=n,this.property=e,i&&(this.space=i)}}uf.prototype.normal={};uf.prototype.property={};uf.prototype.space=void 0;function bD(t,e){const n={},i={};for(const r of t)Object.assign(n,r.property),Object.assign(i,r.normal);return new uf(n,i,e)}function Vb(t){return t.toLowerCase()}class si{constructor(e,n){this.attribute=n,this.property=e}}si.prototype.attribute="";si.prototype.booleanish=!1;si.prototype.boolean=!1;si.prototype.commaOrSpaceSeparated=!1;si.prototype.commaSeparated=!1;si.prototype.defined=!1;si.prototype.mustUseProperty=!1;si.prototype.number=!1;si.prototype.overloadedBoolean=!1;si.prototype.property="";si.prototype.spaceSeparated=!1;si.prototype.space=void 0;let O9=0;const Ve=ao(),Gt=ao(),Pb=ao(),ae=ao(),Ct=ao(),ya=ao(),mi=ao();function ao(){return 2**++O9}const $b=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:Gt,commaOrSpaceSeparated:mi,commaSeparated:ya,number:ae,overloadedBoolean:Pb,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),v0=Object.keys($b);class Cx extends si{constructor(e,n,i,r){let s=-1;if(super(e,n),vT(this,"space",r),typeof i=="number")for(;++s<v0.length;){const o=v0[s];vT(this,v0[s],(i&$b[o])===$b[o])}}}Cx.prototype.defined=!0;function vT(t,e,n){n&&(t[e]=n)}function qa(t){const e={},n={};for(const[i,r]of Object.entries(t.properties)){const s=new Cx(i,t.transform(t.attributes||{},i),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),e[i]=s,n[Vb(i)]=i,n[Vb(s.attribute)]=i}return new uf(e,n,t.space)}const xD=qa({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:Ct,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:ae,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:Ct,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:Gt,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function SD(t,e){return e in t?t[e]:e}function wD(t,e){return SD(t,e.toLowerCase())}const _9=qa({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ya,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:Ct,autoFocus:Ve,autoPlay:Ve,blocking:Ct,capture:null,charSet:null,checked:Ve,cite:null,className:Ct,cols:ae,colSpan:null,content:null,contentEditable:Gt,controls:Ve,controlsList:Ct,coords:ae|ya,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:Pb,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:Ct,height:ae,hidden:Pb,high:ae,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:Ve,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ve,optimum:ae,pattern:null,ping:Ct,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:Ct,required:Ve,reversed:Ve,rows:ae,rowSpan:ae,sandbox:Ct,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:Gt,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ve,disableRemotePlayback:Ve,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:wD}),D9=qa({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:mi,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:Ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ya,g2:ya,glyphName:ya,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:mi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ae,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:mi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:mi,rev:mi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:mi,requiredFeatures:mi,requiredFonts:mi,requiredFormats:mi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:mi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:mi,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:mi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:SD}),vD=qa({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),kD=qa({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wD}),CD=qa({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),N9={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},R9=/[A-Z]/g,kT=/-[a-z]/g,z9=/^data[-\w.:]+$/i;function L9(t,e){const n=Vb(e);let i=e,r=si;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&z9.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(kT,B9);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!kT.test(s)){let o=s.replace(R9,I9);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}r=Cx}return new r(i,e)}function I9(t){return"-"+t.toLowerCase()}function B9(t){return t.charAt(1).toUpperCase()}const j9=bD([xD,_9,vD,kD,CD],"html"),Ex=bD([xD,D9,vD,kD,CD],"svg");function U9(t){return t.join(" ").trim()}var Wo={},k0,CT;function H9(){if(CT)return k0;CT=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
|
|
257
257
|
`,d="/",p="*",m="",y="comment",b="declaration";function S(k,E){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];E=E||{};var j=1,L=1;function re(ie){var Z=ie.match(e);Z&&(j+=Z.length);var I=ie.lastIndexOf(f);L=~I?ie.length-I:L+ie.length}function P(){var ie={line:j,column:L};return function(Z){return Z.position=new O(ie),se(),Z}}function O(ie){this.start=ie,this.end={line:j,column:L},this.source=E.source}O.prototype.content=k;function z(ie){var Z=new Error(E.source+":"+j+":"+L+": "+ie);if(Z.reason=ie,Z.filename=E.source,Z.line=j,Z.column=L,Z.source=k,!E.silent)throw Z}function F(ie){var Z=ie.exec(k);if(Z){var I=Z[0];return re(I),k=k.slice(I.length),Z}}function se(){F(n)}function te(ie){var Z;for(ie=ie||[];Z=he();)Z!==!1&&ie.push(Z);return ie}function he(){var ie=P();if(!(d!=k.charAt(0)||p!=k.charAt(1))){for(var Z=2;m!=k.charAt(Z)&&(p!=k.charAt(Z)||d!=k.charAt(Z+1));)++Z;if(Z+=2,m===k.charAt(Z-1))return z("End of comment missing");var I=k.slice(2,Z-2);return L+=2,re(I),k=k.slice(Z),L+=2,ie({type:y,comment:I})}}function ce(){var ie=P(),Z=F(i);if(Z){if(he(),!F(r))return z("property missing ':'");var I=F(s),K=ie({type:b,property:v(Z[0].replace(t,m)),value:I?v(I[0].replace(t,m)):m});return F(o),K}}function Q(){var ie=[];te(ie);for(var Z;Z=ce();)Z!==!1&&(ie.push(Z),te(ie));return ie}return se(),Q()}function v(k){return k?k.replace(c,m):m}return k0=S,k0}var ET;function V9(){if(ET)return Wo;ET=1;var t=Wo&&Wo.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.default=n;const e=t(H9());function n(i,r){let s=null;if(!i||typeof i!="string")return s;const o=(0,e.default)(i),c=typeof r=="function";return o.forEach(f=>{if(f.type!=="declaration")return;const{property:d,value:p}=f;c?r(d,p,f):p&&(s=s||{},s[d]=p)}),s}return Wo}var $c={},TT;function P9(){if(TT)return $c;TT=1,Object.defineProperty($c,"__esModule",{value:!0}),$c.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,r=/^-(ms)-/,s=function(d){return!d||n.test(d)||t.test(d)},o=function(d,p){return p.toUpperCase()},c=function(d,p){return"".concat(p,"-")},f=function(d,p){return p===void 0&&(p={}),s(d)?d:(d=d.toLowerCase(),p.reactCompat?d=d.replace(r,c):d=d.replace(i,c),d.replace(e,o))};return $c.camelCase=f,$c}var Fc,AT;function $9(){if(AT)return Fc;AT=1;var t=Fc&&Fc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},e=t(V9()),n=P9();function i(r,s){var o={};return!r||typeof r!="string"||(0,e.default)(r,function(c,f){c&&f&&(o[(0,n.camelCase)(c,s)]=f)}),o}return i.default=i,Fc=i,Fc}var F9=$9();const q9=zp(F9),ED=TD("end"),Tx=TD("start");function TD(t){return e;function e(n){const i=n&&n.position&&n.position[t]||{};if(typeof i.line=="number"&&i.line>0&&typeof i.column=="number"&&i.column>0)return{line:i.line,column:i.column,offset:typeof i.offset=="number"&&i.offset>-1?i.offset:void 0}}}function Y9(t){const e=Tx(t),n=ED(t);if(e&&n)return{start:e,end:n}}function fu(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?MT(t.position):"start"in t||"end"in t?MT(t):"line"in t||"column"in t?Fb(t):""}function Fb(t){return OT(t&&t.line)+":"+OT(t&&t.column)}function MT(t){return Fb(t&&t.start)+"-"+Fb(t&&t.end)}function OT(t){return t&&typeof t=="number"?t:1}class zn extends Error{constructor(e,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let r="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?r=e:!s.cause&&e&&(o=!0,r=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof i=="string"){const f=i.indexOf(":");f===-1?s.ruleId=i:(s.source=i.slice(0,f),s.ruleId=i.slice(f+1))}if(!s.place&&s.ancestors&&s.ancestors){const f=s.ancestors[s.ancestors.length-1];f&&(s.place=f.position)}const c=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=c?c.line:void 0,this.name=fu(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}zn.prototype.file="";zn.prototype.name="";zn.prototype.reason="";zn.prototype.message="";zn.prototype.stack="";zn.prototype.column=void 0;zn.prototype.line=void 0;zn.prototype.ancestors=void 0;zn.prototype.cause=void 0;zn.prototype.fatal=void 0;zn.prototype.place=void 0;zn.prototype.ruleId=void 0;zn.prototype.source=void 0;const Ax={}.hasOwnProperty,K9=new Map,G9=/[A-Z]/g,Z9=new Set(["table","tbody","thead","tfoot","tr"]),J9=new Set(["td","th"]),AD="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function X9(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let i;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");i=sV(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");i=rV(n,e.jsx,e.jsxs)}const r={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:i,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Ex:j9,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=MD(r,t,void 0);return s&&typeof s!="string"?s:r.create(t,r.Fragment,{children:s||void 0},void 0)}function MD(t,e,n){if(e.type==="element")return W9(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Q9(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return tV(t,e,n);if(e.type==="mdxjsEsm")return eV(t,e);if(e.type==="root")return nV(t,e,n);if(e.type==="text")return iV(t,e)}function W9(t,e,n){const i=t.schema;let r=i;e.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Ex,t.schema=r),t.ancestors.push(e);const s=_D(t,e.tagName,!1),o=lV(t,e);let c=Ox(t,e);return Z9.has(e.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!M9(f):!0})),OD(t,o,s,e),Mx(o,c),t.ancestors.pop(),t.schema=i,t.create(e,s,o,n)}function Q9(t,e){if(e.data&&e.data.estree&&t.evaluater){const i=e.data.estree.body[0];return i.type,t.evaluater.evaluateExpression(i.expression)}Yu(t,e.position)}function eV(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);Yu(t,e.position)}function tV(t,e,n){const i=t.schema;let r=i;e.name==="svg"&&i.space==="html"&&(r=Ex,t.schema=r),t.ancestors.push(e);const s=e.name===null?t.Fragment:_D(t,e.name,!0),o=oV(t,e),c=Ox(t,e);return OD(t,o,s,e),Mx(o,c),t.ancestors.pop(),t.schema=i,t.create(e,s,o,n)}function nV(t,e,n){const i={};return Mx(i,Ox(t,e)),t.create(e,t.Fragment,i,n)}function iV(t,e){return e.value}function OD(t,e,n,i){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=i)}function Mx(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function rV(t,e,n){return i;function i(r,s,o,c){const d=Array.isArray(o.children)?n:e;return c?d(s,o,c):d(s,o)}}function sV(t,e){return n;function n(i,r,s,o){const c=Array.isArray(s.children),f=Tx(i);return e(r,s,o,c,{columnNumber:f?f.column-1:void 0,fileName:t,lineNumber:f?f.line:void 0},void 0)}}function lV(t,e){const n={};let i,r;for(r in e.properties)if(r!=="children"&&Ax.call(e.properties,r)){const s=aV(t,r,e.properties[r]);if(s){const[o,c]=s;t.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&J9.has(e.tagName)?i=c:n[o]=c}}if(i){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=i}return n}function oV(t,e){const n={};for(const i of e.attributes)if(i.type==="mdxJsxExpressionAttribute")if(i.data&&i.data.estree&&t.evaluater){const s=i.data.estree.body[0];s.type;const o=s.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,t.evaluater.evaluateExpression(c.argument))}else Yu(t,e.position);else{const r=i.name;let s;if(i.value&&typeof i.value=="object")if(i.value.data&&i.value.data.estree&&t.evaluater){const c=i.value.data.estree.body[0];c.type,s=t.evaluater.evaluateExpression(c.expression)}else Yu(t,e.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function Ox(t,e){const n=[];let i=-1;const r=t.passKeys?new Map:K9;for(;++i<e.children.length;){const s=e.children[i];let o;if(t.passKeys){const f=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(f){const d=r.get(f)||0;o=f+"-"+d,r.set(f,d+1)}}const c=MD(t,s,o);c!==void 0&&n.push(c)}return n}function aV(t,e,n){const i=L9(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=i.commaSeparated?k9(n):U9(n)),i.property==="style"){let r=typeof n=="object"?n:cV(t,String(n));return t.stylePropertyNameCase==="css"&&(r=uV(r)),["style",r]}return[t.elementAttributeNameCase==="react"&&i.space?N9[i.property]||i.property:i.attribute,n]}}function cV(t,e){try{return q9(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const i=n,r=new zn("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=AD+"#cannot-parse-style-attribute",r}}function _D(t,e,n){let i;if(!n)i={type:"Literal",value:e};else if(e.includes(".")){const r=e.split(".");let s=-1,o;for(;++s<r.length;){const c=ST(r[s])?{type:"Identifier",name:r[s]}:{type:"Literal",value:r[s]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(s&&c.type==="Literal"),optional:!1}:c}i=o}else i=ST(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(i.type==="Literal"){const r=i.value;return Ax.call(t.components,r)?t.components[r]:r}if(t.evaluater)return t.evaluater.evaluateExpression(i);Yu(t)}function Yu(t,e){const n=new zn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=AD+"#cannot-handle-mdx-estrees-without-createevaluater",n}function uV(t){const e={};let n;for(n in t)Ax.call(t,n)&&(e[fV(n)]=t[n]);return e}function fV(t){let e=t.replace(G9,dV);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function dV(t){return"-"+t.toLowerCase()}const C0={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},hV={};function pV(t,e){const n=hV,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return DD(t,i,r)}function DD(t,e,n){if(mV(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return _T(t.children,e,n)}return Array.isArray(t)?_T(t,e,n):""}function _T(t,e,n){const i=[];let r=-1;for(;++r<t.length;)i[r]=DD(t[r],e,n);return i.join("")}function mV(t){return!!(t&&typeof t=="object")}const DT=document.createElement("i");function _x(t){const e="&"+t+";";DT.innerHTML=e;const n=DT.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function Cr(t,e,n,i){const r=t.length;let s=0,o;if(e<0?e=-e>r?0:r+e:e=e>r?r:e,n=n>0?n:0,i.length<1e4)o=Array.from(i),o.unshift(e,n),t.splice(...o);else for(n&&t.splice(e,n);s<i.length;)o=i.slice(s,s+1e4),o.unshift(e,0),t.splice(...o),s+=1e4,e+=1e4}function Li(t,e){return t.length>0?(Cr(t,t.length,0,e),t):e}const NT={}.hasOwnProperty;function gV(t){const e={};let n=-1;for(;++n<t.length;)yV(e,t[n]);return e}function yV(t,e){let n;for(n in e){const r=(NT.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let o;if(s)for(o in s){NT.call(r,o)||(r[o]=[]);const c=s[o];bV(r[o],Array.isArray(c)?c:c?[c]:[])}}}function bV(t,e){let n=-1;const i=[];for(;++n<e.length;)(e[n].add==="after"?t:i).push(e[n]);Cr(t,0,0,i)}function ND(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ba(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pr=fl(/[A-Za-z]/),Si=fl(/[\dA-Za-z]/),xV=fl(/[#-'*+\--9=?A-Z^-~]/);function qb(t){return t!==null&&(t<32||t===127)}const Yb=fl(/\d/),SV=fl(/[\dA-Fa-f]/),wV=fl(/[!-/:-@[-`{-~]/);function De(t){return t!==null&&t<-2}function ri(t){return t!==null&&(t<0||t===32)}function at(t){return t===-2||t===-1||t===32}const vV=fl(new RegExp("\\p{P}|\\p{S}","u")),kV=fl(/\s/);function fl(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Ya(t){const e=[];let n=-1,i=0,r=0;for(;++n<t.length;){const s=t.charCodeAt(n);let o="";if(s===37&&Si(t.charCodeAt(n+1))&&Si(t.charCodeAt(n+2)))r=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const c=t.charCodeAt(n+1);s<56320&&c>56319&&c<57344?(o=String.fromCharCode(s,c),r=1):o="�"}else o=String.fromCharCode(s);o&&(e.push(t.slice(i,n),encodeURIComponent(o)),i=n+r+1,o=""),r&&(n+=r,r=0)}return e.join("")+t.slice(i)}function Et(t,e,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(f){return at(f)?(t.enter(n),c(f)):e(f)}function c(f){return at(f)&&s++<r?(t.consume(f),c):(t.exit(n),e(f))}}const CV={tokenize:EV};function EV(t){const e=t.attempt(this.parser.constructs.contentInitial,i,r);let n;return e;function i(c){if(c===null){t.consume(c);return}return t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),Et(t,e,"linePrefix")}function r(c){return t.enter("paragraph"),s(c)}function s(c){const f=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,o(c)}function o(c){if(c===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(c);return}return De(c)?(t.consume(c),t.exit("chunkText"),s):(t.consume(c),o)}}const TV={tokenize:AV},RT={tokenize:MV};function AV(t){const e=this,n=[];let i=0,r,s,o;return c;function c(L){if(i<n.length){const re=n[i];return e.containerState=re[1],t.attempt(re[0].continuation,f,d)(L)}return d(L)}function f(L){if(i++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,r&&j();const re=e.events.length;let P=re,O;for(;P--;)if(e.events[P][0]==="exit"&&e.events[P][1].type==="chunkFlow"){O=e.events[P][1].end;break}E(i);let z=re;for(;z<e.events.length;)e.events[z][1].end={...O},z++;return Cr(e.events,P+1,0,e.events.slice(re)),e.events.length=z,d(L)}return c(L)}function d(L){if(i===n.length){if(!r)return y(L);if(r.currentConstruct&&r.currentConstruct.concrete)return S(L);e.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(RT,p,m)(L)}function p(L){return r&&j(),E(i),y(L)}function m(L){return e.parser.lazy[e.now().line]=i!==n.length,o=e.now().offset,S(L)}function y(L){return e.containerState={},t.attempt(RT,b,S)(L)}function b(L){return i++,n.push([e.currentConstruct,e.containerState]),y(L)}function S(L){if(L===null){r&&j(),E(0),t.consume(L);return}return r=r||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:s}),v(L)}function v(L){if(L===null){k(t.exit("chunkFlow"),!0),E(0),t.consume(L);return}return De(L)?(t.consume(L),k(t.exit("chunkFlow")),i=0,e.interrupt=void 0,c):(t.consume(L),v)}function k(L,re){const P=e.sliceStream(L);if(re&&P.push(null),L.previous=s,s&&(s.next=L),s=L,r.defineSkip(L.start),r.write(P),e.parser.lazy[L.start.line]){let O=r.events.length;for(;O--;)if(r.events[O][1].start.offset<o&&(!r.events[O][1].end||r.events[O][1].end.offset>o))return;const z=e.events.length;let F=z,se,te;for(;F--;)if(e.events[F][0]==="exit"&&e.events[F][1].type==="chunkFlow"){if(se){te=e.events[F][1].end;break}se=!0}for(E(i),O=z;O<e.events.length;)e.events[O][1].end={...te},O++;Cr(e.events,F+1,0,e.events.slice(z)),e.events.length=O}}function E(L){let re=n.length;for(;re-- >L;){const P=n[re];e.containerState=P[1],P[0].exit.call(e,t)}n.length=L}function j(){r.write([null]),s=void 0,r=void 0,e.containerState._closeFlow=void 0}}function MV(t,e,n){return Et(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function zT(t){if(t===null||ri(t)||kV(t))return 1;if(vV(t))return 2}function Dx(t,e,n){const i=[];let r=-1;for(;++r<t.length;){const s=t[r].resolveAll;s&&!i.includes(s)&&(e=s(e,n),i.push(s))}return e}const Kb={name:"attention",resolveAll:OV,tokenize:_V};function OV(t,e){let n=-1,i,r,s,o,c,f,d,p;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(i=n;i--;)if(t[i][0]==="exit"&&t[i][1].type==="attentionSequence"&&t[i][1]._open&&e.sliceSerialize(t[i][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[i][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[i][1].end.offset-t[i][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;f=t[i][1].end.offset-t[i][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const m={...t[i][1].end},y={...t[n][1].start};LT(m,-f),LT(y,f),o={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...t[i][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:y},s={type:f>1?"strongText":"emphasisText",start:{...t[i][1].end},end:{...t[n][1].start}},r={type:f>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},t[i][1].end={...o.start},t[n][1].start={...c.end},d=[],t[i][1].end.offset-t[i][1].start.offset&&(d=Li(d,[["enter",t[i][1],e],["exit",t[i][1],e]])),d=Li(d,[["enter",r,e],["enter",o,e],["exit",o,e],["enter",s,e]]),d=Li(d,Dx(e.parser.constructs.insideSpan.null,t.slice(i+1,n),e)),d=Li(d,[["exit",s,e],["enter",c,e],["exit",c,e],["exit",r,e]]),t[n][1].end.offset-t[n][1].start.offset?(p=2,d=Li(d,[["enter",t[n][1],e],["exit",t[n][1],e]])):p=0,Cr(t,i-1,n-i+3,d),n=i+d.length-p-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function _V(t,e){const n=this.parser.constructs.attentionMarkers.null,i=this.previous,r=zT(i);let s;return o;function o(f){return s=f,t.enter("attentionSequence"),c(f)}function c(f){if(f===s)return t.consume(f),c;const d=t.exit("attentionSequence"),p=zT(f),m=!p||p===2&&r||n.includes(f),y=!r||r===2&&p||n.includes(i);return d._open=!!(s===42?m:m&&(r||!y)),d._close=!!(s===42?y:y&&(p||!m)),e(f)}}function LT(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const DV={name:"autolink",tokenize:NV};function NV(t,e,n){let i=0;return r;function r(b){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(b){return pr(b)?(t.consume(b),o):b===64?n(b):d(b)}function o(b){return b===43||b===45||b===46||Si(b)?(i=1,c(b)):d(b)}function c(b){return b===58?(t.consume(b),i=0,f):(b===43||b===45||b===46||Si(b))&&i++<32?(t.consume(b),c):(i=0,d(b))}function f(b){return b===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),e):b===null||b===32||b===60||qb(b)?n(b):(t.consume(b),f)}function d(b){return b===64?(t.consume(b),p):xV(b)?(t.consume(b),d):n(b)}function p(b){return Si(b)?m(b):n(b)}function m(b){return b===46?(t.consume(b),i=0,p):b===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(b),t.exit("autolinkMarker"),t.exit("autolink"),e):y(b)}function y(b){if((b===45||Si(b))&&i++<63){const S=b===45?y:m;return t.consume(b),S}return n(b)}}const um={partial:!0,tokenize:RV};function RV(t,e,n){return i;function i(s){return at(s)?Et(t,r,"linePrefix")(s):r(s)}function r(s){return s===null||De(s)?e(s):n(s)}}const RD={continuation:{tokenize:LV},exit:IV,name:"blockQuote",tokenize:zV};function zV(t,e,n){const i=this;return r;function r(o){if(o===62){const c=i.containerState;return c.open||(t.enter("blockQuote",{_container:!0}),c.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(o),t.exit("blockQuoteMarker"),s}return n(o)}function s(o){return at(o)?(t.enter("blockQuotePrefixWhitespace"),t.consume(o),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(o))}}function LV(t,e,n){const i=this;return r;function r(o){return at(o)?Et(t,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return t.attempt(RD,e,n)(o)}}function IV(t){t.exit("blockQuote")}const zD={name:"characterEscape",tokenize:BV};function BV(t,e,n){return i;function i(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),r}function r(s){return wV(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const LD={name:"characterReference",tokenize:jV};function jV(t,e,n){const i=this;let r=0,s,o;return c;function c(m){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),f}function f(m){return m===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(m),t.exit("characterReferenceMarkerNumeric"),d):(t.enter("characterReferenceValue"),s=31,o=Si,p(m))}function d(m){return m===88||m===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(m),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,o=SV,p):(t.enter("characterReferenceValue"),s=7,o=Yb,p(m))}function p(m){if(m===59&&r){const y=t.exit("characterReferenceValue");return o===Si&&!_x(i.sliceSerialize(y))?n(m):(t.enter("characterReferenceMarker"),t.consume(m),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return o(m)&&r++<s?(t.consume(m),p):n(m)}}const IT={partial:!0,tokenize:HV},BT={concrete:!0,name:"codeFenced",tokenize:UV};function UV(t,e,n){const i=this,r={partial:!0,tokenize:P};let s=0,o=0,c;return f;function f(O){return d(O)}function d(O){const z=i.events[i.events.length-1];return s=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,c=O,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),p(O)}function p(O){return O===c?(o++,t.consume(O),p):o<3?n(O):(t.exit("codeFencedFenceSequence"),at(O)?Et(t,m,"whitespace")(O):m(O))}function m(O){return O===null||De(O)?(t.exit("codeFencedFence"),i.interrupt?e(O):t.check(IT,v,re)(O)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),y(O))}function y(O){return O===null||De(O)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),m(O)):at(O)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Et(t,b,"whitespace")(O)):O===96&&O===c?n(O):(t.consume(O),y)}function b(O){return O===null||De(O)?m(O):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),S(O))}function S(O){return O===null||De(O)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),m(O)):O===96&&O===c?n(O):(t.consume(O),S)}function v(O){return t.attempt(r,re,k)(O)}function k(O){return t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),E}function E(O){return s>0&&at(O)?Et(t,j,"linePrefix",s+1)(O):j(O)}function j(O){return O===null||De(O)?t.check(IT,v,re)(O):(t.enter("codeFlowValue"),L(O))}function L(O){return O===null||De(O)?(t.exit("codeFlowValue"),j(O)):(t.consume(O),L)}function re(O){return t.exit("codeFenced"),e(O)}function P(O,z,F){let se=0;return te;function te(Z){return O.enter("lineEnding"),O.consume(Z),O.exit("lineEnding"),he}function he(Z){return O.enter("codeFencedFence"),at(Z)?Et(O,ce,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):ce(Z)}function ce(Z){return Z===c?(O.enter("codeFencedFenceSequence"),Q(Z)):F(Z)}function Q(Z){return Z===c?(se++,O.consume(Z),Q):se>=o?(O.exit("codeFencedFenceSequence"),at(Z)?Et(O,ie,"whitespace")(Z):ie(Z)):F(Z)}function ie(Z){return Z===null||De(Z)?(O.exit("codeFencedFence"),z(Z)):F(Z)}}}function HV(t,e,n){const i=this;return r;function r(o){return o===null?n(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s)}function s(o){return i.parser.lazy[i.now().line]?n(o):e(o)}}const E0={name:"codeIndented",tokenize:PV},VV={partial:!0,tokenize:$V};function PV(t,e,n){const i=this;return r;function r(d){return t.enter("codeIndented"),Et(t,s,"linePrefix",5)(d)}function s(d){const p=i.events[i.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?f(d):De(d)?t.attempt(VV,o,f)(d):(t.enter("codeFlowValue"),c(d))}function c(d){return d===null||De(d)?(t.exit("codeFlowValue"),o(d)):(t.consume(d),c)}function f(d){return t.exit("codeIndented"),e(d)}}function $V(t,e,n){const i=this;return r;function r(o){return i.parser.lazy[i.now().line]?n(o):De(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r):Et(t,s,"linePrefix",5)(o)}function s(o){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(o):De(o)?r(o):n(o)}}const FV={name:"codeText",previous:YV,resolve:qV,tokenize:KV};function qV(t){let e=t.length-4,n=3,i,r;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(i=n;++i<e;)if(t[i][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(i=n-1,e++;++i<=e;)r===void 0?i!==e&&t[i][1].type!=="lineEnding"&&(r=i):(i===e||t[i][1].type==="lineEnding")&&(t[r][1].type="codeTextData",i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),e-=i-r-2,i=r+2),r=void 0);return t}function YV(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function KV(t,e,n){let i=0,r,s;return o;function o(m){return t.enter("codeText"),t.enter("codeTextSequence"),c(m)}function c(m){return m===96?(t.consume(m),i++,c):(t.exit("codeTextSequence"),f(m))}function f(m){return m===null?n(m):m===32?(t.enter("space"),t.consume(m),t.exit("space"),f):m===96?(s=t.enter("codeTextSequence"),r=0,p(m)):De(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),f):(t.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||De(m)?(t.exit("codeTextData"),f(m)):(t.consume(m),d)}function p(m){return m===96?(t.consume(m),r++,p):r===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(m)):(s.type="codeTextData",d(m))}}class GV{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const i=n??Number.POSITIVE_INFINITY;return i<this.left.length?this.left.slice(e,i):e>this.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(e,n,i){const r=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return i&&qc(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),qc(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),qc(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);qc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);qc(this.left,n.reverse())}}}function qc(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function ID(t){const e={};let n=-1,i,r,s,o,c,f,d;const p=new GV(t);for(;++n<p.length;){for(;n in e;)n=e[n];if(i=p.get(n),n&&i[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(f=i[1]._tokenizer.events,s=0,s<f.length&&f[s][1].type==="lineEndingBlank"&&(s+=2),s<f.length&&f[s][1].type==="content"))for(;++s<f.length&&f[s][1].type!=="content";)f[s][1].type==="chunkText"&&(f[s][1]._isInFirstContentOfListItem=!0,s++);if(i[0]==="enter")i[1].contentType&&(Object.assign(e,ZV(p,n)),n=e[n],d=!0);else if(i[1]._container){for(s=n,r=void 0;s--;)if(o=p.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(r&&(p.get(r)[1].type="lineEndingBlank"),o[1].type="lineEnding",r=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;r&&(i[1].end={...p.get(r)[1].start},c=p.slice(r,n),c.unshift(i),p.splice(r,n-r+1,c))}}return Cr(t,0,Number.POSITIVE_INFINITY,p.slice(0)),!d}function ZV(t,e){const n=t.get(e)[1],i=t.get(e)[2];let r=e-1;const s=[];let o=n._tokenizer;o||(o=i.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,f=[],d={};let p,m,y=-1,b=n,S=0,v=0;const k=[v];for(;b;){for(;t.get(++r)[1]!==b;);s.push(r),b._tokenizer||(p=i.sliceStream(b),b.next||p.push(null),m&&o.defineSkip(b.start),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),b._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(v=y+1,k.push(v),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(o.events=[],b?(b._tokenizer=void 0,b.previous=void 0):k.pop(),y=k.length;y--;){const E=c.slice(k[y],k[y+1]),j=s.pop();f.push([j,j+E.length-1]),t.splice(j,2,E)}for(f.reverse(),y=-1;++y<f.length;)d[S+f[y][0]]=S+f[y][1],S+=f[y][1]-f[y][0]-1;return d}const JV={resolve:WV,tokenize:QV},XV={partial:!0,tokenize:e7};function WV(t){return ID(t),t}function QV(t,e){let n;return i;function i(c){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),r(c)}function r(c){return c===null?s(c):De(c)?t.check(XV,o,s)(c):(t.consume(c),r)}function s(c){return t.exit("chunkContent"),t.exit("content"),e(c)}function o(c){return t.consume(c),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function e7(t,e,n){const i=this;return r;function r(o){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Et(t,s,"linePrefix")}function s(o){if(o===null||De(o))return n(o);const c=i.events[i.events.length-1];return!i.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?e(o):t.interrupt(i.parser.constructs.flow,n,e)(o)}}function BD(t,e,n,i,r,s,o,c,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(E){return E===60?(t.enter(i),t.enter(r),t.enter(s),t.consume(E),t.exit(s),y):E===null||E===32||E===41||qb(E)?n(E):(t.enter(i),t.enter(o),t.enter(c),t.enter("chunkString",{contentType:"string"}),v(E))}function y(E){return E===62?(t.enter(s),t.consume(E),t.exit(s),t.exit(r),t.exit(i),e):(t.enter(c),t.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===62?(t.exit("chunkString"),t.exit(c),y(E)):E===null||E===60||De(E)?n(E):(t.consume(E),E===92?S:b)}function S(E){return E===60||E===62||E===92?(t.consume(E),b):b(E)}function v(E){return!p&&(E===null||E===41||ri(E))?(t.exit("chunkString"),t.exit(c),t.exit(o),t.exit(i),e(E)):p<d&&E===40?(t.consume(E),p++,v):E===41?(t.consume(E),p--,v):E===null||E===32||E===40||qb(E)?n(E):(t.consume(E),E===92?k:v)}function k(E){return E===40||E===41||E===92?(t.consume(E),v):v(E)}}function jD(t,e,n,i,r,s){const o=this;let c=0,f;return d;function d(b){return t.enter(i),t.enter(r),t.consume(b),t.exit(r),t.enter(s),p}function p(b){return c>999||b===null||b===91||b===93&&!f||b===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(b):b===93?(t.exit(s),t.enter(r),t.consume(b),t.exit(r),t.exit(i),e):De(b)?(t.enter("lineEnding"),t.consume(b),t.exit("lineEnding"),p):(t.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||De(b)||c++>999?(t.exit("chunkString"),p(b)):(t.consume(b),f||(f=!at(b)),b===92?y:m)}function y(b){return b===91||b===92||b===93?(t.consume(b),c++,m):m(b)}}function UD(t,e,n,i,r,s){let o;return c;function c(y){return y===34||y===39||y===40?(t.enter(i),t.enter(r),t.consume(y),t.exit(r),o=y===40?41:y,f):n(y)}function f(y){return y===o?(t.enter(r),t.consume(y),t.exit(r),t.exit(i),e):(t.enter(s),d(y))}function d(y){return y===o?(t.exit(s),f(o)):y===null?n(y):De(y)?(t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),Et(t,d,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===o||y===null||De(y)?(t.exit("chunkString"),d(y)):(t.consume(y),y===92?m:p)}function m(y){return y===o||y===92?(t.consume(y),p):p(y)}}function du(t,e){let n;return i;function i(r){return De(r)?(t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),n=!0,i):at(r)?Et(t,i,n?"linePrefix":"lineSuffix")(r):e(r)}}const t7={name:"definition",tokenize:i7},n7={partial:!0,tokenize:r7};function i7(t,e,n){const i=this;let r;return s;function s(b){return t.enter("definition"),o(b)}function o(b){return jD.call(i,t,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function c(b){return r=ba(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),b===58?(t.enter("definitionMarker"),t.consume(b),t.exit("definitionMarker"),f):n(b)}function f(b){return ri(b)?du(t,d)(b):d(b)}function d(b){return BD(t,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function p(b){return t.attempt(n7,m,m)(b)}function m(b){return at(b)?Et(t,y,"whitespace")(b):y(b)}function y(b){return b===null||De(b)?(t.exit("definition"),i.parser.defined.push(r),e(b)):n(b)}}function r7(t,e,n){return i;function i(c){return ri(c)?du(t,r)(c):n(c)}function r(c){return UD(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function s(c){return at(c)?Et(t,o,"whitespace")(c):o(c)}function o(c){return c===null||De(c)?e(c):n(c)}}const s7={name:"hardBreakEscape",tokenize:l7};function l7(t,e,n){return i;function i(s){return t.enter("hardBreakEscape"),t.consume(s),r}function r(s){return De(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const o7={name:"headingAtx",resolve:a7,tokenize:c7};function a7(t,e){let n=t.length-2,i=3,r,s;return t[i][1].type==="whitespace"&&(i+=2),n-2>i&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&t[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(r={type:"atxHeadingText",start:t[i][1].start,end:t[n][1].end},s={type:"chunkText",start:t[i][1].start,end:t[n][1].end,contentType:"text"},Cr(t,i,n-i+1,[["enter",r,e],["enter",s,e],["exit",s,e],["exit",r,e]])),t}function c7(t,e,n){let i=0;return r;function r(p){return t.enter("atxHeading"),s(p)}function s(p){return t.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&i++<6?(t.consume(p),o):p===null||ri(p)?(t.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(t.enter("atxHeadingSequence"),f(p)):p===null||De(p)?(t.exit("atxHeading"),e(p)):at(p)?Et(t,c,"whitespace")(p):(t.enter("atxHeadingText"),d(p))}function f(p){return p===35?(t.consume(p),f):(t.exit("atxHeadingSequence"),c(p))}function d(p){return p===null||p===35||ri(p)?(t.exit("atxHeadingText"),c(p)):(t.consume(p),d)}}const u7=["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"],jT=["pre","script","style","textarea"],f7={concrete:!0,name:"htmlFlow",resolveTo:p7,tokenize:m7},d7={partial:!0,tokenize:y7},h7={partial:!0,tokenize:g7};function p7(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function m7(t,e,n){const i=this;let r,s,o,c,f;return d;function d(T){return p(T)}function p(T){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(T),m}function m(T){return T===33?(t.consume(T),y):T===47?(t.consume(T),s=!0,v):T===63?(t.consume(T),r=3,i.interrupt?e:M):pr(T)?(t.consume(T),o=String.fromCharCode(T),k):n(T)}function y(T){return T===45?(t.consume(T),r=2,b):T===91?(t.consume(T),r=5,c=0,S):pr(T)?(t.consume(T),r=4,i.interrupt?e:M):n(T)}function b(T){return T===45?(t.consume(T),i.interrupt?e:M):n(T)}function S(T){const ne="CDATA[";return T===ne.charCodeAt(c++)?(t.consume(T),c===ne.length?i.interrupt?e:ce:S):n(T)}function v(T){return pr(T)?(t.consume(T),o=String.fromCharCode(T),k):n(T)}function k(T){if(T===null||T===47||T===62||ri(T)){const ne=T===47,me=o.toLowerCase();return!ne&&!s&&jT.includes(me)?(r=1,i.interrupt?e(T):ce(T)):u7.includes(o.toLowerCase())?(r=6,ne?(t.consume(T),E):i.interrupt?e(T):ce(T)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(T):s?j(T):L(T))}return T===45||Si(T)?(t.consume(T),o+=String.fromCharCode(T),k):n(T)}function E(T){return T===62?(t.consume(T),i.interrupt?e:ce):n(T)}function j(T){return at(T)?(t.consume(T),j):te(T)}function L(T){return T===47?(t.consume(T),te):T===58||T===95||pr(T)?(t.consume(T),re):at(T)?(t.consume(T),L):te(T)}function re(T){return T===45||T===46||T===58||T===95||Si(T)?(t.consume(T),re):P(T)}function P(T){return T===61?(t.consume(T),O):at(T)?(t.consume(T),P):L(T)}function O(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(t.consume(T),f=T,z):at(T)?(t.consume(T),O):F(T)}function z(T){return T===f?(t.consume(T),f=null,se):T===null||De(T)?n(T):(t.consume(T),z)}function F(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||ri(T)?P(T):(t.consume(T),F)}function se(T){return T===47||T===62||at(T)?L(T):n(T)}function te(T){return T===62?(t.consume(T),he):n(T)}function he(T){return T===null||De(T)?ce(T):at(T)?(t.consume(T),he):n(T)}function ce(T){return T===45&&r===2?(t.consume(T),I):T===60&&r===1?(t.consume(T),K):T===62&&r===4?(t.consume(T),_):T===63&&r===3?(t.consume(T),M):T===93&&r===5?(t.consume(T),fe):De(T)&&(r===6||r===7)?(t.exit("htmlFlowData"),t.check(d7,U,Q)(T)):T===null||De(T)?(t.exit("htmlFlowData"),Q(T)):(t.consume(T),ce)}function Q(T){return t.check(h7,ie,U)(T)}function ie(T){return t.enter("lineEnding"),t.consume(T),t.exit("lineEnding"),Z}function Z(T){return T===null||De(T)?Q(T):(t.enter("htmlFlowData"),ce(T))}function I(T){return T===45?(t.consume(T),M):ce(T)}function K(T){return T===47?(t.consume(T),o="",pe):ce(T)}function pe(T){if(T===62){const ne=o.toLowerCase();return jT.includes(ne)?(t.consume(T),_):ce(T)}return pr(T)&&o.length<8?(t.consume(T),o+=String.fromCharCode(T),pe):ce(T)}function fe(T){return T===93?(t.consume(T),M):ce(T)}function M(T){return T===62?(t.consume(T),_):T===45&&r===2?(t.consume(T),M):ce(T)}function _(T){return T===null||De(T)?(t.exit("htmlFlowData"),U(T)):(t.consume(T),_)}function U(T){return t.exit("htmlFlow"),e(T)}}function g7(t,e,n){const i=this;return r;function r(o){return De(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):n(o)}function s(o){return i.parser.lazy[i.now().line]?n(o):e(o)}}function y7(t,e,n){return i;function i(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),t.attempt(um,e,n)}}const b7={name:"htmlText",tokenize:x7};function x7(t,e,n){const i=this;let r,s,o;return c;function c(M){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(M),f}function f(M){return M===33?(t.consume(M),d):M===47?(t.consume(M),P):M===63?(t.consume(M),L):pr(M)?(t.consume(M),F):n(M)}function d(M){return M===45?(t.consume(M),p):M===91?(t.consume(M),s=0,S):pr(M)?(t.consume(M),j):n(M)}function p(M){return M===45?(t.consume(M),b):n(M)}function m(M){return M===null?n(M):M===45?(t.consume(M),y):De(M)?(o=m,K(M)):(t.consume(M),m)}function y(M){return M===45?(t.consume(M),b):m(M)}function b(M){return M===62?I(M):M===45?y(M):m(M)}function S(M){const _="CDATA[";return M===_.charCodeAt(s++)?(t.consume(M),s===_.length?v:S):n(M)}function v(M){return M===null?n(M):M===93?(t.consume(M),k):De(M)?(o=v,K(M)):(t.consume(M),v)}function k(M){return M===93?(t.consume(M),E):v(M)}function E(M){return M===62?I(M):M===93?(t.consume(M),E):v(M)}function j(M){return M===null||M===62?I(M):De(M)?(o=j,K(M)):(t.consume(M),j)}function L(M){return M===null?n(M):M===63?(t.consume(M),re):De(M)?(o=L,K(M)):(t.consume(M),L)}function re(M){return M===62?I(M):L(M)}function P(M){return pr(M)?(t.consume(M),O):n(M)}function O(M){return M===45||Si(M)?(t.consume(M),O):z(M)}function z(M){return De(M)?(o=z,K(M)):at(M)?(t.consume(M),z):I(M)}function F(M){return M===45||Si(M)?(t.consume(M),F):M===47||M===62||ri(M)?se(M):n(M)}function se(M){return M===47?(t.consume(M),I):M===58||M===95||pr(M)?(t.consume(M),te):De(M)?(o=se,K(M)):at(M)?(t.consume(M),se):I(M)}function te(M){return M===45||M===46||M===58||M===95||Si(M)?(t.consume(M),te):he(M)}function he(M){return M===61?(t.consume(M),ce):De(M)?(o=he,K(M)):at(M)?(t.consume(M),he):se(M)}function ce(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(t.consume(M),r=M,Q):De(M)?(o=ce,K(M)):at(M)?(t.consume(M),ce):(t.consume(M),ie)}function Q(M){return M===r?(t.consume(M),r=void 0,Z):M===null?n(M):De(M)?(o=Q,K(M)):(t.consume(M),Q)}function ie(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||ri(M)?se(M):(t.consume(M),ie)}function Z(M){return M===47||M===62||ri(M)?se(M):n(M)}function I(M){return M===62?(t.consume(M),t.exit("htmlTextData"),t.exit("htmlText"),e):n(M)}function K(M){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),pe}function pe(M){return at(M)?Et(t,fe,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):fe(M)}function fe(M){return t.enter("htmlTextData"),o(M)}}const Nx={name:"labelEnd",resolveAll:k7,resolveTo:C7,tokenize:E7},S7={tokenize:T7},w7={tokenize:A7},v7={tokenize:M7};function k7(t){let e=-1;const n=[];for(;++e<t.length;){const i=t[e][1];if(n.push(t[e]),i.type==="labelImage"||i.type==="labelLink"||i.type==="labelEnd"){const r=i.type==="labelImage"?4:2;i.type="data",e+=r}}return t.length!==n.length&&Cr(t,0,t.length,n),t}function C7(t,e){let n=t.length,i=0,r,s,o,c;for(;n--;)if(r=t[n][1],s){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;t[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(o){if(t[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(s=n,r.type!=="labelLink")){i=2;break}}else r.type==="labelEnd"&&(o=n);const f={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},d={type:"label",start:{...t[s][1].start},end:{...t[o][1].end}},p={type:"labelText",start:{...t[s+i+2][1].end},end:{...t[o-2][1].start}};return c=[["enter",f,e],["enter",d,e]],c=Li(c,t.slice(s+1,s+i+3)),c=Li(c,[["enter",p,e]]),c=Li(c,Dx(e.parser.constructs.insideSpan.null,t.slice(s+i+4,o-3),e)),c=Li(c,[["exit",p,e],t[o-2],t[o-1],["exit",d,e]]),c=Li(c,t.slice(o+1)),c=Li(c,[["exit",f,e]]),Cr(t,s,t.length,c),t}function E7(t,e,n){const i=this;let r=i.events.length,s,o;for(;r--;)if((i.events[r][1].type==="labelImage"||i.events[r][1].type==="labelLink")&&!i.events[r][1]._balanced){s=i.events[r][1];break}return c;function c(y){return s?s._inactive?m(y):(o=i.parser.defined.includes(ba(i.sliceSerialize({start:s.end,end:i.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(y),t.exit("labelMarker"),t.exit("labelEnd"),f):n(y)}function f(y){return y===40?t.attempt(S7,p,o?p:m)(y):y===91?t.attempt(w7,p,o?d:m)(y):o?p(y):m(y)}function d(y){return t.attempt(v7,p,m)(y)}function p(y){return e(y)}function m(y){return s._balanced=!0,n(y)}}function T7(t,e,n){return i;function i(m){return t.enter("resource"),t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),r}function r(m){return ri(m)?du(t,s)(m):s(m)}function s(m){return m===41?p(m):BD(t,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return ri(m)?du(t,f)(m):p(m)}function c(m){return n(m)}function f(m){return m===34||m===39||m===40?UD(t,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function d(m){return ri(m)?du(t,p)(m):p(m)}function p(m){return m===41?(t.enter("resourceMarker"),t.consume(m),t.exit("resourceMarker"),t.exit("resource"),e):n(m)}}function A7(t,e,n){const i=this;return r;function r(c){return jD.call(i,t,s,o,"reference","referenceMarker","referenceString")(c)}function s(c){return i.parser.defined.includes(ba(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)))?e(c):n(c)}function o(c){return n(c)}}function M7(t,e,n){return i;function i(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),r}function r(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const O7={name:"labelStartImage",resolveAll:Nx.resolveAll,tokenize:_7};function _7(t,e,n){const i=this;return r;function r(c){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(c),t.exit("labelImageMarker"),s}function s(c){return c===91?(t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(c):e(c)}}const D7={name:"labelStartLink",resolveAll:Nx.resolveAll,tokenize:N7};function N7(t,e,n){const i=this;return r;function r(o){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in i.parser.constructs?n(o):e(o)}}const T0={name:"lineEnding",tokenize:R7};function R7(t,e){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),Et(t,e,"linePrefix")}}const mh={name:"thematicBreak",tokenize:z7};function z7(t,e,n){let i=0,r;return s;function s(d){return t.enter("thematicBreak"),o(d)}function o(d){return r=d,c(d)}function c(d){return d===r?(t.enter("thematicBreakSequence"),f(d)):i>=3&&(d===null||De(d))?(t.exit("thematicBreak"),e(d)):n(d)}function f(d){return d===r?(t.consume(d),i++,f):(t.exit("thematicBreakSequence"),at(d)?Et(t,c,"whitespace")(d):c(d))}}const Qn={continuation:{tokenize:j7},exit:H7,name:"list",tokenize:B7},L7={partial:!0,tokenize:V7},I7={partial:!0,tokenize:U7};function B7(t,e,n){const i=this,r=i.events[i.events.length-1];let s=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,o=0;return c;function c(b){const S=i.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!i.containerState.marker||b===i.containerState.marker:Yb(b)){if(i.containerState.type||(i.containerState.type=S,t.enter(S,{_container:!0})),S==="listUnordered")return t.enter("listItemPrefix"),b===42||b===45?t.check(mh,n,d)(b):d(b);if(!i.interrupt||b===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),f(b)}return n(b)}function f(b){return Yb(b)&&++o<10?(t.consume(b),f):(!i.interrupt||o<2)&&(i.containerState.marker?b===i.containerState.marker:b===41||b===46)?(t.exit("listItemValue"),d(b)):n(b)}function d(b){return t.enter("listItemMarker"),t.consume(b),t.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||b,t.check(um,i.interrupt?n:p,t.attempt(L7,y,m))}function p(b){return i.containerState.initialBlankLine=!0,s++,y(b)}function m(b){return at(b)?(t.enter("listItemPrefixWhitespace"),t.consume(b),t.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return i.containerState.size=s+i.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(b)}}function j7(t,e,n){const i=this;return i.containerState._closeFlow=void 0,t.check(um,r,s);function r(c){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,Et(t,e,"listItemIndent",i.containerState.size+1)(c)}function s(c){return i.containerState.furtherBlankLines||!at(c)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,o(c)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,t.attempt(I7,e,o)(c))}function o(c){return i.containerState._closeFlow=!0,i.interrupt=void 0,Et(t,t.attempt(Qn,e,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function U7(t,e,n){const i=this;return Et(t,r,"listItemIndent",i.containerState.size+1);function r(s){const o=i.events[i.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===i.containerState.size?e(s):n(s)}}function H7(t){t.exit(this.containerState.type)}function V7(t,e,n){const i=this;return Et(t,r,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(s){const o=i.events[i.events.length-1];return!at(s)&&o&&o[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const UT={name:"setextUnderline",resolveTo:P7,tokenize:$7};function P7(t,e){let n=t.length,i,r,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){i=n;break}t[n][1].type==="paragraph"&&(r=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[r][1].type="setextHeadingText",s?(t.splice(r,0,["enter",o,e]),t.splice(s+1,0,["exit",t[i][1],e]),t[i][1].end={...t[s][1].end}):t[i][1]=o,t.push(["exit",o,e]),t}function $7(t,e,n){const i=this;let r;return s;function s(d){let p=i.events.length,m;for(;p--;)if(i.events[p][1].type!=="lineEnding"&&i.events[p][1].type!=="linePrefix"&&i.events[p][1].type!=="content"){m=i.events[p][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||m)?(t.enter("setextHeadingLine"),r=d,o(d)):n(d)}function o(d){return t.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===r?(t.consume(d),c):(t.exit("setextHeadingLineSequence"),at(d)?Et(t,f,"lineSuffix")(d):f(d))}function f(d){return d===null||De(d)?(t.exit("setextHeadingLine"),e(d)):n(d)}}const F7={tokenize:q7};function q7(t){const e=this,n=t.attempt(um,i,t.attempt(this.parser.constructs.flowInitial,r,Et(t,t.attempt(this.parser.constructs.flow,r,t.attempt(JV,r)),"linePrefix")));return n;function i(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function r(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const Y7={resolveAll:VD()},K7=HD("string"),G7=HD("text");function HD(t){return{resolveAll:VD(t==="text"?Z7:void 0),tokenize:e};function e(n){const i=this,r=this.parser.constructs[t],s=n.attempt(r,o,c);return o;function o(p){return d(p)?s(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),s(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const m=r[p];let y=-1;if(m)for(;++y<m.length;){const b=m[y];if(!b.previous||b.previous.call(i,i.previous))return!0}return!1}}}function VD(t){return e;function e(n,i){let r=-1,s;for(;++r<=n.length;)s===void 0?n[r]&&n[r][1].type==="data"&&(s=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==s+2&&(n[s][1].end=n[r-1][1].end,n.splice(s+2,r-s-2),r=s+2),s=void 0);return t?t(n,i):n}}function Z7(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const i=t[n-1][1],r=e.sliceStream(i);let s=r.length,o=-1,c=0,f;for(;s--;){const d=r[s];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(d===-2)f=!0,c++;else if(d!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(c=0),c){const d={type:n===t.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:i.start._bufferIndex+o,_index:i.start._index+s,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...d.start},i.start.offset===i.end.offset?Object.assign(i,d):(t.splice(n,0,["enter",d,e],["exit",d,e]),n+=2)}n++}return t}const J7={42:Qn,43:Qn,45:Qn,48:Qn,49:Qn,50:Qn,51:Qn,52:Qn,53:Qn,54:Qn,55:Qn,56:Qn,57:Qn,62:RD},X7={91:t7},W7={[-2]:E0,[-1]:E0,32:E0},Q7={35:o7,42:mh,45:[UT,mh],60:f7,61:UT,95:mh,96:BT,126:BT},eP={38:LD,92:zD},tP={[-5]:T0,[-4]:T0,[-3]:T0,33:O7,38:LD,42:Kb,60:[DV,b7],91:D7,92:[s7,zD],93:Nx,95:Kb,96:FV},nP={null:[Kb,Y7]},iP={null:[42,95]},rP={null:[]},sP=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:iP,contentInitial:X7,disable:rP,document:J7,flow:Q7,flowInitial:W7,insideSpan:nP,string:eP,text:tP},Symbol.toStringTag,{value:"Module"}));function lP(t,e,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const r={},s=[];let o=[],c=[];const f={attempt:z(P),check:z(O),consume:j,enter:L,exit:re,interrupt:z(O,{interrupt:!0})},d={code:null,containerState:{},defineSkip:v,events:[],now:S,parser:t,previous:null,sliceSerialize:y,sliceStream:b,write:m};let p=e.tokenize.call(d,f);return e.resolveAll&&s.push(e),d;function m(he){return o=Li(o,he),k(),o[o.length-1]!==null?[]:(F(e,0),d.events=Dx(s,d.events,d),d.events)}function y(he,ce){return aP(b(he),ce)}function b(he){return oP(o,he)}function S(){const{_bufferIndex:he,_index:ce,line:Q,column:ie,offset:Z}=i;return{_bufferIndex:he,_index:ce,line:Q,column:ie,offset:Z}}function v(he){r[he.line]=he.column,te()}function k(){let he;for(;i._index<o.length;){const ce=o[i._index];if(typeof ce=="string")for(he=i._index,i._bufferIndex<0&&(i._bufferIndex=0);i._index===he&&i._bufferIndex<ce.length;)E(ce.charCodeAt(i._bufferIndex));else E(ce)}}function E(he){p=p(he)}function j(he){De(he)?(i.line++,i.column=1,i.offset+=he===-3?2:1,te()):he!==-1&&(i.column++,i.offset++),i._bufferIndex<0?i._index++:(i._bufferIndex++,i._bufferIndex===o[i._index].length&&(i._bufferIndex=-1,i._index++)),d.previous=he}function L(he,ce){const Q=ce||{};return Q.type=he,Q.start=S(),d.events.push(["enter",Q,d]),c.push(Q),Q}function re(he){const ce=c.pop();return ce.end=S(),d.events.push(["exit",ce,d]),ce}function P(he,ce){F(he,ce.from)}function O(he,ce){ce.restore()}function z(he,ce){return Q;function Q(ie,Z,I){let K,pe,fe,M;return Array.isArray(ie)?U(ie):"tokenize"in ie?U([ie]):_(ie);function _(ge){return Oe;function Oe(Ge){const Fe=Ge!==null&&ge[Ge],ct=Ge!==null&&ge.null,Ce=[...Array.isArray(Fe)?Fe:Fe?[Fe]:[],...Array.isArray(ct)?ct:ct?[ct]:[]];return U(Ce)(Ge)}}function U(ge){return K=ge,pe=0,ge.length===0?I:T(ge[pe])}function T(ge){return Oe;function Oe(Ge){return M=se(),fe=ge,ge.partial||(d.currentConstruct=ge),ge.name&&d.parser.constructs.disable.null.includes(ge.name)?me():ge.tokenize.call(ce?Object.assign(Object.create(d),ce):d,f,ne,me)(Ge)}}function ne(ge){return he(fe,M),Z}function me(ge){return M.restore(),++pe<K.length?T(K[pe]):I}}}function F(he,ce){he.resolveAll&&!s.includes(he)&&s.push(he),he.resolve&&Cr(d.events,ce,d.events.length-ce,he.resolve(d.events.slice(ce),d)),he.resolveTo&&(d.events=he.resolveTo(d.events,d))}function se(){const he=S(),ce=d.previous,Q=d.currentConstruct,ie=d.events.length,Z=Array.from(c);return{from:ie,restore:I};function I(){i=he,d.previous=ce,d.currentConstruct=Q,d.events.length=ie,c=Z,te()}}function te(){i.line in r&&i.column<2&&(i.column=r[i.line],i.offset+=r[i.line]-1)}}function oP(t,e){const n=e.start._index,i=e.start._bufferIndex,r=e.end._index,s=e.end._bufferIndex;let o;if(n===r)o=[t[n].slice(i,s)];else{if(o=t.slice(n,r),i>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(i):o.shift()}s>0&&o.push(t[r].slice(0,s))}return o}function aP(t,e){let n=-1;const i=[];let r;for(;++n<t.length;){const s=t[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
258
258
|
`;break}case-3:{o=`\r
|
|
259
|
-
`;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&r)continue;o=" ";break}default:o=String.fromCharCode(s)}r=s===-2,i.push(o)}return i.join("")}function cP(t){const i={constructs:gV([sP,...(t||{}).extensions||[]]),content:r(CV),defined:[],document:r(TV),flow:r(F7),lazy:{},string:r(K7),text:r(G7)};return i;function r(s){return o;function o(c){return lP(i,s,c)}}}function uP(t){for(;!ID(t););return t}const HT=/[\0\t\n\r]/g;function fP(){let t=1,e="",n=!0,i;return r;function r(s,o,c){const f=[];let d,p,m,y,b;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),m=0,e="",n&&(s.charCodeAt(0)===65279&&m++,n=void 0);m<s.length;){if(HT.lastIndex=m,d=HT.exec(s),y=d&&d.index!==void 0?d.index:s.length,b=s.charCodeAt(y),!d){e=s.slice(m);break}if(b===10&&m===y&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),m<y&&(f.push(s.slice(m,y)),t+=y-m),b){case 0:{f.push(65533),t++;break}case 9:{for(p=Math.ceil(t/4)*4,f.push(-2);t++<p;)f.push(-1);break}case 10:{f.push(-4),t=1;break}default:i=!0,t=1}m=y+1}return c&&(i&&f.push(-5),e&&f.push(e),f.push(null)),f}}const dP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hP(t){return t.replace(dP,pP)}function pP(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),s=r===120||r===88;return ND(n.slice(s?2:1),s?16:10)}return _x(n)||t}const PD={}.hasOwnProperty;function mP(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),gP(n)(uP(cP(n).document().write(fP()(t,e,!0))))}function gP(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Yi),autolinkProtocol:se,autolinkEmail:se,atxHeading:s(je),blockQuote:s(ct),characterEscape:se,characterReference:se,codeFenced:s(Ce),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Ce,o),codeText:s(Xe,o),codeTextData:se,data:se,codeFlowValue:se,definition:s(Ht),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Nt),hardBreakEscape:s(Fn),hardBreakTrailing:s(Fn),htmlFlow:s(Fi,o),htmlFlowData:se,htmlText:s(Fi,o),htmlTextData:se,image:s(qi),label:o,link:s(Yi),listItem:s(ee),listItemValue:y,listOrdered:s(li,m),listUnordered:s(li),paragraph:s(Le),reference:T,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(je),strong:s(it),thematicBreak:s(pt)},exit:{atxHeading:f(),atxHeadingSequence:P,autolink:f(),autolinkEmail:Fe,autolinkProtocol:Ge,blockQuote:f(),characterEscapeValue:te,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ge,characterReference:Oe,codeFenced:f(k),codeFencedFence:v,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:te,codeIndented:f(E),codeText:f(Z),codeTextData:te,data:te,definition:f(),definitionDestinationString:re,definitionLabelString:j,definitionTitleString:L,emphasis:f(),hardBreakEscape:f(ce),hardBreakTrailing:f(ce),htmlFlow:f(Q),htmlFlowData:te,htmlText:f(ie),htmlTextData:te,image:f(K),label:fe,labelText:pe,lineEnding:he,link:f(I),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ne,resourceDestinationString:M,resourceTitleString:_,resource:U,setextHeading:f(F),setextHeadingLineSequence:z,setextHeadingText:O,strong:f(),thematicBreak:f()}};$D(e,(t||{}).mdastExtensions||[]);const n={};return i;function i(Y){let oe={type:"root",children:[]};const we={stack:[oe],tokenStack:[],config:e,enter:c,exit:d,buffer:o,resume:p,data:n},Ue=[];let ut=-1;for(;++ut<Y.length;)if(Y[ut][1].type==="listOrdered"||Y[ut][1].type==="listUnordered")if(Y[ut][0]==="enter")Ue.push(ut);else{const oi=Ue.pop();ut=r(Y,oi,ut)}for(ut=-1;++ut<Y.length;){const oi=e[Y[ut][0]];PD.call(oi,Y[ut][1].type)&&oi[Y[ut][1].type].call(Object.assign({sliceSerialize:Y[ut][2].sliceSerialize},we),Y[ut][1])}if(we.tokenStack.length>0){const oi=we.tokenStack[we.tokenStack.length-1];(oi[1]||VT).call(we,void 0,oi[0])}for(oe.position={start:Is(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:Is(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},ut=-1;++ut<e.transforms.length;)oe=e.transforms[ut](oe)||oe;return oe}function r(Y,oe,we){let Ue=oe-1,ut=-1,oi=!1,Ar,Ln,en,qn;for(;++Ue<=we;){const xt=Y[Ue];switch(xt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{xt[0]==="enter"?ut++:ut--,qn=void 0;break}case"lineEndingBlank":{xt[0]==="enter"&&(Ar&&!qn&&!ut&&!en&&(en=Ue),qn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qn=void 0}if(!ut&&xt[0]==="enter"&&xt[1].type==="listItemPrefix"||ut===-1&&xt[0]==="exit"&&(xt[1].type==="listUnordered"||xt[1].type==="listOrdered")){if(Ar){let cs=Ue;for(Ln=void 0;cs--;){const Ki=Y[cs];if(Ki[1].type==="lineEnding"||Ki[1].type==="lineEndingBlank"){if(Ki[0]==="exit")continue;Ln&&(Y[Ln][1].type="lineEndingBlank",oi=!0),Ki[1].type="lineEnding",Ln=cs}else if(!(Ki[1].type==="linePrefix"||Ki[1].type==="blockQuotePrefix"||Ki[1].type==="blockQuotePrefixWhitespace"||Ki[1].type==="blockQuoteMarker"||Ki[1].type==="listItemIndent"))break}en&&(!Ln||en<Ln)&&(Ar._spread=!0),Ar.end=Object.assign({},Ln?Y[Ln][1].start:xt[1].end),Y.splice(Ln||Ue,0,["exit",Ar,xt[2]]),Ue++,we++}if(xt[1].type==="listItemPrefix"){const cs={type:"listItem",_spread:!1,start:Object.assign({},xt[1].start),end:void 0};Ar=cs,Y.splice(Ue,0,["enter",cs,xt[2]]),Ue++,we++,en=void 0,qn=!0}}}return Y[oe][1]._spread=oi,we}function s(Y,oe){return we;function we(Ue){c.call(this,Y(Ue),Ue),oe&&oe.call(this,Ue)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(Y,oe,we){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([oe,we||void 0]),Y.position={start:Is(oe.start),end:void 0}}function f(Y){return oe;function oe(we){Y&&Y.call(this,we),d.call(this,we)}}function d(Y,oe){const we=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==Y.type&&(oe?oe.call(this,Y,Ue[0]):(Ue[1]||VT).call(this,Y,Ue[0]));else throw new Error("Cannot close `"+Y.type+"` ("+fu({start:Y.start,end:Y.end})+"): it’s not open");we.position.end=Is(Y.end)}function p(){return pV(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(Y){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function b(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=Y}function S(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=Y}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y.replace(/(\r?\n|\r)$/g,"")}function j(Y){const oe=this.resume(),we=this.stack[this.stack.length-1];we.label=oe,we.identifier=ba(this.sliceSerialize(Y)).toLowerCase()}function L(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.title=Y}function re(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.url=Y}function P(Y){const oe=this.stack[this.stack.length-1];if(!oe.depth){const we=this.sliceSerialize(Y).length;oe.depth=we}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function z(Y){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function se(Y){const we=this.stack[this.stack.length-1].children;let Ue=we[we.length-1];(!Ue||Ue.type!=="text")&&(Ue=qe(),Ue.position={start:Is(Y.start),end:void 0},we.push(Ue)),this.stack.push(Ue)}function te(Y){const oe=this.stack.pop();oe.value+=this.sliceSerialize(Y),oe.position.end=Is(Y.end)}function he(Y){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=oe.children[oe.children.length-1];we.position.end=Is(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(oe.type)&&(se.call(this,Y),te.call(this,Y))}function ce(){this.data.atHardBreak=!0}function Q(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y}function ie(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y}function Z(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y}function I(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=oe,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function K(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=oe,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function pe(Y){const oe=this.sliceSerialize(Y),we=this.stack[this.stack.length-2];we.label=hP(oe),we.identifier=ba(oe).toLowerCase()}function fe(){const Y=this.stack[this.stack.length-1],oe=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Ue=Y.children;we.children=Ue}else we.alt=oe}function M(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.url=Y}function _(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.title=Y}function U(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ne(Y){const oe=this.resume(),we=this.stack[this.stack.length-1];we.label=oe,we.identifier=ba(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function me(Y){this.data.characterReferenceType=Y.type}function ge(Y){const oe=this.sliceSerialize(Y),we=this.data.characterReferenceType;let Ue;we?(Ue=ND(oe,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=_x(oe);const ut=this.stack[this.stack.length-1];ut.value+=Ue}function Oe(Y){const oe=this.stack.pop();oe.position.end=Is(Y.end)}function Ge(Y){te.call(this,Y);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(Y)}function Fe(Y){te.call(this,Y);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(Y)}function ct(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function Xe(){return{type:"inlineCode",value:""}}function Ht(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Nt(){return{type:"emphasis",children:[]}}function je(){return{type:"heading",depth:0,children:[]}}function Fn(){return{type:"break"}}function Fi(){return{type:"html",value:""}}function qi(){return{type:"image",title:null,url:"",alt:null}}function Yi(){return{type:"link",title:null,url:"",children:[]}}function li(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function ee(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function Le(){return{type:"paragraph",children:[]}}function it(){return{type:"strong",children:[]}}function qe(){return{type:"text",value:""}}function pt(){return{type:"thematicBreak"}}}function Is(t){return{line:t.line,column:t.column,offset:t.offset}}function $D(t,e){let n=-1;for(;++n<e.length;){const i=e[n];Array.isArray(i)?$D(t,i):yP(t,i)}}function yP(t,e){let n;for(n in e)if(PD.call(e,n))switch(n){case"canContainEols":{const i=e[n];i&&t[n].push(...i);break}case"transforms":{const i=e[n];i&&t[n].push(...i);break}case"enter":case"exit":{const i=e[n];i&&Object.assign(t[n],i);break}}}function VT(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+fu({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+fu({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+fu({start:e.start,end:e.end})+") is still open")}function bP(t){const e=this;e.parser=n;function n(i){return mP(i,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function xP(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function SP(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
259
|
+
`;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&r)continue;o=" ";break}default:o=String.fromCharCode(s)}r=s===-2,i.push(o)}return i.join("")}function cP(t){const i={constructs:gV([sP,...(t||{}).extensions||[]]),content:r(CV),defined:[],document:r(TV),flow:r(F7),lazy:{},string:r(K7),text:r(G7)};return i;function r(s){return o;function o(c){return lP(i,s,c)}}}function uP(t){for(;!ID(t););return t}const HT=/[\0\t\n\r]/g;function fP(){let t=1,e="",n=!0,i;return r;function r(s,o,c){const f=[];let d,p,m,y,b;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),m=0,e="",n&&(s.charCodeAt(0)===65279&&m++,n=void 0);m<s.length;){if(HT.lastIndex=m,d=HT.exec(s),y=d&&d.index!==void 0?d.index:s.length,b=s.charCodeAt(y),!d){e=s.slice(m);break}if(b===10&&m===y&&i)f.push(-3),i=void 0;else switch(i&&(f.push(-5),i=void 0),m<y&&(f.push(s.slice(m,y)),t+=y-m),b){case 0:{f.push(65533),t++;break}case 9:{for(p=Math.ceil(t/4)*4,f.push(-2);t++<p;)f.push(-1);break}case 10:{f.push(-4),t=1;break}default:i=!0,t=1}m=y+1}return c&&(i&&f.push(-5),e&&f.push(e),f.push(null)),f}}const dP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hP(t){return t.replace(dP,pP)}function pP(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const r=n.charCodeAt(1),s=r===120||r===88;return ND(n.slice(s?2:1),s?16:10)}return _x(n)||t}const PD={}.hasOwnProperty;function mP(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),gP(n)(uP(cP(n).document().write(fP()(t,e,!0))))}function gP(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Yi),autolinkProtocol:se,autolinkEmail:se,atxHeading:s(je),blockQuote:s(ct),characterEscape:se,characterReference:se,codeFenced:s(Ce),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Ce,o),codeText:s(Xe,o),codeTextData:se,data:se,codeFlowValue:se,definition:s(Ht),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Nt),hardBreakEscape:s(Fn),hardBreakTrailing:s(Fn),htmlFlow:s(Fi,o),htmlFlowData:se,htmlText:s(Fi,o),htmlTextData:se,image:s(qi),label:o,link:s(Yi),listItem:s(ee),listItemValue:y,listOrdered:s(li,m),listUnordered:s(li),paragraph:s(Le),reference:T,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(je),strong:s(it),thematicBreak:s(ft)},exit:{atxHeading:f(),atxHeadingSequence:P,autolink:f(),autolinkEmail:Fe,autolinkProtocol:Ge,blockQuote:f(),characterEscapeValue:te,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ge,characterReference:Oe,codeFenced:f(k),codeFencedFence:v,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:te,codeIndented:f(E),codeText:f(Z),codeTextData:te,data:te,definition:f(),definitionDestinationString:re,definitionLabelString:j,definitionTitleString:L,emphasis:f(),hardBreakEscape:f(ce),hardBreakTrailing:f(ce),htmlFlow:f(Q),htmlFlowData:te,htmlText:f(ie),htmlTextData:te,image:f(K),label:fe,labelText:pe,lineEnding:he,link:f(I),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ne,resourceDestinationString:M,resourceTitleString:_,resource:U,setextHeading:f(F),setextHeadingLineSequence:z,setextHeadingText:O,strong:f(),thematicBreak:f()}};$D(e,(t||{}).mdastExtensions||[]);const n={};return i;function i(Y){let oe={type:"root",children:[]};const Se={stack:[oe],tokenStack:[],config:e,enter:c,exit:d,buffer:o,resume:p,data:n},Ue=[];let ut=-1;for(;++ut<Y.length;)if(Y[ut][1].type==="listOrdered"||Y[ut][1].type==="listUnordered")if(Y[ut][0]==="enter")Ue.push(ut);else{const oi=Ue.pop();ut=r(Y,oi,ut)}for(ut=-1;++ut<Y.length;){const oi=e[Y[ut][0]];PD.call(oi,Y[ut][1].type)&&oi[Y[ut][1].type].call(Object.assign({sliceSerialize:Y[ut][2].sliceSerialize},Se),Y[ut][1])}if(Se.tokenStack.length>0){const oi=Se.tokenStack[Se.tokenStack.length-1];(oi[1]||VT).call(Se,void 0,oi[0])}for(oe.position={start:Is(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:Is(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},ut=-1;++ut<e.transforms.length;)oe=e.transforms[ut](oe)||oe;return oe}function r(Y,oe,Se){let Ue=oe-1,ut=-1,oi=!1,Ar,Ln,en,qn;for(;++Ue<=Se;){const xt=Y[Ue];switch(xt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{xt[0]==="enter"?ut++:ut--,qn=void 0;break}case"lineEndingBlank":{xt[0]==="enter"&&(Ar&&!qn&&!ut&&!en&&(en=Ue),qn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qn=void 0}if(!ut&&xt[0]==="enter"&&xt[1].type==="listItemPrefix"||ut===-1&&xt[0]==="exit"&&(xt[1].type==="listUnordered"||xt[1].type==="listOrdered")){if(Ar){let cs=Ue;for(Ln=void 0;cs--;){const Ki=Y[cs];if(Ki[1].type==="lineEnding"||Ki[1].type==="lineEndingBlank"){if(Ki[0]==="exit")continue;Ln&&(Y[Ln][1].type="lineEndingBlank",oi=!0),Ki[1].type="lineEnding",Ln=cs}else if(!(Ki[1].type==="linePrefix"||Ki[1].type==="blockQuotePrefix"||Ki[1].type==="blockQuotePrefixWhitespace"||Ki[1].type==="blockQuoteMarker"||Ki[1].type==="listItemIndent"))break}en&&(!Ln||en<Ln)&&(Ar._spread=!0),Ar.end=Object.assign({},Ln?Y[Ln][1].start:xt[1].end),Y.splice(Ln||Ue,0,["exit",Ar,xt[2]]),Ue++,Se++}if(xt[1].type==="listItemPrefix"){const cs={type:"listItem",_spread:!1,start:Object.assign({},xt[1].start),end:void 0};Ar=cs,Y.splice(Ue,0,["enter",cs,xt[2]]),Ue++,Se++,en=void 0,qn=!0}}}return Y[oe][1]._spread=oi,Se}function s(Y,oe){return Se;function Se(Ue){c.call(this,Y(Ue),Ue),oe&&oe.call(this,Ue)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(Y,oe,Se){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([oe,Se||void 0]),Y.position={start:Is(oe.start),end:void 0}}function f(Y){return oe;function oe(Se){Y&&Y.call(this,Se),d.call(this,Se)}}function d(Y,oe){const Se=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==Y.type&&(oe?oe.call(this,Y,Ue[0]):(Ue[1]||VT).call(this,Y,Ue[0]));else throw new Error("Cannot close `"+Y.type+"` ("+fu({start:Y.start,end:Y.end})+"): it’s not open");Se.position.end=Is(Y.end)}function p(){return pV(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(Y){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function b(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=Y}function S(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=Y}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y.replace(/(\r?\n|\r)$/g,"")}function j(Y){const oe=this.resume(),Se=this.stack[this.stack.length-1];Se.label=oe,Se.identifier=ba(this.sliceSerialize(Y)).toLowerCase()}function L(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.title=Y}function re(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.url=Y}function P(Y){const oe=this.stack[this.stack.length-1];if(!oe.depth){const Se=this.sliceSerialize(Y).length;oe.depth=Se}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function z(Y){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function se(Y){const Se=this.stack[this.stack.length-1].children;let Ue=Se[Se.length-1];(!Ue||Ue.type!=="text")&&(Ue=qe(),Ue.position={start:Is(Y.start),end:void 0},Se.push(Ue)),this.stack.push(Ue)}function te(Y){const oe=this.stack.pop();oe.value+=this.sliceSerialize(Y),oe.position.end=Is(Y.end)}function he(Y){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Se=oe.children[oe.children.length-1];Se.position.end=Is(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(oe.type)&&(se.call(this,Y),te.call(this,Y))}function ce(){this.data.atHardBreak=!0}function Q(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y}function ie(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y}function Z(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.value=Y}function I(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=oe,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function K(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=oe,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function pe(Y){const oe=this.sliceSerialize(Y),Se=this.stack[this.stack.length-2];Se.label=hP(oe),Se.identifier=ba(oe).toLowerCase()}function fe(){const Y=this.stack[this.stack.length-1],oe=this.resume(),Se=this.stack[this.stack.length-1];if(this.data.inReference=!0,Se.type==="link"){const Ue=Y.children;Se.children=Ue}else Se.alt=oe}function M(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.url=Y}function _(){const Y=this.resume(),oe=this.stack[this.stack.length-1];oe.title=Y}function U(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ne(Y){const oe=this.resume(),Se=this.stack[this.stack.length-1];Se.label=oe,Se.identifier=ba(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function me(Y){this.data.characterReferenceType=Y.type}function ge(Y){const oe=this.sliceSerialize(Y),Se=this.data.characterReferenceType;let Ue;Se?(Ue=ND(oe,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=_x(oe);const ut=this.stack[this.stack.length-1];ut.value+=Ue}function Oe(Y){const oe=this.stack.pop();oe.position.end=Is(Y.end)}function Ge(Y){te.call(this,Y);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(Y)}function Fe(Y){te.call(this,Y);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(Y)}function ct(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function Xe(){return{type:"inlineCode",value:""}}function Ht(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Nt(){return{type:"emphasis",children:[]}}function je(){return{type:"heading",depth:0,children:[]}}function Fn(){return{type:"break"}}function Fi(){return{type:"html",value:""}}function qi(){return{type:"image",title:null,url:"",alt:null}}function Yi(){return{type:"link",title:null,url:"",children:[]}}function li(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function ee(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function Le(){return{type:"paragraph",children:[]}}function it(){return{type:"strong",children:[]}}function qe(){return{type:"text",value:""}}function ft(){return{type:"thematicBreak"}}}function Is(t){return{line:t.line,column:t.column,offset:t.offset}}function $D(t,e){let n=-1;for(;++n<e.length;){const i=e[n];Array.isArray(i)?$D(t,i):yP(t,i)}}function yP(t,e){let n;for(n in e)if(PD.call(e,n))switch(n){case"canContainEols":{const i=e[n];i&&t[n].push(...i);break}case"transforms":{const i=e[n];i&&t[n].push(...i);break}case"enter":case"exit":{const i=e[n];i&&Object.assign(t[n],i);break}}}function VT(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+fu({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+fu({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+fu({start:e.start,end:e.end})+") is still open")}function bP(t){const e=this;e.parser=n;function n(i){return mP(i,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function xP(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function SP(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
260
260
|
`}]}function wP(t,e){const n=e.value?e.value+`
|
|
261
261
|
`:"",i={},r=e.lang?e.lang.split(/\s+/):[];r.length>0&&(i.className=["language-"+r[0]]);let s={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function vP(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function kP(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function CP(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=String(e.identifier).toUpperCase(),r=Ya(i.toLowerCase()),s=t.footnoteOrder.indexOf(i);let o,c=t.footnoteCounts.get(i);c===void 0?(c=0,t.footnoteOrder.push(i),o=t.footnoteOrder.length):o=s+1,c+=1,t.footnoteCounts.set(i,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+r,id:n+"fnref-"+r+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return t.patch(e,d),t.applyData(e,d)}function EP(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function TP(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function FD(t,e){const n=e.referenceType;let i="]";if(n==="collapsed"?i+="[]":n==="full"&&(i+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+i}];const r=t.all(e),s=r[0];s&&s.type==="text"?s.value="["+s.value:r.unshift({type:"text",value:"["});const o=r[r.length-1];return o&&o.type==="text"?o.value+=i:r.push({type:"text",value:i}),r}function AP(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return FD(t,e);const r={src:Ya(i.url||""),alt:e.alt};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,s),t.applyData(e,s)}function MP(t,e){const n={src:Ya(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,i),t.applyData(e,i)}function OP(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const i={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,i),t.applyData(e,i)}function _P(t,e){const n=String(e.identifier).toUpperCase(),i=t.definitionById.get(n);if(!i)return FD(t,e);const r={href:Ya(i.url||"")};i.title!==null&&i.title!==void 0&&(r.title=i.title);const s={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function DP(t,e){const n={href:Ya(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const i={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function NP(t,e,n){const i=t.all(e),r=n?RP(n):qD(e),s={},o=[];if(typeof e.checked=="boolean"){const p=i[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},i.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let c=-1;for(;++c<i.length;){const p=i[c];(r||c!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
|
|
262
262
|
`}),p.type==="element"&&p.tagName==="p"&&!r?o.push(...p.children):o.push(p)}const f=i[i.length-1];f&&(r||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
|
|
@@ -294,4 +294,4 @@ ${y.backupPath}`),alert(b.join(" "))}else alert("Changes applied successfully.")
|
|
|
294
294
|
transform: translateX(0);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
`}),A.jsx("div",{"data-testid":"toast-container",style:{position:"fixed",bottom:40,right:16,zIndex:1e3,display:"flex",flexDirection:"column",gap:8,maxWidth:360,pointerEvents:"none"},children:t.map(n=>A.jsx(xF,{toast:n,onDismiss:e},n.id))})]})}function xF({toast:t,onDismiss:e}){const n=yF[t.severity],i=t.severity==="info"?"status":"alert";return A.jsxs("div",{role:i,"data-testid":`toast-${t.id}`,style:{pointerEvents:"auto",background:"white",borderRadius:6,borderLeft:`4px solid ${n}`,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08)",padding:"10px 32px 10px 12px",position:"relative",animation:"tandem-toast-slide-in 0.2s ease-out",fontSize:13,lineHeight:1.4,color:"#1f2937"},children:[A.jsx("span",{children:t.message}),t.count>1&&A.jsxs("span",{"data-testid":`toast-count-${t.id}`,style:{marginLeft:6,fontSize:11,fontWeight:600,color:n,background:`${n}18`,padding:"1px 5px",borderRadius:8},children:["×",t.count]}),A.jsx("button",{"data-testid":`toast-dismiss-${t.id}`,onClick:()=>e(t.id),style:{position:"absolute",top:6,right:6,border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#9ca3af",lineHeight:1,padding:"2px 4px"},"aria-label":"Dismiss notification",children:"×"})]})}const SF=[{title:"Review an annotation",text:"Open the side panel and accept or dismiss one of the highlighted annotations. Try Review Mode (Ctrl+Shift+R) for keyboard shortcuts."},{title:"Ask a question",text:"Select text and click Ask Claude (Ctrl+Shift+A), or type in the Chat panel."},{title:"Make an edit",text:"Click in the document and type something. All changes sync in real-time."},{title:"You're ready!",text:"You've learned the basics. Press ? anytime to see keyboard shortcuts."}],eh=3;function wF({currentStep:t,onNext:e,onDismiss:n}){const i=SF[t];if(!i)return null;const r=t>=eh;return A.jsxs("div",{"data-testid":"onboarding-tutorial",style:{position:"fixed",bottom:48,left:24,zIndex:900,maxWidth:340,background:"white",borderLeft:"4px solid #6366f1",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08)",padding:"16px 20px",fontFamily:"inherit"},children:[!r&&A.jsx("div",{style:{display:"flex",gap:6,marginBottom:12},children:Array.from({length:eh},(s,o)=>A.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:o<=t?"#6366f1":"#e5e7eb",transition:"background 0.2s"}},o))}),A.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#1f2937",marginBottom:6},children:i.title}),A.jsx("div",{style:{fontSize:13,lineHeight:1.5,color:"#4b5563",marginBottom:r?0:14},children:i.text}),!r&&A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[A.jsxs("span",{style:{fontSize:11,color:"#9ca3af"},children:["Step ",t+1," of ",eh]}),A.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[A.jsx("button",{"data-testid":"tutorial-dismiss-btn",onClick:n,style:{background:"none",border:"none",cursor:"pointer",fontSize:12,color:"#9ca3af",padding:0,textDecoration:"underline"},children:"Dismiss tutorial"}),A.jsx("button",{"data-testid":"tutorial-next-btn",onClick:e,style:{padding:"4px 12px",fontSize:12,border:"1px solid #d1d5db",borderRadius:4,background:"white",color:"#374151",cursor:"pointer",fontWeight:500},children:t===eh-1?"Done":"Next"})]})]})]})}var lt;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{const s={};for(const o of r)s[o]=o;return s},t.getValidEnumValues=r=>{const s=t.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),o={};for(const c of s)o[c]=r[c];return t.objectValues(o)},t.objectValues=r=>t.objectKeys(r).map(function(s){return r[s]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},t.find=(r,s)=>{for(const o of r)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(lt||(lt={}));var sA;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(sA||(sA={}));const Se=lt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Vs=t=>{switch(typeof t){case"undefined":return Se.undefined;case"string":return Se.string;case"number":return Number.isNaN(t)?Se.nan:Se.number;case"boolean":return Se.boolean;case"function":return Se.function;case"bigint":return Se.bigint;case"symbol":return Se.symbol;case"object":return Array.isArray(t)?Se.array:t===null?Se.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Se.promise:typeof Map<"u"&&t instanceof Map?Se.map:typeof Set<"u"&&t instanceof Set?Se.set:typeof Date<"u"&&t instanceof Date?Se.date:Se.object;default:return Se.unknown}},ue=lt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ss extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},i={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)i._errors.push(n(o));else{let c=i,f=0;for(;f<o.path.length;){const d=o.path[f];f===o.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(n(o))):c[d]=c[d]||{_errors:[]},c=c[d],f++}}};return r(this),i}static assert(e){if(!(e instanceof ss))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,lt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const r of this.issues)if(r.path.length>0){const s=r.path[0];n[s]=n[s]||[],n[s].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}ss.create=t=>new ss(t);const Wb=(t,e)=>{let n;switch(t.code){case ue.invalid_type:t.received===Se.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ue.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,lt.jsonStringifyReplacer)}`;break;case ue.unrecognized_keys:n=`Unrecognized key(s) in object: ${lt.joinValues(t.keys,", ")}`;break;case ue.invalid_union:n="Invalid input";break;case ue.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${lt.joinValues(t.options)}`;break;case ue.invalid_enum_value:n=`Invalid enum value. Expected ${lt.joinValues(t.options)}, received '${t.received}'`;break;case ue.invalid_arguments:n="Invalid function arguments";break;case ue.invalid_return_type:n="Invalid function return type";break;case ue.invalid_date:n="Invalid date";break;case ue.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:lt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ue.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ue.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ue.custom:n="Invalid input";break;case ue.invalid_intersection_types:n="Intersection results could not be merged";break;case ue.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ue.not_finite:n="Number must be finite";break;default:n=e.defaultError,lt.assertNever(t)}return{message:n}};let vF=Wb;function kF(){return vF}const CF=t=>{const{data:e,path:n,errorMaps:i,issueData:r}=t,s=[...n,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let c="";const f=i.filter(d=>!!d).slice().reverse();for(const d of f)c=d(o,{data:e,defaultError:c}).message;return{...r,path:s,message:c}};function ye(t,e){const n=kF(),i=CF({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Wb?void 0:Wb].filter(r=>!!r)});t.common.issues.push(i)}class wi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const r of n){if(r.status==="aborted")return Re;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const r of n){const s=await r.key,o=await r.value;i.push({key:s,value:o})}return wi.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const r of n){const{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return Re;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(i[s.value]=o.value)}return{status:e.value,value:i}}}const Re=Object.freeze({status:"aborted"}),Xc=t=>({status:"dirty",value:t}),$i=t=>({status:"valid",value:t}),lA=t=>t.status==="aborted",oA=t=>t.status==="dirty",Na=t=>t.status==="valid",Ep=t=>typeof Promise<"u"&&t instanceof Promise;var ke;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ke||(ke={}));class ll{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const aA=(t,e)=>{if(Na(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ss(t.common.issues);return this._error=n,this._error}}};function Ke(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(o,c)=>{const{message:f}=t;return o.code==="invalid_enum_value"?{message:f??c.defaultError}:typeof c.data>"u"?{message:f??i??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:f??n??c.defaultError}},description:r}}class nt{get description(){return this._def.description}_getType(e){return Vs(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Vs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wi,ctx:{common:e.parent.common,data:e.data,parsedType:Vs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ep(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){const i={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vs(e)},r=this._parseSync({data:e,path:i.path,parent:i});return aA(i,r)}"~validate"(e){var i,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vs(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return Na(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(r=(i=s==null?void 0:s.message)==null?void 0:i.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(s=>Na(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vs(e)},r=this._parse({data:e,path:i.path,parent:i}),s=await(Ep(r)?r:Promise.resolve(r));return aA(i,s)}refine(e,n){const i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,s)=>{const o=e(r),c=()=>s.addIssue({code:ue.custom,...i(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(f=>f?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new za({schema:this,typeName:ze.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return el.create(this,this._def)}nullable(){return La.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return br.create(this)}promise(){return Op.create(this,this._def)}or(e){return Ap.create([this,e],this._def)}and(e){return Mp.create(this,e,this._def)}transform(e){return new za({...Ke(this._def),schema:this,typeName:ze.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new e1({...Ke(this._def),innerType:this,defaultValue:n,typeName:ze.ZodDefault})}brand(){return new KF({typeName:ze.ZodBranded,type:this,...Ke(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new t1({...Ke(this._def),innerType:this,catchValue:n,typeName:ze.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return jx.create(this,e)}readonly(){return n1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const EF=/^c[^\s-]{8,}$/i,TF=/^[0-9a-z]+$/,AF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,MF=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,OF=/^[a-z0-9_-]{21}$/i,_F=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,DF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,NF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,RF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let I0;const zF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,LF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,IF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,BF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,n2="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",HF=new RegExp(`^${n2}$`);function i2(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function VF(t){return new RegExp(`^${i2(t)}$`)}function PF(t){let e=`${n2}T${i2(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function $F(t,e){return!!((e==="v4"||!e)&&zF.test(t)||(e==="v6"||!e)&&IF.test(t))}function FF(t,e){if(!_F.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function qF(t,e){return!!((e==="v4"||!e)&&LF.test(t)||(e==="v6"||!e)&&BF.test(t))}class Ul extends nt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Se.string){const s=this._getOrReturnCtx(e);return ye(s,{code:ue.invalid_type,expected:Se.string,received:s.parsedType}),Re}const i=new wi;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,c=e.data.length<s.value;(o||c)&&(r=this._getOrReturnCtx(e,r),o?ye(r,{code:ue.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&ye(r,{code:ue.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")NF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"email",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")I0||(I0=new RegExp(RF,"u")),I0.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"emoji",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")MF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"uuid",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")OF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"nanoid",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")EF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"cuid",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")TF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"cuid2",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")AF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"ulid",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),ye(r,{validation:"url",code:ue.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"regex",code:ue.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?PF(s).test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?HF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?VF(s).test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?DF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"duration",code:ue.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?$F(e.data,s.version)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"ip",code:ue.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?FF(e.data,s.alg)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"jwt",code:ue.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?qF(e.data,s.version)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"cidr",code:ue.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?jF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"base64",code:ue.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?UF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"base64url",code:ue.invalid_string,message:s.message}),i.dirty()):lt.assertNever(s);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:ue.invalid_string,...ke.errToObj(i)})}_addCheck(e){return new Ul({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ke.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ke.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ke.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ke.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ke.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ke.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ke.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ke.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ke.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ke.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ke.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ke.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ke.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...ke.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ke.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ke.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ke.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ke.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ke.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ke.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ke.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ke.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ke.errToObj(n)})}nonempty(e){return this.min(1,ke.errToObj(e))}trim(){return new Ul({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ul({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ul({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ul.create=t=>new Ul({checks:[],typeName:ze.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Ke(t)});function YF(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,s=Number.parseInt(t.toFixed(r).replace(".","")),o=Number.parseInt(e.toFixed(r).replace(".",""));return s%o/10**r}class Ku extends nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Se.number){const s=this._getOrReturnCtx(e);return ye(s,{code:ue.invalid_type,expected:Se.number,received:s.parsedType}),Re}let i;const r=new wi;for(const s of this._def.checks)s.kind==="int"?lt.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?YF(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.not_finite,message:s.message}),r.dirty()):lt.assertNever(s);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ke.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ke.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ke.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ke.toString(n))}setLimit(e,n,i,r){return new Ku({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ke.toString(r)}]})}_addCheck(e){return new Ku({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ke.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ke.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ke.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ke.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ke.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ke.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ke.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ke.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ke.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&<.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Ku.create=t=>new Ku({checks:[],typeName:ze.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ke(t)});class Gu extends nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Se.bigint)return this._getInvalidInput(e);let i;const r=new wi;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):lt.assertNever(s);return{status:r.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return ye(n,{code:ue.invalid_type,expected:Se.bigint,received:n.parsedType}),Re}gte(e,n){return this.setLimit("min",e,!0,ke.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ke.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ke.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ke.toString(n))}setLimit(e,n,i,r){return new Gu({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ke.toString(r)}]})}_addCheck(e){return new Gu({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ke.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ke.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ke.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ke.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ke.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Gu.create=t=>new Gu({checks:[],typeName:ze.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Ke(t)});class cA extends nt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Se.boolean){const i=this._getOrReturnCtx(e);return ye(i,{code:ue.invalid_type,expected:Se.boolean,received:i.parsedType}),Re}return $i(e.data)}}cA.create=t=>new cA({typeName:ze.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ke(t)});class Tp extends nt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Se.date){const s=this._getOrReturnCtx(e);return ye(s,{code:ue.invalid_type,expected:Se.date,received:s.parsedType}),Re}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ye(s,{code:ue.invalid_date}),Re}const i=new wi;let r;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):lt.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Tp({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ke.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ke.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Tp.create=t=>new Tp({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ze.ZodDate,...Ke(t)});class uA extends nt{_parse(e){if(this._getType(e)!==Se.symbol){const i=this._getOrReturnCtx(e);return ye(i,{code:ue.invalid_type,expected:Se.symbol,received:i.parsedType}),Re}return $i(e.data)}}uA.create=t=>new uA({typeName:ze.ZodSymbol,...Ke(t)});class fA extends nt{_parse(e){if(this._getType(e)!==Se.undefined){const i=this._getOrReturnCtx(e);return ye(i,{code:ue.invalid_type,expected:Se.undefined,received:i.parsedType}),Re}return $i(e.data)}}fA.create=t=>new fA({typeName:ze.ZodUndefined,...Ke(t)});class dA extends nt{_parse(e){if(this._getType(e)!==Se.null){const i=this._getOrReturnCtx(e);return ye(i,{code:ue.invalid_type,expected:Se.null,received:i.parsedType}),Re}return $i(e.data)}}dA.create=t=>new dA({typeName:ze.ZodNull,...Ke(t)});class hA extends nt{constructor(){super(...arguments),this._any=!0}_parse(e){return $i(e.data)}}hA.create=t=>new hA({typeName:ze.ZodAny,...Ke(t)});class pA extends nt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return $i(e.data)}}pA.create=t=>new pA({typeName:ze.ZodUnknown,...Ke(t)});class ol extends nt{_parse(e){const n=this._getOrReturnCtx(e);return ye(n,{code:ue.invalid_type,expected:Se.never,received:n.parsedType}),Re}}ol.create=t=>new ol({typeName:ze.ZodNever,...Ke(t)});class mA extends nt{_parse(e){if(this._getType(e)!==Se.undefined){const i=this._getOrReturnCtx(e);return ye(i,{code:ue.invalid_type,expected:Se.void,received:i.parsedType}),Re}return $i(e.data)}}mA.create=t=>new mA({typeName:ze.ZodVoid,...Ke(t)});class br extends nt{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==Se.array)return ye(n,{code:ue.invalid_type,expected:Se.array,received:n.parsedType}),Re;if(r.exactLength!==null){const o=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(o||c)&&(ye(n,{code:o?ue.too_big:ue.too_small,minimum:c?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(ye(n,{code:ue.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(ye(n,{code:ue.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>r.type._parseAsync(new ll(n,o,n.path,c)))).then(o=>wi.mergeArray(i,o));const s=[...n.data].map((o,c)=>r.type._parseSync(new ll(n,o,n.path,c)));return wi.mergeArray(i,s)}get element(){return this._def.type}min(e,n){return new br({...this._def,minLength:{value:e,message:ke.toString(n)}})}max(e,n){return new br({...this._def,maxLength:{value:e,message:ke.toString(n)}})}length(e,n){return new br({...this._def,exactLength:{value:e,message:ke.toString(n)}})}nonempty(e){return this.min(1,e)}}br.create=(t,e)=>new br({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ze.ZodArray,...Ke(e)});function ia(t){if(t instanceof nn){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=el.create(ia(i))}return new nn({...t._def,shape:()=>e})}else return t instanceof br?new br({...t._def,type:ia(t.element)}):t instanceof el?el.create(ia(t.unwrap())):t instanceof La?La.create(ia(t.unwrap())):t instanceof so?so.create(t.items.map(e=>ia(e))):t}class nn extends nt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=lt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Se.object){const d=this._getOrReturnCtx(e);return ye(d,{code:ue.invalid_type,expected:Se.object,received:d.parsedType}),Re}const{status:i,ctx:r}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof ol&&this._def.unknownKeys==="strip"))for(const d in r.data)o.includes(d)||c.push(d);const f=[];for(const d of o){const p=s[d],m=r.data[d];f.push({key:{status:"valid",value:d},value:p._parse(new ll(r,m,r.path,d)),alwaysSet:d in r.data})}if(this._def.catchall instanceof ol){const d=this._def.unknownKeys;if(d==="passthrough")for(const p of c)f.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(d==="strict")c.length>0&&(ye(r,{code:ue.unrecognized_keys,keys:c}),i.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const p of c){const m=r.data[p];f.push({key:{status:"valid",value:p},value:d._parse(new ll(r,m,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const d=[];for(const p of f){const m=await p.key,y=await p.value;d.push({key:m,value:y,alwaysSet:p.alwaysSet})}return d}).then(d=>wi.mergeObjectSync(i,d)):wi.mergeObjectSync(i,f)}get shape(){return this._def.shape()}strict(e){return ke.errToObj,new nn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,o;const r=((o=(s=this._def).errorMap)==null?void 0:o.call(s,n,i).message)??i.defaultError;return n.code==="unrecognized_keys"?{message:ke.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new nn({...this._def,unknownKeys:"strip"})}passthrough(){return new nn({...this._def,unknownKeys:"passthrough"})}extend(e){return new nn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ze.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new nn({...this._def,catchall:e})}pick(e){const n={};for(const i of lt.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new nn({...this._def,shape:()=>n})}omit(e){const n={};for(const i of lt.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new nn({...this._def,shape:()=>n})}deepPartial(){return ia(this)}partial(e){const n={};for(const i of lt.objectKeys(this.shape)){const r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new nn({...this._def,shape:()=>n})}required(e){const n={};for(const i of lt.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof el;)s=s._def.innerType;n[i]=s}return new nn({...this._def,shape:()=>n})}keyof(){return r2(lt.objectKeys(this.shape))}}nn.create=(t,e)=>new nn({shape:()=>t,unknownKeys:"strip",catchall:ol.create(),typeName:ze.ZodObject,...Ke(e)});nn.strictCreate=(t,e)=>new nn({shape:()=>t,unknownKeys:"strict",catchall:ol.create(),typeName:ze.ZodObject,...Ke(e)});nn.lazycreate=(t,e)=>new nn({shape:t,unknownKeys:"strip",catchall:ol.create(),typeName:ze.ZodObject,...Ke(e)});class Ap extends nt{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function r(s){for(const c of s)if(c.result.status==="valid")return c.result;for(const c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=s.map(c=>new ss(c.ctx.common.issues));return ye(n,{code:ue.invalid_union,unionErrors:o}),Re}if(n.common.async)return Promise.all(i.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(r);{let s;const o=[];for(const f of i){const d={...n,common:{...n.common,issues:[]},parent:null},p=f._parseSync({data:n.data,path:n.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const c=o.map(f=>new ss(f));return ye(n,{code:ue.invalid_union,unionErrors:c}),Re}}get options(){return this._def.options}}Ap.create=(t,e)=>new Ap({options:t,typeName:ze.ZodUnion,...Ke(e)});function Qb(t,e){const n=Vs(t),i=Vs(e);if(t===e)return{valid:!0,data:t};if(n===Se.object&&i===Se.object){const r=lt.objectKeys(e),s=lt.objectKeys(t).filter(c=>r.indexOf(c)!==-1),o={...t,...e};for(const c of s){const f=Qb(t[c],e[c]);if(!f.valid)return{valid:!1};o[c]=f.data}return{valid:!0,data:o}}else if(n===Se.array&&i===Se.array){if(t.length!==e.length)return{valid:!1};const r=[];for(let s=0;s<t.length;s++){const o=t[s],c=e[s],f=Qb(o,c);if(!f.valid)return{valid:!1};r.push(f.data)}return{valid:!0,data:r}}else return n===Se.date&&i===Se.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Mp extends nt{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),r=(s,o)=>{if(lA(s)||lA(o))return Re;const c=Qb(s.value,o.value);return c.valid?((oA(s)||oA(o))&&n.dirty(),{status:n.value,value:c.data}):(ye(i,{code:ue.invalid_intersection_types}),Re)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Mp.create=(t,e,n)=>new Mp({left:t,right:e,typeName:ze.ZodIntersection,...Ke(n)});class so extends nt{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==Se.array)return ye(i,{code:ue.invalid_type,expected:Se.array,received:i.parsedType}),Re;if(i.data.length<this._def.items.length)return ye(i,{code:ue.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Re;!this._def.rest&&i.data.length>this._def.items.length&&(ye(i,{code:ue.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((o,c)=>{const f=this._def.items[c]||this._def.rest;return f?f._parse(new ll(i,o,i.path,c)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>wi.mergeArray(n,o)):wi.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new so({...this._def,rest:e})}}so.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new so({items:t,typeName:ze.ZodTuple,rest:null,...Ke(e)})};class gA extends nt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==Se.map)return ye(i,{code:ue.invalid_type,expected:Se.map,received:i.parsedType}),Re;const r=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([c,f],d)=>({key:r._parse(new ll(i,c,i.path,[d,"key"])),value:s._parse(new ll(i,f,i.path,[d,"value"]))}));if(i.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const f of o){const d=await f.key,p=await f.value;if(d.status==="aborted"||p.status==="aborted")return Re;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(d.value,p.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const f of o){const d=f.key,p=f.value;if(d.status==="aborted"||p.status==="aborted")return Re;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(d.value,p.value)}return{status:n.value,value:c}}}}gA.create=(t,e,n)=>new gA({valueType:e,keyType:t,typeName:ze.ZodMap,...Ke(n)});class Zu extends nt{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==Se.set)return ye(i,{code:ue.invalid_type,expected:Se.set,received:i.parsedType}),Re;const r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(ye(i,{code:ue.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(ye(i,{code:ue.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());const s=this._def.valueType;function o(f){const d=new Set;for(const p of f){if(p.status==="aborted")return Re;p.status==="dirty"&&n.dirty(),d.add(p.value)}return{status:n.value,value:d}}const c=[...i.data.values()].map((f,d)=>s._parse(new ll(i,f,i.path,d)));return i.common.async?Promise.all(c).then(f=>o(f)):o(c)}min(e,n){return new Zu({...this._def,minSize:{value:e,message:ke.toString(n)}})}max(e,n){return new Zu({...this._def,maxSize:{value:e,message:ke.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Zu.create=(t,e)=>new Zu({valueType:t,minSize:null,maxSize:null,typeName:ze.ZodSet,...Ke(e)});class yA extends nt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}yA.create=(t,e)=>new yA({getter:t,typeName:ze.ZodLazy,...Ke(e)});class bA extends nt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ye(n,{received:n.data,code:ue.invalid_literal,expected:this._def.value}),Re}return{status:"valid",value:e.data}}get value(){return this._def.value}}bA.create=(t,e)=>new bA({value:t,typeName:ze.ZodLiteral,...Ke(e)});function r2(t,e){return new Ra({values:t,typeName:ze.ZodEnum,...Ke(e)})}class Ra extends nt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return ye(n,{expected:lt.joinValues(i),received:n.parsedType,code:ue.invalid_type}),Re}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return ye(n,{received:n.data,code:ue.invalid_enum_value,options:i}),Re}return $i(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Ra.create(e,{...this._def,...n})}exclude(e,n=this._def){return Ra.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}Ra.create=r2;class xA extends nt{_parse(e){const n=lt.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==Se.string&&i.parsedType!==Se.number){const r=lt.objectValues(n);return ye(i,{expected:lt.joinValues(r),received:i.parsedType,code:ue.invalid_type}),Re}if(this._cache||(this._cache=new Set(lt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=lt.objectValues(n);return ye(i,{received:i.data,code:ue.invalid_enum_value,options:r}),Re}return $i(e.data)}get enum(){return this._def.values}}xA.create=(t,e)=>new xA({values:t,typeName:ze.ZodNativeEnum,...Ke(e)});class Op extends nt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Se.promise&&n.common.async===!1)return ye(n,{code:ue.invalid_type,expected:Se.promise,received:n.parsedType}),Re;const i=n.parsedType===Se.promise?n.data:Promise.resolve(n.data);return $i(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Op.create=(t,e)=>new Op({type:t,typeName:ze.ZodPromise,...Ke(e)});class za extends nt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ze.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:o=>{ye(i,o),o.fatal?n.abort():n.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const o=r.transform(i.data,s);if(i.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return Re;const f=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return f.status==="aborted"?Re:f.status==="dirty"||n.value==="dirty"?Xc(f.value):f});{if(n.value==="aborted")return Re;const c=this._def.schema._parseSync({data:o,path:i.path,parent:i});return c.status==="aborted"?Re:c.status==="dirty"||n.value==="dirty"?Xc(c.value):c}}if(r.type==="refinement"){const o=c=>{const f=r.refinement(c,s);if(i.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?Re:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?Re:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){const o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Na(o))return Re;const c=r.transform(o.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>Na(o)?Promise.resolve(r.transform(o.value,s)).then(c=>({status:n.value,value:c})):Re);lt.assertNever(r)}}za.create=(t,e,n)=>new za({schema:t,typeName:ze.ZodEffects,effect:e,...Ke(n)});za.createWithPreprocess=(t,e,n)=>new za({schema:e,effect:{type:"preprocess",transform:t},typeName:ze.ZodEffects,...Ke(n)});class el extends nt{_parse(e){return this._getType(e)===Se.undefined?$i(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}el.create=(t,e)=>new el({innerType:t,typeName:ze.ZodOptional,...Ke(e)});class La extends nt{_parse(e){return this._getType(e)===Se.null?$i(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}La.create=(t,e)=>new La({innerType:t,typeName:ze.ZodNullable,...Ke(e)});class e1 extends nt{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===Se.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}e1.create=(t,e)=>new e1({innerType:t,typeName:ze.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ke(e)});class t1 extends nt{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ep(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ss(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ss(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}t1.create=(t,e)=>new t1({innerType:t,typeName:ze.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ke(e)});class SA extends nt{_parse(e){if(this._getType(e)!==Se.nan){const i=this._getOrReturnCtx(e);return ye(i,{code:ue.invalid_type,expected:Se.nan,received:i.parsedType}),Re}return{status:"valid",value:e.data}}}SA.create=t=>new SA({typeName:ze.ZodNaN,...Ke(t)});class KF extends nt{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class jx extends nt{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Re:s.status==="dirty"?(n.dirty(),Xc(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?Re:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new jx({in:e,out:n,typeName:ze.ZodPipeline})}}class n1 extends nt{_parse(e){const n=this._def.innerType._parse(e),i=r=>(Na(r)&&(r.value=Object.freeze(r.value)),r);return Ep(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}}n1.create=(t,e)=>new n1({innerType:t,typeName:ze.ZodReadonly,...Ke(e)});var ze;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ze||(ze={}));ol.create;br.create;Ap.create;Mp.create;so.create;const sr=Ra.create;Op.create;el.create;La.create;sr(["highlight","comment","suggestion","overlay","question","flag"]);sr(["pending","accepted","dismissed"]);sr(["normal","urgent"]);const GF=sr(["all","urgent-only","paused"]);sr(["yellow","red","green","blue","purple"]);sr(["info","warning","error","success"]);sr(["user","claude","import"]);sr(["accept","dismiss"]);sr(["markdown","json"]);sr(["md","txt","html","docx"]);sr(["RANGE_GONE","RANGE_MOVED","FILE_LOCKED","FILE_NOT_FOUND","NO_DOCUMENT","INVALID_RANGE","FORMAT_ERROR","PERMISSION_DENIED"]);function ZF(t,e){return t.status!=="pending"||e==="all"?!0:e==="urgent-only"?t.priority==="urgent"||t.type==="flag"||t.type==="question":!1}function JF(t,e){return N.useMemo(()=>{const n=[];let i=0;for(const r of t)ZF(r,e)?n.push(r):r.status==="pending"&&i++;return{visibleAnnotations:n,heldCount:i}},[t,e])}function XF(){const[t,e]=N.useState(!1),n=N.useCallback(s=>{s.dataTransfer.types.includes("Files")&&(s.preventDefault(),e(!0))},[]),i=N.useCallback(s=>{(s.currentTarget===s.target||!s.currentTarget.contains(s.relatedTarget))&&e(!1)},[]),r=N.useCallback(async s=>{if(e(!1),!s.dataTransfer.files.length)return;s.preventDefault();const o=s.dataTransfer.files[0],c=await yD(o);try{const f=await fetch(`${qu}/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileName:o.name,content:c})});if(!f.ok){const d=await f.json().catch(()=>({message:"Upload failed"}));console.error("[useFileDrop] Upload failed:",f.status,d.message??d.error)}}catch{console.error("[useFileDrop] Server unreachable — file drop ignored")}},[]);return{fileDragOver:t,handleEditorDragOver:n,handleEditorDragLeave:i,handleEditorDrop:r}}function WF(){const[t,e]=N.useState([]),n=N.useRef(new Map),i=N.useCallback((o,c)=>{const f=n.current.get(o);f&&clearTimeout(f);const d=Qk[c]??Qk.info,p=setTimeout(()=>{e(m=>m.filter(y=>y.id!==o)),n.current.delete(o)},d);n.current.set(o,p)},[]),r=N.useCallback(o=>{const c=n.current.get(o);c&&(clearTimeout(c),n.current.delete(o))},[]),s=N.useCallback(o=>{e(c=>c.filter(f=>f.id!==o)),r(o)},[r]);return N.useEffect(()=>{const o=`http://localhost:${c1}/api/notify-stream`,c=new EventSource(o);return c.onmessage=f=>{let d;try{d=JSON.parse(f.data)}catch{console.warn("[useNotifications] Malformed SSE data:",f.data);return}e(p=>{if(d.dedupKey){const b=p.findIndex(S=>S.dedupKey===d.dedupKey);if(b!==-1){const S=p[b];r(S.id);const v={...d,count:S.count+1},k=[...p];return k[b]=v,i(v.id,v.severity),k}}const m={...d,count:1},y=[...p,m];for(;y.length>XR;){const b=y.shift();r(b.id)}return i(m.id,m.severity),y})},c.onerror=()=>{c.readyState===EventSource.CLOSED&&console.warn("[useNotifications] EventSource permanently closed. Notifications will not be delivered. Is the server running?")},()=>{c.close();for(const f of n.current.values())clearTimeout(f);n.current.clear()}},[i,r]),{toasts:t,dismiss:s}}function QF(t){const[e,n]=N.useState(!1),[i,r]=N.useState(null),s=N.useRef(0),{pendingCount:o,acceptedCount:c,dismissedCount:f}=N.useMemo(()=>{let p=0,m=0,y=0;for(const b of t)b.status==="pending"?p++:b.status==="accepted"?m++:b.status==="dismissed"&&y++;return{pendingCount:p,acceptedCount:m,dismissedCount:y}},[t]);N.useEffect(()=>{const p=c+f;s.current>0&&o===0&&p>0&&(r({accepted:c,dismissed:f,total:p}),n(!0)),s.current=o},[o,c,f]);const d=N.useCallback(()=>{n(!1)},[]);return{pendingCount:o,showReviewSummary:e,reviewSummaryData:i,dismissReviewSummary:d}}function wA(t,e){const n=new Set(e),i=t.filter(o=>n.has(o)),r=new Set(i),s=e.filter(o=>!r.has(o));return[...i,...s]}function eq(t,e,n,i,r="left"){const s=t.filter(m=>i.has(m)),o=s.indexOf(e),c=s.indexOf(n);if(o===-1||c===-1)return s;const f=[...s];f.splice(o,1);const d=f.indexOf(n),p=r==="right"?d+1:d;return f.splice(p,0,e),f}function tq(t){const[e,n]=N.useState([]),i=N.useMemo(()=>{const o=new Map(t.map(d=>[d.id,d])),c=t.map(d=>d.id);return wA(e,c).map(d=>o.get(d)).filter(Boolean)},[t,e]),r=N.useMemo(()=>t.map(o=>o.id),[t]);N.useEffect(()=>{n(o=>{const c=wA(o,r);return o.length===c.length&&o.every((f,d)=>f===c[d])?o:c})},[r]);const s=N.useCallback(function(c,f,d="left"){if(c===f)return;const p=new Set(r);n(m=>eq(m,c,f,p,d))},[r]);return{orderedTabs:i,reorder:s}}function nq(){try{return localStorage.getItem(zA)==="true"}catch{return!1}}function vA(){try{localStorage.setItem(zA,"true")}catch{}}function iq(t,e,n){const[i,r]=N.useState(nq),[s,o]=N.useState(0),c=N.useRef(0),d=!i&&n==="welcome.md";N.useEffect(()=>{if(!d||s!==0)return;const b=t.filter(v=>v.id.startsWith(WR));if(b.length===0)return;b.some(v=>v.status!=="pending")&&(c.current=Date.now(),o(1))},[d,s,t]),N.useEffect(()=>{if(!d||s!==1)return;t.some(S=>S.author==="user")&&(c.current=Date.now(),o(2))},[d,s,t]);const p=e.current;N.useEffect(()=>{if(!d||s!==2||!p)return;const b=()=>{Date.now()-c.current<2e3||p.isFocused&&(c.current=Date.now(),o(3))};return p.on("update",b),()=>{p.off("update",b)}},[d,s,p]),N.useEffect(()=>{if(!d||s!==3)return;const b=setTimeout(()=>{vA(),r(!0)},3e3);return()=>clearTimeout(b)},[d,s]);const m=N.useCallback(()=>{vA(),r(!0)},[]),y=N.useCallback(()=>{c.current=Date.now(),o(b=>Math.min(b+1,3))},[]);return{tutorialActive:d,currentStep:s,dismissTutorial:m,nextStep:y}}const rq=Math.floor,sq=(t,e)=>t<e?t:e,lq=(t,e)=>t>e?t:e,s2=128,gh=127,oq=Number.MAX_SAFE_INTEGER,aq=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,i=new Uint8Array(n);for(let r=0;r<n;r++)i[r]=e.codePointAt(r);return i},Ju=typeof TextEncoder<"u"?new TextEncoder:null,cq=t=>Ju.encode(t),uq=Ju?cq:aq;let pu=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});pu&&pu.decode(new Uint8Array).length===1&&(pu=null);const _p=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},hm=(t,e)=>{for(;e>gh;)_p(t,s2|gh&e),e=rq(e/128);_p(t,gh&e)},i1=new Uint8Array(3e4),fq=i1.length/3,dq=(t,e)=>{if(e.length<fq){const n=Ju.encodeInto(e,i1).written||0;hm(t,n);for(let i=0;i<n;i++)_p(t,i1[i])}else gq(t,uq(e))},hq=(t,e)=>{const n=unescape(encodeURIComponent(e)),i=n.length;hm(t,i);for(let r=0;r<i;r++)_p(t,n.codePointAt(r))},pq=Ju&&Ju.encodeInto?dq:hq,mq=(t,e)=>{const n=t.cbuf.length,i=t.cpos,r=sq(n-i,e.length),s=e.length-r;t.cbuf.set(e.subarray(0,r),i),t.cpos+=r,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(lq(n*2,s)),t.cbuf.set(e.subarray(r)),t.cpos=s)},gq=(t,e)=>{hm(t,e.byteLength),mq(t,e)},l2=t=>new Error(t),yq=l2("Unexpected end of array"),bq=l2("Integer out of Range"),xq=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},Sq=t=>xq(t,Ux(t)),kA=t=>t.arr[t.pos++],Ux=t=>{let e=0,n=1;const i=t.arr.length;for(;t.pos<i;){const r=t.arr[t.pos++];if(e=e+(r&gh)*n,n*=128,r<s2)return e;if(e>oq)throw bq}throw yq},wq=t=>{let e=Ux(t);if(e===0)return"";{let n=String.fromCodePoint(kA(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(kA(t));else for(;e>0;){const i=e<1e4?e:1e4,r=t.arr.subarray(t.pos,t.pos+i);t.pos+=i,n+=String.fromCodePoint.apply(null,r),e-=i}return decodeURIComponent(escape(n))}},vq=t=>pu.decode(Sq(t)),CA=pu?vq:wq;var xa;(function(t){t[t.Token=0]="Token",t[t.PermissionDenied=1]="PermissionDenied",t[t.Authenticated=2]="Authenticated"})(xa||(xa={}));const kq=(t,e)=>{hm(t,xa.Token),pq(t,e)},Cq=(t,e,n,i)=>{switch(Ux(t)){case xa.Token:{e();break}case xa.PermissionDenied:{n(CA(t));break}case xa.Authenticated:{i(CA(t));break}}},EA=t=>Array.from(t.entries()).map(([e,n])=>({clientId:e,...n}));var r1;(function(t){t[t.Connecting=0]="Connecting",t[t.Open=1]="Open",t[t.Closing=2]="Closing",t[t.Closed=3]="Closed"})(r1||(r1={}));function Eq(t){return t||(t={}),{delay:t.delay===void 0?200:t.delay,initialDelay:t.initialDelay===void 0?0:t.initialDelay,minDelay:t.minDelay===void 0?0:t.minDelay,maxDelay:t.maxDelay===void 0?0:t.maxDelay,factor:t.factor===void 0?0:t.factor,maxAttempts:t.maxAttempts===void 0?3:t.maxAttempts,timeout:t.timeout===void 0?0:t.timeout,jitter:t.jitter===!0,initialJitter:t.initialJitter===!0,handleError:t.handleError===void 0?null:t.handleError,handleTimeout:t.handleTimeout===void 0?null:t.handleTimeout,beforeAttempt:t.beforeAttempt===void 0?null:t.beforeAttempt,calculateDelay:t.calculateDelay===void 0?null:t.calculateDelay}}async function B0(t){return new Promise(e=>setTimeout(e,t))}function Tq(t,e){let n=e.delay;if(n===0)return 0;if(e.factor&&(n*=Math.pow(e.factor,t.attemptNum-1),e.maxDelay!==0&&(n=Math.min(n,e.maxDelay))),e.jitter){const i=Math.ceil(e.minDelay),r=Math.floor(n);n=Math.floor(Math.random()*(r-i+1))+i}return Math.round(n)}async function Aq(t,e){const n=Eq(e);for(const c of["delay","initialDelay","minDelay","maxDelay","maxAttempts","timeout"]){const f=n[c];if(!Number.isInteger(f)||f<0)throw new Error(`Value for ${c} must be an integer greater than or equal to 0`)}if(n.factor.constructor!==Number||n.factor<0)throw new Error("Value for factor must be a number greater than or equal to 0");if(n.delay<n.minDelay)throw new Error(`delay cannot be less than minDelay (delay: ${n.delay}, minDelay: ${n.minDelay}`);const i={attemptNum:0,attemptsRemaining:n.maxAttempts?n.maxAttempts:-1,aborted:!1,abort(){i.aborted=!0}},r=n.calculateDelay||Tq;async function s(){if(n.beforeAttempt&&n.beforeAttempt(i,n),i.aborted){const f=new Error("Attempt aborted");throw f.code="ATTEMPT_ABORTED",f}const c=async f=>{if(n.handleError&&await n.handleError(f,i,n),i.aborted||i.attemptsRemaining===0)throw f;i.attemptNum++;const d=r(i,n);return d&&await B0(d),s()};return i.attemptsRemaining>0&&i.attemptsRemaining--,n.timeout?new Promise((f,d)=>{const p=setTimeout(()=>{if(n.handleTimeout)try{f(n.handleTimeout(i,n))}catch(m){d(m)}else{const m=new Error(`Retry timeout (attemptNum: ${i.attemptNum}, timeout: ${n.timeout})`);m.code="ATTEMPT_TIMEOUT",d(m)}},n.timeout);t(i,n).then(m=>{clearTimeout(p),f(m)}).catch(m=>{clearTimeout(p),c(m).then(f).catch(d)})}):t(i,n).catch(c)}const o=n.calculateDelay?n.calculateDelay(i,n):n.initialDelay;if(o&&await B0(o),i.attemptNum<1&&n.initialJitter){const c=r(i,n);c&&await B0(c)}return s()}const o2=Math.floor,Mq=(t,e)=>t<e?t:e,Oq=(t,e)=>t>e?t:e,_q=64,Dp=128,Dq=63,mu=127,a2=Number.MAX_SAFE_INTEGER,Nq=()=>new Set,Rq=Array.from,zq=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,i=new Uint8Array(n);for(let r=0;r<n;r++)i[r]=e.codePointAt(r);return i},Xu=typeof TextEncoder<"u"?new TextEncoder:null,Lq=t=>Xu.encode(t),Iq=Xu?Lq:zq;let gu=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});gu&&gu.decode(new Uint8Array).length===1&&(gu=null);class Bq{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Hx=()=>new Bq,c2=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},Vx=t=>{const e=new Uint8Array(c2(t));let n=0;for(let i=0;i<t.bufs.length;i++){const r=t.bufs[i];e.set(r,n),n+=r.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},Np=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},On=(t,e)=>{for(;e>mu;)Np(t,Dp|mu&e),e=o2(e/128);Np(t,mu&e)},s1=new Uint8Array(3e4),jq=s1.length/3,Uq=(t,e)=>{if(e.length<jq){const n=Xu.encodeInto(e,s1).written||0;On(t,n);for(let i=0;i<n;i++)Np(t,s1[i])}else Ka(t,Iq(e))},Hq=(t,e)=>{const n=unescape(encodeURIComponent(e)),i=n.length;On(t,i);for(let r=0;r<i;r++)Np(t,n.codePointAt(r))},ls=Xu&&Xu.encodeInto?Uq:Hq,Vq=(t,e)=>{const n=t.cbuf.length,i=t.cpos,r=Mq(n-i,e.length),s=e.length-r;t.cbuf.set(e.subarray(0,r),i),t.cpos+=r,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Oq(n*2,s)),t.cbuf.set(e.subarray(r)),t.cpos=s)},Ka=(t,e)=>{On(t,e.byteLength),Vq(t,e)},u2=t=>new Error(t),f2=u2("Unexpected end of array"),d2=u2("Integer out of Range");class Pq{constructor(e){this.arr=e,this.pos=0}}const h2=t=>new Pq(t),$q=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},pm=t=>$q(t,Kl(t)),TA=t=>t.arr[t.pos++],Kl=t=>{let e=0,n=1;const i=t.arr.length;for(;t.pos<i;){const r=t.arr[t.pos++];if(e=e+(r&mu)*n,n*=128,r<Dp)return e;if(e>a2)throw d2}throw f2},Fq=t=>{let e=t.arr[t.pos++],n=e&Dq,i=64;const r=(e&_q)>0?-1:1;if((e&Dp)===0)return r*n;const s=t.arr.length;for(;t.pos<s;){if(e=t.arr[t.pos++],n=n+(e&mu)*i,i*=128,e<Dp)return r*n;if(n>a2)throw d2}throw f2},qq=t=>{let e=Kl(t);if(e===0)return"";{let n=String.fromCodePoint(TA(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(TA(t));else for(;e>0;){const i=e<1e4?e:1e4,r=t.arr.subarray(t.pos,t.pos+i);t.pos+=i,n+=String.fromCodePoint.apply(null,r),e-=i}return decodeURIComponent(escape(n))}},Yq=t=>gu.decode(pm(t)),Wu=gu?Yq:qq,Kq=t=>{const e=t.pos,n=Wu(t);return t.pos=e,n},Ia=Date.now,j0=()=>new Map,Gq=(t,e,n)=>{let i=t.get(e);return i===void 0&&t.set(e,i=n()),i};class Zq{constructor(){this._observers=j0()}on(e,n){Gq(this._observers,e,Nq).add(n)}once(e,n){const i=(...r)=>{this.off(e,i),n(...r)};this.on(e,i)}off(e,n){const i=this._observers.get(e);i!==void 0&&(i.delete(n),i.size===0&&this._observers.delete(e))}emit(e,n){return Rq((this._observers.get(e)||j0()).values()).forEach(i=>i(...n))}destroy(){this._observers=j0()}}const Jq=Object.keys,AA=t=>Jq(t).length,Xq=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Wq=(t,e)=>t===e,yu=(t,e)=>{if(t==null||e==null)return Wq(t,e);if(t.constructor!==e.constructor)return!1;if(t===e)return!0;switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;break}case Set:{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;break}case Map:{if(t.size!==e.size)return!1;for(const n of t.keys())if(!e.has(n)||!yu(t.get(n),e.get(n)))return!1;break}case Object:if(AA(t)!==AA(e))return!1;for(const n in t)if(!Xq(t,n)||!yu(t[n],e[n]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!yu(t[n],e[n]))return!1;break;default:return!1}return!0},U0=3e4;class Qq extends Zq{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const n=Ia();this.getLocalState()!==null&&U0/2<=n-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const i=[];this.meta.forEach((r,s)=>{s!==this.clientID&&U0<=n-r.lastUpdated&&this.states.has(s)&&i.push(s)}),i.length>0&&yh(this,i,"timeout")},o2(U0/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const n=this.clientID,i=this.meta.get(n),r=i===void 0?0:i.clock+1,s=this.states.get(n);e===null?this.states.delete(n):this.states.set(n,e),this.meta.set(n,{clock:r,lastUpdated:Ia()});const o=[],c=[],f=[],d=[];e===null?d.push(n):s==null?e!=null&&o.push(n):(c.push(n),yu(s,e)||f.push(n)),(o.length>0||f.length>0||d.length>0)&&this.emit("change",[{added:o,updated:f,removed:d},"local"]),this.emit("update",[{added:o,updated:c,removed:d},"local"])}setLocalStateField(e,n){const i=this.getLocalState();i!==null&&this.setLocalState({...i,[e]:n})}getStates(){return this.states}}const yh=(t,e,n)=>{const i=[];for(let r=0;r<e.length;r++){const s=e[r];if(t.states.has(s)){if(t.states.delete(s),s===t.clientID){const o=t.meta.get(s);t.meta.set(s,{clock:o.clock+1,lastUpdated:Ia()})}i.push(s)}}i.length>0&&(t.emit("change",[{added:[],updated:[],removed:i},n]),t.emit("update",[{added:[],updated:[],removed:i},n]))},l1=(t,e,n=t.states)=>{const i=e.length,r=Hx();On(r,i);for(let s=0;s<i;s++){const o=e[s],c=n.get(o)||null,f=t.meta.get(o).clock;On(r,o),On(r,f),ls(r,JSON.stringify(c))}return Vx(r)},eY=(t,e,n)=>{const i=h2(e),r=Ia(),s=[],o=[],c=[],f=[],d=Kl(i);for(let p=0;p<d;p++){const m=Kl(i);let y=Kl(i);const b=JSON.parse(Wu(i)),S=t.meta.get(m),v=t.states.get(m),k=S===void 0?0:S.clock;(k<y||k===y&&b===null&&t.states.has(m))&&(b===null?m===t.clientID&&t.getLocalState()!=null?y++:t.states.delete(m):t.states.set(m,b),t.meta.set(m,{clock:y,lastUpdated:r}),S===void 0&&b!==null?s.push(m):S!==void 0&&b===null?f.push(m):b!==null&&(yu(b,v)||c.push(m),o.push(m)))}(s.length>0||c.length>0||f.length>0)&&t.emit("change",[{added:s,updated:c,removed:f},n]),(s.length>0||o.length>0||f.length>0)&&t.emit("update",[{added:s,updated:o,removed:f},n])};class p2{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const i=this.callbacks[e];return i&&i.forEach(r=>r.apply(this,n)),this}off(e,n){const i=this.callbacks[e];return i&&(n?this.callbacks[e]=i.filter(r=>r!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}class o1{constructor(e){this.data=e,this.encoder=Hx(),this.decoder=h2(new Uint8Array(this.data))}peekVarString(){return Kq(this.decoder)}readVarUint(){return Kl(this.decoder)}readVarString(){return Wu(this.decoder)}readVarUint8Array(){return pm(this.decoder)}writeVarUint(e){return On(this.encoder,e)}writeVarString(e){return ls(this.encoder,e)}writeVarUint8Array(e){return Ka(this.encoder,e)}length(){return c2(this.encoder)}}var wn;(function(t){t[t.Sync=0]="Sync",t[t.Awareness=1]="Awareness",t[t.Auth=2]="Auth",t[t.QueryAwareness=3]="QueryAwareness",t[t.Stateless=5]="Stateless",t[t.CLOSE=7]="CLOSE",t[t.SyncStatus=8]="SyncStatus"})(wn||(wn={}));var Bn;(function(t){t.Connecting="connecting",t.Connected="connected",t.Disconnected="disconnected"})(Bn||(Bn={}));class co{constructor(){this.encoder=Hx()}get(e){return e.encoder}toUint8Array(){return Vx(this.encoder)}}class tY extends co{constructor(){super(...arguments),this.type=wn.CLOSE,this.description="Ask the server to close the connection"}get(e){return ls(this.encoder,e.documentName),On(this.encoder,this.type),this.encoder}}class nY extends p2{constructor(e){super(),this.messageQueue=[],this.configuration={url:"",autoConnect:!0,preserveTrailingSlash:!1,document:void 0,WebSocketPolyfill:void 0,messageReconnectTimeout:3e4,delay:1e3,initialDelay:0,factor:2,maxAttempts:0,minDelay:1e3,maxDelay:3e4,jitter:!0,timeout:0,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,handleTimeout:null,providerMap:new Map},this.webSocket=null,this.webSocketHandlers={},this.shouldConnect=!0,this.status=Bn.Disconnected,this.lastMessageReceived=0,this.identifier=0,this.intervals={connectionChecker:null},this.connectionAttempt=null,this.receivedOnOpenPayload=void 0,this.closeTries=0,this.setConfiguration(e),this.configuration.WebSocketPolyfill=e.WebSocketPolyfill?e.WebSocketPolyfill:WebSocket,this.on("open",this.configuration.onOpen),this.on("open",this.onOpen.bind(this)),this.on("connect",this.configuration.onConnect),this.on("message",this.configuration.onMessage),this.on("outgoingMessage",this.configuration.onOutgoingMessage),this.on("status",this.configuration.onStatus),this.on("disconnect",this.configuration.onDisconnect),this.on("close",this.configuration.onClose),this.on("destroy",this.configuration.onDestroy),this.on("awarenessUpdate",this.configuration.onAwarenessUpdate),this.on("awarenessChange",this.configuration.onAwarenessChange),this.on("close",this.onClose.bind(this)),this.on("message",this.onMessage.bind(this)),this.intervals.connectionChecker=setInterval(this.checkConnection.bind(this),this.configuration.messageReconnectTimeout/10),this.shouldConnect&&this.connect()}async onOpen(e){this.status=Bn.Connected,this.emit("status",{status:Bn.Connected}),this.cancelWebsocketRetry=void 0,this.receivedOnOpenPayload=e}attach(e){this.configuration.providerMap.set(e.configuration.name,e),this.status===Bn.Disconnected&&this.shouldConnect&&this.connect(),this.receivedOnOpenPayload&&this.status===Bn.Connected&&e.onOpen(this.receivedOnOpenPayload)}detach(e){this.configuration.providerMap.has(e.configuration.name)&&(e.send(tY,{documentName:e.configuration.name}),this.configuration.providerMap.delete(e.configuration.name))}setConfiguration(e={}){this.configuration={...this.configuration,...e},this.configuration.autoConnect||(this.shouldConnect=!1)}async connect(){if(this.status===Bn.Connected)return;this.cancelWebsocketRetry&&(this.cancelWebsocketRetry(),this.cancelWebsocketRetry=void 0),this.receivedOnOpenPayload=void 0,this.shouldConnect=!0;const e=()=>{let r=!1;return{retryPromise:Aq(this.createWebSocketConnection.bind(this),{delay:this.configuration.delay,initialDelay:this.configuration.initialDelay,factor:this.configuration.factor,maxAttempts:this.configuration.maxAttempts,minDelay:this.configuration.minDelay,maxDelay:this.configuration.maxDelay,jitter:this.configuration.jitter,timeout:this.configuration.timeout,handleTimeout:this.configuration.handleTimeout,beforeAttempt:o=>{(!this.shouldConnect||r)&&o.abort()}}).catch(o=>{if(o&&o.code!=="ATTEMPT_ABORTED")throw o}),cancelFunc:()=>{r=!0}}},{retryPromise:n,cancelFunc:i}=e();return this.cancelWebsocketRetry=i,n}attachWebSocketListeners(e,n){const{identifier:i}=e,r=d=>this.emit("message",d),s=d=>this.emit("close",{event:d}),o=d=>this.emit("open",d),c=d=>{n(d)};this.webSocketHandlers[i]={message:r,close:s,open:o,error:c};const f=this.webSocketHandlers[e.identifier];Object.keys(f).forEach(d=>{e.addEventListener(d,f[d])})}cleanupWebSocket(){if(!this.webSocket)return;const{identifier:e}=this.webSocket,n=this.webSocketHandlers[e];Object.keys(n).forEach(i=>{var r;(r=this.webSocket)===null||r===void 0||r.removeEventListener(i,n[i]),delete this.webSocketHandlers[e]}),this.webSocket.close(),this.webSocket=null}createWebSocketConnection(){return new Promise((e,n)=>{this.webSocket&&(this.messageQueue=[],this.cleanupWebSocket()),this.lastMessageReceived=0,this.identifier+=1;const i=new this.configuration.WebSocketPolyfill(this.url);i.binaryType="arraybuffer",i.identifier=this.identifier,this.attachWebSocketListeners(i,n),this.webSocket=i,this.status=Bn.Connecting,this.emit("status",{status:Bn.Connecting}),this.connectionAttempt={resolve:e,reject:n}})}onMessage(e){var n;this.resolveConnectionAttempt(),this.lastMessageReceived=Ia();const r=new o1(e.data).peekVarString();(n=this.configuration.providerMap.get(r))===null||n===void 0||n.onMessage(e)}resolveConnectionAttempt(){this.connectionAttempt&&(this.connectionAttempt.resolve(),this.connectionAttempt=null,this.status=Bn.Connected,this.emit("status",{status:Bn.Connected}),this.emit("connect"),this.messageQueue.forEach(e=>this.send(e)),this.messageQueue=[])}stopConnectionAttempt(){this.connectionAttempt=null}rejectConnectionAttempt(){var e;(e=this.connectionAttempt)===null||e===void 0||e.reject(),this.connectionAttempt=null}checkConnection(){var e;this.status===Bn.Connected&&this.lastMessageReceived&&(this.configuration.messageReconnectTimeout>=Ia()-this.lastMessageReceived||(this.closeTries+=1,this.closeTries>2?(this.onClose({event:{code:4408,reason:"forced"}}),this.closeTries=0):((e=this.webSocket)===null||e===void 0||e.close(),this.messageQueue=[])))}get serverUrl(){if(this.configuration.preserveTrailingSlash)return this.configuration.url;let e=this.configuration.url;for(;e[e.length-1]==="/";)e=e.slice(0,e.length-1);return e}get url(){return this.serverUrl}disconnect(){if(this.shouldConnect=!1,this.webSocket!==null)try{this.webSocket.close(),this.messageQueue=[]}catch(e){console.error(e)}}send(e){var n;((n=this.webSocket)===null||n===void 0?void 0:n.readyState)===r1.Open?this.webSocket.send(e):this.messageQueue.push(e)}onClose({event:e}){this.closeTries=0,this.cleanupWebSocket(),this.connectionAttempt&&this.rejectConnectionAttempt(),this.status=Bn.Disconnected,this.emit("status",{status:Bn.Disconnected}),this.emit("disconnect",{event:e}),!this.cancelWebsocketRetry&&this.shouldConnect&&setTimeout(()=>{this.connect()},this.configuration.delay)}destroy(){this.emit("destroy"),clearInterval(this.intervals.connectionChecker),this.stopConnectionAttempt(),this.disconnect(),this.removeAllListeners(),this.cleanupWebSocket()}}const m2=0,Px=1,g2=2,iY=(t,e)=>{On(t,m2);const n=I5(e);Ka(t,n)},rY=(t,e,n)=>{On(t,Px),Ka(t,N5(e,n))},sY=(t,e,n)=>rY(e,n,pm(t)),y2=(t,e,n)=>{try{O5(e,pm(t),n)}catch(i){console.error("Caught error while handling a Yjs update",i)}},lY=(t,e)=>{On(t,g2),Ka(t,e)},oY=y2,aY=(t,e,n,i)=>{const r=Kl(t);switch(r){case m2:sY(t,e,n);break;case Px:y2(t,n,i);break;case g2:oY(t,n,i);break;default:throw new Error("Unknown message type")}return r};class cY{constructor(e){this.message=e}apply(e,n){const{message:i}=this,r=i.readVarUint(),s=i.length();switch(r){case wn.Sync:this.applySyncMessage(e,n);break;case wn.Awareness:this.applyAwarenessMessage(e);break;case wn.Auth:this.applyAuthMessage(e);break;case wn.QueryAwareness:this.applyQueryAwarenessMessage(e);break;case wn.Stateless:e.receiveStateless(Wu(i.decoder));break;case wn.SyncStatus:this.applySyncStatusMessage(e,Fq(i.decoder)===1);break;case wn.CLOSE:const o={code:1e3,reason:Wu(i.decoder),target:e.configuration.websocketProvider.webSocket,type:"close"};e.onClose(),e.configuration.onClose({event:o}),e.forwardClose({event:o});break;default:throw new Error(`Can’t apply message of unknown type: ${r}`)}i.length()>s+1&&e.send(co,{encoder:i.encoder})}applySyncMessage(e,n){const{message:i}=this;i.writeVarUint(wn.Sync);const r=aY(i.decoder,i.encoder,e.document,e);n&&r===Px&&(e.synced=!0)}applySyncStatusMessage(e,n){n&&e.decrementUnsyncedChanges()}applyAwarenessMessage(e){if(!e.awareness)return;const{message:n}=this;eY(e.awareness,n.readVarUint8Array(),e)}applyAuthMessage(e){const{message:n}=this;Cq(n.decoder,e.sendToken.bind(e),e.permissionDeniedHandler.bind(e),e.authenticatedHandler.bind(e))}applyQueryAwarenessMessage(e){if(!e.awareness)return;const{message:n}=this;n.writeVarUint(wn.Awareness),n.writeVarUint8Array(l1(e.awareness,Array.from(e.awareness.getStates().keys())))}}class uY{constructor(e,n={}){this.message=new e,this.encoder=this.message.get(n)}create(){return Vx(this.encoder)}send(e){e==null||e.send(this.create())}}class fY extends co{constructor(){super(...arguments),this.type=wn.Auth,this.description="Authentication"}get(e){if(typeof e.token>"u")throw new Error("The authentication message requires `token` as an argument.");return ls(this.encoder,e.documentName),On(this.encoder,this.type),kq(this.encoder,e.token),this.encoder}}class MA extends co{constructor(){super(...arguments),this.type=wn.Awareness,this.description="Awareness states update"}get(e){if(typeof e.awareness>"u")throw new Error("The awareness message requires awareness as an argument");if(typeof e.clients>"u")throw new Error("The awareness message requires clients as an argument");ls(this.encoder,e.documentName),On(this.encoder,this.type);let n;return e.states===void 0?n=l1(e.awareness,e.clients):n=l1(e.awareness,e.clients,e.states),Ka(this.encoder,n),this.encoder}}class dY extends co{constructor(){super(...arguments),this.type=wn.Stateless,this.description="A stateless message"}get(e){var n;return ls(this.encoder,e.documentName),On(this.encoder,this.type),ls(this.encoder,(n=e.payload)!==null&&n!==void 0?n:""),this.encoder}}class OA extends co{constructor(){super(...arguments),this.type=wn.Sync,this.description="First sync step"}get(e){if(typeof e.document>"u")throw new Error("The sync step one message requires document as an argument");return ls(this.encoder,e.documentName),On(this.encoder,this.type),iY(this.encoder,e.document),this.encoder}}class hY extends co{constructor(){super(...arguments),this.type=wn.Sync,this.description="A document update"}get(e){return ls(this.encoder,e.documentName),On(this.encoder,this.type),lY(this.encoder,e.update),this.encoder}}class pY extends Error{constructor(){super(...arguments),this.code=1001}}class _A extends p2{constructor(e){var n,i,r;super(),this.configuration={name:"",document:void 0,awareness:void 0,token:null,forceSyncInterval:!1,onAuthenticated:()=>null,onAuthenticationFailed:()=>null,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onSynced:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,onStateless:()=>null,onUnsyncedChanges:()=>null},this.isSynced=!1,this.unsyncedChanges=0,this.isAuthenticated=!1,this.authorizedScope=void 0,this.manageSocket=!1,this._isAttached=!1,this.intervals={forceSync:null},this.boundDocumentUpdateHandler=this.documentUpdateHandler.bind(this),this.boundAwarenessUpdateHandler=this.awarenessUpdateHandler.bind(this),this.boundPageHide=this.pageHide.bind(this),this.boundOnOpen=this.onOpen.bind(this),this.boundOnClose=this.onClose.bind(this),this.forwardConnect=()=>this.emit("connect"),this.forwardStatus=s=>this.emit("status",s),this.forwardClose=s=>this.emit("close",s),this.forwardDisconnect=s=>this.emit("disconnect",s),this.forwardDestroy=()=>this.emit("destroy"),this.setConfiguration(e),this.configuration.document=e.document?e.document:new kr,this.configuration.awareness=e.awareness!==void 0?e.awareness:new Qq(this.document),this.on("open",this.configuration.onOpen),this.on("message",this.configuration.onMessage),this.on("outgoingMessage",this.configuration.onOutgoingMessage),this.on("synced",this.configuration.onSynced),this.on("destroy",this.configuration.onDestroy),this.on("awarenessUpdate",this.configuration.onAwarenessUpdate),this.on("awarenessChange",this.configuration.onAwarenessChange),this.on("stateless",this.configuration.onStateless),this.on("unsyncedChanges",this.configuration.onUnsyncedChanges),this.on("authenticated",this.configuration.onAuthenticated),this.on("authenticationFailed",this.configuration.onAuthenticationFailed),(n=this.awareness)===null||n===void 0||n.on("update",()=>{this.emit("awarenessUpdate",{states:EA(this.awareness.getStates())})}),(i=this.awareness)===null||i===void 0||i.on("change",()=>{this.emit("awarenessChange",{states:EA(this.awareness.getStates())})}),this.document.on("update",this.boundDocumentUpdateHandler),(r=this.awareness)===null||r===void 0||r.on("update",this.boundAwarenessUpdateHandler),this.registerEventListeners(),this.configuration.forceSyncInterval&&typeof this.configuration.forceSyncInterval=="number"&&(this.intervals.forceSync=setInterval(this.forceSync.bind(this),this.configuration.forceSyncInterval)),this.manageSocket&&this.attach()}setConfiguration(e={}){e.websocketProvider||(this.manageSocket=!0,this.configuration.websocketProvider=new nY(e)),this.configuration={...this.configuration,...e}}get document(){return this.configuration.document}get isAttached(){return this._isAttached}get awareness(){return this.configuration.awareness}get hasUnsyncedChanges(){return this.unsyncedChanges>0}resetUnsyncedChanges(){this.unsyncedChanges=1,this.emit("unsyncedChanges",{number:this.unsyncedChanges})}incrementUnsyncedChanges(){this.unsyncedChanges+=1,this.emit("unsyncedChanges",{number:this.unsyncedChanges})}decrementUnsyncedChanges(){this.unsyncedChanges>0&&(this.unsyncedChanges-=1),this.unsyncedChanges===0&&(this.synced=!0),this.emit("unsyncedChanges",{number:this.unsyncedChanges})}forceSync(){this.resetUnsyncedChanges(),this.send(OA,{document:this.document,documentName:this.configuration.name})}pageHide(){this.awareness&&yh(this.awareness,[this.document.clientID],"page hide")}registerEventListeners(){typeof window>"u"||!("addEventListener"in window)||window.addEventListener("pagehide",this.boundPageHide)}sendStateless(e){this.send(dY,{documentName:this.configuration.name,payload:e})}async sendToken(){let e;try{e=await this.getToken()}catch(n){this.permissionDeniedHandler(`Failed to get token during sendToken(): ${n}`);return}this.send(fY,{token:e??"",documentName:this.configuration.name})}documentUpdateHandler(e,n){n!==this&&(this.incrementUnsyncedChanges(),this.send(hY,{update:e,documentName:this.configuration.name}))}awarenessUpdateHandler({added:e,updated:n,removed:i},r){const s=e.concat(n).concat(i);this.send(MA,{awareness:this.awareness,clients:s,documentName:this.configuration.name})}get synced(){return this.isSynced}set synced(e){this.isSynced!==e&&(this.isSynced=e,e&&this.emit("synced",{state:e}))}receiveStateless(e){this.emit("stateless",{payload:e})}async connect(){if(this.manageSocket)return this.configuration.websocketProvider.connect();console.warn("HocuspocusProvider::connect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.")}disconnect(){if(this.manageSocket)return this.configuration.websocketProvider.disconnect();console.warn("HocuspocusProvider::disconnect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.")}async onOpen(e){this.isAuthenticated=!1,this.emit("open",{event:e}),await this.sendToken(),this.startSync()}async getToken(){return typeof this.configuration.token=="function"?await this.configuration.token():this.configuration.token}startSync(){this.resetUnsyncedChanges(),this.send(OA,{document:this.document,documentName:this.configuration.name}),this.awareness&&this.awareness.getLocalState()!==null&&this.send(MA,{awareness:this.awareness,clients:[this.document.clientID],documentName:this.configuration.name})}send(e,n){if(!this._isAttached)return;const i=new uY(e,n);this.emit("outgoingMessage",{message:i.message}),i.send(this.configuration.websocketProvider)}onMessage(e){const n=new o1(e.data),i=n.readVarString();n.writeVarString(i),this.emit("message",{event:e,message:new o1(e.data)}),new cY(n).apply(this,!0)}onClose(){this.isAuthenticated=!1,this.synced=!1,this.awareness&&yh(this.awareness,Array.from(this.awareness.getStates().keys()).filter(e=>e!==this.document.clientID),this)}destroy(){this.emit("destroy"),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),this.awareness&&(yh(this.awareness,[this.document.clientID],"provider destroy"),this.awareness.off("update",this.boundAwarenessUpdateHandler),this.awareness.destroy()),this.document.off("update",this.boundDocumentUpdateHandler),this.removeAllListeners(),this.detach(),this.manageSocket&&this.configuration.websocketProvider.destroy(),!(typeof window>"u"||!("removeEventListener"in window))&&window.removeEventListener("pagehide",this.boundPageHide)}detach(){this.configuration.websocketProvider.off("connect",this.configuration.onConnect),this.configuration.websocketProvider.off("connect",this.forwardConnect),this.configuration.websocketProvider.off("status",this.forwardStatus),this.configuration.websocketProvider.off("status",this.configuration.onStatus),this.configuration.websocketProvider.off("open",this.boundOnOpen),this.configuration.websocketProvider.off("close",this.boundOnClose),this.configuration.websocketProvider.off("close",this.configuration.onClose),this.configuration.websocketProvider.off("close",this.forwardClose),this.configuration.websocketProvider.off("disconnect",this.configuration.onDisconnect),this.configuration.websocketProvider.off("disconnect",this.forwardDisconnect),this.configuration.websocketProvider.off("destroy",this.configuration.onDestroy),this.configuration.websocketProvider.off("destroy",this.forwardDestroy),this.configuration.websocketProvider.detach(this),this._isAttached=!1}attach(){this._isAttached||(this.configuration.websocketProvider.on("connect",this.configuration.onConnect),this.configuration.websocketProvider.on("connect",this.forwardConnect),this.configuration.websocketProvider.on("status",this.configuration.onStatus),this.configuration.websocketProvider.on("status",this.forwardStatus),this.configuration.websocketProvider.on("open",this.boundOnOpen),this.configuration.websocketProvider.on("close",this.boundOnClose),this.configuration.websocketProvider.on("close",this.configuration.onClose),this.configuration.websocketProvider.on("close",this.forwardClose),this.configuration.websocketProvider.on("disconnect",this.configuration.onDisconnect),this.configuration.websocketProvider.on("disconnect",this.forwardDisconnect),this.configuration.websocketProvider.on("destroy",this.configuration.onDestroy),this.configuration.websocketProvider.on("destroy",this.forwardDestroy),this.configuration.websocketProvider.attach(this),this._isAttached=!0)}permissionDeniedHandler(e){this.emit("authenticationFailed",{reason:e}),this.isAuthenticated=!1}authenticatedHandler(e){this.isAuthenticated=!0,this.authorizedScope=e,this.emit("authenticated",{scope:e})}setAwarenessField(e,n){if(!this.awareness)throw new pY(`Cannot set awareness field "${e}" to ${JSON.stringify(n)}. You have disabled Awareness for this provider by explicitly passing awareness: null in the provider configuration.`);this.awareness.setLocalStateField(e,n)}}function mY(t,e,n){return t.filter(i=>!e.has(i.id)&&!n.has(i.id))}function gY(){var M;const[t,e]=N.useState([]),[n,i]=N.useState(null),[r,s]=N.useState(!1),[o,c]=N.useState("connecting"),[f,d]=N.useState(0),[p,m]=N.useState(null),[y,b]=N.useState([]),[S,v]=N.useState(null),[k,E]=N.useState(!1),[j,L]=N.useState(!1),[re,P]=N.useState(!1),[O,z]=N.useState(!1),F=N.useRef(null),se=N.useRef(!1),te=N.useRef(null),he=N.useRef(null),ce=N.useRef([]);ce.current=t;const Q=N.useRef(new Set),ie=N.useRef(new Map);for(const _ of t)Q.current.delete(_.id),ie.current.delete(_.id);const Z=N.useRef(new Map),I=N.useRef(new Map),K=N.useRef(void 0),pe=N.useCallback(_=>{const{ydoc:U}=_,T=U.getMap(oa),ne=()=>{const Xe=[];T.forEach(Ht=>{Xe.push(Ht)}),b(Xe)};T.observe(ne),ne();const me=U.getMap(NA);let ge=null,Oe=!1;const Ge=()=>{const Xe=me.get("claude"),Ht=(Xe==null?void 0:Xe.status)??null,Nt=(Xe==null?void 0:Xe.active)??!1;Ht!==ge&&(ge=Ht,v(Ht)),Nt!==Oe&&(Oe=Nt,E(Nt))};me.observe(Ge),Ge();const Fe=U.getMap(th);let ct=!1;const Ce=()=>{const Xe=Fe.get("readOnly")===!0;Xe!==ct&&(ct=Xe,L(Xe))};return Fe.observe(Ce),Ce(),()=>{T.unobserve(ne),me.unobserve(Ge),Fe.unobserve(Ce)}},[]);K.current=(_,U)=>{var Fe,ct;const T=ce.current,ne=new Set(T.map(Ce=>Ce.id)),me=new Set(_.map(Ce=>Ce.id));for(const[Ce,Xe]of ie.current)me.has(Ce)||((Fe=I.current.get(Ce))==null||Fe(),I.current.delete(Ce),Xe.provider.destroy(),Xe.ydoc.destroy(),ie.current.delete(Ce),Q.current.delete(Ce));const ge=mY(_,ne,Q.current),Oe=[];for(const Ce of ge){Q.current.add(Ce.id);const Xe=new kr,Ht=new _A({url:`ws://localhost:${Zk}`,name:Ce.id,document:Xe});ie.current.set(Ce.id,{ydoc:Xe,provider:Ht});const Nt=Xe.getMap(th),je=()=>{var qi;const Fn=Nt.get("openDocuments"),Fi=Nt.get("activeDocumentId");Fn&&((qi=K.current)==null||qi.call(K,Fn,Fi??null))};Nt.observe(je),I.current.set(Ce.id,()=>Nt.unobserve(je)),Oe.push({...Ce,ydoc:Xe,provider:Ht})}const Ge=T.filter(Ce=>!me.has(Ce.id));for(const Ce of Ge){const Xe=Z.current.get(Ce.id);Xe&&(Xe.cleanup(),Z.current.delete(Ce.id)),(ct=I.current.get(Ce.id))==null||ct(),I.current.delete(Ce.id),Q.current.delete(Ce.id),ie.current.delete(Ce.id),Ce.provider.destroy(),Ce.ydoc.destroy()}e(Ce=>[...Ce.filter(Ht=>me.has(Ht.id)),...Oe]),U!==null&&i(Ce=>Ce===null||!me.has(Ce)?U:Ge.length>0&&U===Ce?Ce:U)},N.useEffect(()=>{const _=new kr,U=new _A({url:`ws://localhost:${Zk}`,name:ZR,document:_});return te.current={ydoc:_,provider:U},U.on("status",({status:T})=>{s(T==="connected"),c(T),T==="connected"?(se.current=!0,d(0),m(null)):T==="disconnected"?m(ne=>ne??Date.now()):T==="connecting"&&(se.current&&d(ne=>ne+1),m(ne=>ne??Date.now()))}),P(!0),()=>{U.destroy(),_.destroy(),te.current=null}},[]),N.useEffect(()=>{if(!te.current)return;const _=te.current.ydoc.getMap(th),U=()=>{var ge;const T=_.get("generationId");T&&he.current&&T!==he.current&&(console.warn("[Tandem] Server restarted — refreshing documents"),z(!0),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>z(!1),5e3)),T&&(he.current=T);const ne=_.get("openDocuments"),me=_.get("activeDocumentId");ne&&((ge=K.current)==null||ge.call(K,ne,me??null))};return _.observe(U),U(),()=>{_.unobserve(U),F.current&&clearTimeout(F.current)}},[]),N.useEffect(()=>{for(const U of Z.current.values())U.cleanup();Z.current.clear();const _=ce.current.find(U=>U.id===n);if(_){const U=pe(_);Z.current.set(_.id,{cleanup:U})}else b([]),v(null),E(!1),L(!1)},[n,pe]);const fe=N.useCallback(_=>{i(U=>{if(U!==_)return U;const T=ce.current,ne=T.findIndex(ge=>ge.id===_),me=T.filter(ge=>ge.id!==_);return me.length===0?null:me[Math.min(ne,me.length-1)].id}),fetch(`http://localhost:${c1}/api/close`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({documentId:_})}).then(U=>{U.ok||console.warn("[Tandem] Server rejected close:",U.status)}).catch(U=>{console.warn("[Tandem] Failed to close document on server:",U)})},[]);return{tabs:t,activeTabId:n,setActiveTabId:i,handleTabClose:fe,connected:r,connectionStatus:o,reconnectAttempts:f,disconnectedSince:p,annotations:y,claudeStatus:S,claudeActive:k,readOnly:j,bootstrapYdoc:((M=te.current)==null?void 0:M.ydoc)??null,ready:re,serverRestarted:O}}function yY({connected:t,claudeActive:e}){const[n,i]=N.useState(!1);return N.useEffect(()=>{if(t){i(!1);return}const r=setTimeout(()=>i(!0),qR);return()=>clearTimeout(r)},[t]),A.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",color:"#9ca3af",gap:"8px"},children:n?A.jsx("span",{children:"Cannot reach the Tandem server. Is it running?"}):A.jsxs(A.Fragment,{children:[A.jsx("span",{children:"No document open. Click + in the tab bar or drop a file here."}),t&&!e&&A.jsx("span",{style:{fontSize:"0.85em",color:"#b0b8c4"},children:"Tip: open Claude Code in this directory to start collaborating"})]})})}function bY({onDismiss:t}){return A.jsxs("div",{style:{padding:"8px 16px",background:"#fef2f2",borderBottom:"1px solid #fca5a5",fontSize:"13px",color:"#991b1b",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",gap:"12px"},children:[A.jsx("span",{children:"Connection to the Tandem server has been lost. Ensure the server is running."}),A.jsx("button",{onClick:t,style:{background:"none",border:"none",cursor:"pointer",color:"#991b1b",fontSize:"16px",lineHeight:1,padding:"0 4px"},"aria-label":"Dismiss connection banner",children:"\\u00d7"})]})}function xY(){var li;const{tabs:t,activeTabId:e,setActiveTabId:n,handleTabClose:i,connected:r,connectionStatus:s,reconnectAttempts:o,disconnectedSince:c,annotations:f,claudeStatus:d,claudeActive:p,readOnly:m,bootstrapYdoc:y,ready:b,serverRestarted:S}=gY(),{orderedTabs:v,reorder:k}=tq(t),[E,j]=N.useState(()=>{const ee=localStorage.getItem(Jk);return GF.safeParse(ee).success?ee:GR});N.useEffect(()=>{localStorage.setItem(Jk,E)},[E]);const L=(li=t.find(ee=>ee.id===e))==null?void 0:li.ydoc;N.useEffect(()=>{if(!L)return;L.getMap(RA).set("interruptionMode",E)},[E,L]);const[re,P]=N.useState(!1),[O,z]=N.useState(!1);N.useEffect(()=>{if(c==null){P(!1),z(!1);return}const ee=Date.now()-c,Le=YR-ee;if(Le<=0){P(!0);return}const it=setTimeout(()=>P(!0),Le);return()=>clearTimeout(it)},[c]);const{visibleAnnotations:F,heldCount:se}=JF(f,E),te=N.useMemo(()=>t.map(ee=>({id:ee.id,fileName:ee.fileName})),[t]),{toasts:he,dismiss:ce}=WF(),{fileDragOver:Q,handleEditorDragOver:ie,handleEditorDragLeave:Z,handleEditorDrop:I}=XF(),{pendingCount:K,showReviewSummary:pe,reviewSummaryData:fe,dismissReviewSummary:M}=QF(f),[_,U]=N.useState(!1),[T,ne]=N.useState(!1),[me,ge]=N.useState(!1),[Oe,Ge]=N.useState(null),[Fe,ct]=N.useState(!1),Ce=N.useRef(null),Xe=N.useCallback(ee=>{Ce.current=ee},[]);N.useEffect(()=>{K>=KR&&!_&&ne(!0),K===0&&ne(!1)},[K,_]);const Ht=N.useCallback(()=>{U(ee=>!ee),ne(!1)},[]),Nt=N.useCallback(()=>{U(!1),ne(!1)},[]);N.useEffect(()=>{const ee=Le=>{if(Le.key!=="?")return;const it=Le.target;it.tagName==="INPUT"||it.tagName==="TEXTAREA"||it.isContentEditable||ct(qe=>!qe)};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[]);const je=t.find(ee=>ee.id===e),{tutorialActive:Fn,currentStep:Fi,dismissTutorial:qi,nextStep:Yi}=iq(f,Ce,je==null?void 0:je.fileName);return b?A.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh"},children:[S&&A.jsx("div",{style:{padding:"8px 16px",background:"#fef3c7",borderBottom:"1px solid #fbbf24",fontSize:"13px",color:"#92400e",textAlign:"center"},children:"Server restarted — refreshing documents"}),re&&!O&&A.jsx(bY,{onDismiss:()=>z(!0)}),A.jsx(tF,{editor:Ce.current,ydoc:(je==null?void 0:je.ydoc)??null}),A.jsx(dF,{tabs:v,activeTabId:e,onTabSwitch:n,onTabClose:i,reorder:k}),T&&!_&&A.jsxs("div",{style:{padding:"8px 16px",background:"#eef2ff",borderBottom:"1px solid #c7d2fe",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"13px",color:"#4338ca"},children:[A.jsxs("span",{children:[K," annotations pending review."]}),A.jsxs("div",{style:{display:"flex",gap:"8px"},children:[A.jsx("button",{onClick:Ht,style:{padding:"3px 10px",fontSize:"12px",border:"1px solid #6366f1",borderRadius:"4px",background:"#6366f1",color:"white",cursor:"pointer",fontWeight:500},children:"Review in sequence"}),A.jsx("button",{onClick:()=>ne(!1),style:{padding:"3px 10px",fontSize:"12px",border:"1px solid #d1d5db",borderRadius:"4px",background:"white",color:"#6b7280",cursor:"pointer"},children:"Dismiss"})]})]}),A.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[A.jsxs("div",{style:{flex:1,overflow:"auto",padding:"24px 48px",border:Q?"2px dashed #6366f1":"2px solid transparent",background:Q?"#eef2ff":void 0,transition:"border-color 0.15s, background 0.15s"},onDragOver:ie,onDragLeave:Z,onDrop:I,children:[A.jsx(gF,{visible:(je==null?void 0:je.readOnly)===!0&&(je==null?void 0:je.format)==="docx",documentId:je==null?void 0:je.id}),je?A.jsx(p9,{ydoc:je.ydoc,provider:je.provider,readOnly:m,reviewMode:_,activeAnnotationId:Oe,onEditorReady:Xe},je.id):A.jsx(yY,{connected:r,claudeActive:p})]}),A.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"300px",borderLeft:"1px solid #e5e7eb"},children:[A.jsxs("div",{style:{display:"flex",borderBottom:"1px solid #e5e7eb",background:"#f9fafb"},children:[A.jsx("button",{onClick:()=>ge(!1),style:{flex:1,padding:"8px",fontSize:"12px",fontWeight:me?400:600,border:"none",borderBottom:me?"none":"2px solid #6366f1",background:"transparent",cursor:"pointer",color:me?"#6b7280":"#6366f1"},children:"Annotations"}),A.jsx("button",{onClick:()=>ge(!0),style:{flex:1,padding:"8px",fontSize:"12px",fontWeight:me?600:400,border:"none",borderBottom:me?"2px solid #6366f1":"none",background:"transparent",cursor:"pointer",color:me?"#6366f1":"#6b7280"},children:"Chat"})]}),A.jsx("div",{style:{display:me?"flex":"none",flexDirection:"column",flex:1,minHeight:0},children:A.jsx(K$,{ctrlYdoc:y,editor:Ce.current,activeDocId:e,openDocs:te,claudeActive:p,claudeStatus:d,visible:me})}),A.jsx("div",{style:{display:me?"none":"flex",flexDirection:"column",flex:1,minHeight:0},children:A.jsx(v9,{annotations:F,editor:Ce.current,ydoc:(je==null?void 0:je.ydoc)??null,heldCount:se,interruptionMode:E,onModeChange:j,activeDocFormat:je==null?void 0:je.format,documentId:je==null?void 0:je.id,reviewMode:_,onToggleReviewMode:Ht,onExitReviewMode:Nt,activeAnnotationId:Oe,onActiveAnnotationChange:Ge})})]})]}),A.jsx(J$,{connected:r,connectionStatus:s,reconnectAttempts:o,disconnectedSince:c,claudeStatus:d,claudeActive:p,readOnly:m,documentCount:t.length,interruptionMode:E,onModeChange:j,heldCount:se}),pe&&fe&&A.jsx(hF,{accepted:fe.accepted,dismissed:fe.dismissed,total:fe.total,onDismiss:M}),A.jsx(mF,{open:Fe,onClose:()=>ct(!1)}),A.jsx(bF,{toasts:he,onDismiss:ce}),Fn&&A.jsx(wF,{currentStep:Fi,onNext:Yi,onDismiss:qi})]}):A.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100vh",color:"#9ca3af"},children:"Connecting..."})}const SY=PR.createRoot(document.getElementById("root"));SY.render(A.jsx(on.StrictMode,{children:A.jsx($R,{children:A.jsx(xY,{})})}));
|
|
297
|
+
`}),A.jsx("div",{"data-testid":"toast-container",style:{position:"fixed",bottom:40,right:16,zIndex:1e3,display:"flex",flexDirection:"column",gap:8,maxWidth:360,pointerEvents:"none"},children:t.map(n=>A.jsx(xF,{toast:n,onDismiss:e},n.id))})]})}function xF({toast:t,onDismiss:e}){const n=yF[t.severity],i=t.severity==="info"?"status":"alert";return A.jsxs("div",{role:i,"data-testid":`toast-${t.id}`,style:{pointerEvents:"auto",background:"white",borderRadius:6,borderLeft:`4px solid ${n}`,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08)",padding:"10px 32px 10px 12px",position:"relative",animation:"tandem-toast-slide-in 0.2s ease-out",fontSize:13,lineHeight:1.4,color:"#1f2937"},children:[A.jsx("span",{children:t.message}),t.count>1&&A.jsxs("span",{"data-testid":`toast-count-${t.id}`,style:{marginLeft:6,fontSize:11,fontWeight:600,color:n,background:`${n}18`,padding:"1px 5px",borderRadius:8},children:["×",t.count]}),A.jsx("button",{"data-testid":`toast-dismiss-${t.id}`,onClick:()=>e(t.id),style:{position:"absolute",top:6,right:6,border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#9ca3af",lineHeight:1,padding:"2px 4px"},"aria-label":"Dismiss notification",children:"×"})]})}const SF=[{title:"Review an annotation",text:"Open the side panel and accept or dismiss one of the highlighted annotations. Try Review Mode (Ctrl+Shift+R) for keyboard shortcuts."},{title:"Ask a question",text:"Select text and click Ask Claude (Ctrl+Shift+A), or type in the Chat panel."},{title:"Make an edit",text:"Click in the document and type something. All changes sync in real-time."},{title:"You're ready!",text:"You've learned the basics. Press ? anytime to see keyboard shortcuts."}],eh=3;function wF({currentStep:t,onNext:e,onDismiss:n}){const i=SF[t];if(!i)return null;const r=t>=eh;return A.jsxs("div",{"data-testid":"onboarding-tutorial",style:{position:"fixed",bottom:48,left:24,zIndex:900,maxWidth:340,background:"white",borderLeft:"4px solid #6366f1",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08)",padding:"16px 20px",fontFamily:"inherit"},children:[!r&&A.jsx("div",{style:{display:"flex",gap:6,marginBottom:12},children:Array.from({length:eh},(s,o)=>A.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:o<=t?"#6366f1":"#e5e7eb",transition:"background 0.2s"}},o))}),A.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#1f2937",marginBottom:6},children:i.title}),A.jsx("div",{style:{fontSize:13,lineHeight:1.5,color:"#4b5563",marginBottom:r?0:14},children:i.text}),!r&&A.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[A.jsxs("span",{style:{fontSize:11,color:"#9ca3af"},children:["Step ",t+1," of ",eh]}),A.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[A.jsx("button",{"data-testid":"tutorial-dismiss-btn",onClick:n,style:{background:"none",border:"none",cursor:"pointer",fontSize:12,color:"#9ca3af",padding:0,textDecoration:"underline"},children:"Dismiss tutorial"}),A.jsx("button",{"data-testid":"tutorial-next-btn",onClick:e,style:{padding:"4px 12px",fontSize:12,border:"1px solid #d1d5db",borderRadius:4,background:"white",color:"#374151",cursor:"pointer",fontWeight:500},children:t===eh-1?"Done":"Next"})]})]})]})}var lt;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{const s={};for(const o of r)s[o]=o;return s},t.getValidEnumValues=r=>{const s=t.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),o={};for(const c of s)o[c]=r[c];return t.objectValues(o)},t.objectValues=r=>t.objectKeys(r).map(function(s){return r[s]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const s=[];for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&s.push(o);return s},t.find=(r,s)=>{for(const o of r)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(lt||(lt={}));var sA;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(sA||(sA={}));const we=lt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Vs=t=>{switch(typeof t){case"undefined":return we.undefined;case"string":return we.string;case"number":return Number.isNaN(t)?we.nan:we.number;case"boolean":return we.boolean;case"function":return we.function;case"bigint":return we.bigint;case"symbol":return we.symbol;case"object":return Array.isArray(t)?we.array:t===null?we.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?we.promise:typeof Map<"u"&&t instanceof Map?we.map:typeof Set<"u"&&t instanceof Set?we.set:typeof Date<"u"&&t instanceof Date?we.date:we.object;default:return we.unknown}},ue=lt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ss extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},i={_errors:[]},r=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)i._errors.push(n(o));else{let c=i,f=0;for(;f<o.path.length;){const d=o.path[f];f===o.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(n(o))):c[d]=c[d]||{_errors:[]},c=c[d],f++}}};return r(this),i}static assert(e){if(!(e instanceof ss))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,lt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},i=[];for(const r of this.issues)if(r.path.length>0){const s=r.path[0];n[s]=n[s]||[],n[s].push(e(r))}else i.push(e(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}}ss.create=t=>new ss(t);const Wb=(t,e)=>{let n;switch(t.code){case ue.invalid_type:t.received===we.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ue.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,lt.jsonStringifyReplacer)}`;break;case ue.unrecognized_keys:n=`Unrecognized key(s) in object: ${lt.joinValues(t.keys,", ")}`;break;case ue.invalid_union:n="Invalid input";break;case ue.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${lt.joinValues(t.options)}`;break;case ue.invalid_enum_value:n=`Invalid enum value. Expected ${lt.joinValues(t.options)}, received '${t.received}'`;break;case ue.invalid_arguments:n="Invalid function arguments";break;case ue.invalid_return_type:n="Invalid function return type";break;case ue.invalid_date:n="Invalid date";break;case ue.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:lt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ue.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ue.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ue.custom:n="Invalid input";break;case ue.invalid_intersection_types:n="Intersection results could not be merged";break;case ue.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ue.not_finite:n="Number must be finite";break;default:n=e.defaultError,lt.assertNever(t)}return{message:n}};let vF=Wb;function kF(){return vF}const CF=t=>{const{data:e,path:n,errorMaps:i,issueData:r}=t,s=[...n,...r.path||[]],o={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let c="";const f=i.filter(d=>!!d).slice().reverse();for(const d of f)c=d(o,{data:e,defaultError:c}).message;return{...r,path:s,message:c}};function ye(t,e){const n=kF(),i=CF({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Wb?void 0:Wb].filter(r=>!!r)});t.common.issues.push(i)}class wi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const i=[];for(const r of n){if(r.status==="aborted")return Re;r.status==="dirty"&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,n){const i=[];for(const r of n){const s=await r.key,o=await r.value;i.push({key:s,value:o})}return wi.mergeObjectSync(e,i)}static mergeObjectSync(e,n){const i={};for(const r of n){const{key:s,value:o}=r;if(s.status==="aborted"||o.status==="aborted")return Re;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(i[s.value]=o.value)}return{status:e.value,value:i}}}const Re=Object.freeze({status:"aborted"}),Xc=t=>({status:"dirty",value:t}),$i=t=>({status:"valid",value:t}),lA=t=>t.status==="aborted",oA=t=>t.status==="dirty",Na=t=>t.status==="valid",Ep=t=>typeof Promise<"u"&&t instanceof Promise;var ke;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ke||(ke={}));class ll{constructor(e,n,i,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const aA=(t,e)=>{if(Na(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ss(t.common.issues);return this._error=n,this._error}}};function Ke(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:i,description:r}=t;if(e&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(o,c)=>{const{message:f}=t;return o.code==="invalid_enum_value"?{message:f??c.defaultError}:typeof c.data>"u"?{message:f??i??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:f??n??c.defaultError}},description:r}}class nt{get description(){return this._def.description}_getType(e){return Vs(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Vs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wi,ctx:{common:e.parent.common,data:e.data,parsedType:Vs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Ep(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const i=this.safeParse(e,n);if(i.success)return i.data;throw i.error}safeParse(e,n){const i={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vs(e)},r=this._parseSync({data:e,path:i.path,parent:i});return aA(i,r)}"~validate"(e){var i,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vs(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return Na(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(r=(i=s==null?void 0:s.message)==null?void 0:i.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(s=>Na(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(e,n){const i=await this.safeParseAsync(e,n);if(i.success)return i.data;throw i.error}async safeParseAsync(e,n){const i={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Vs(e)},r=this._parse({data:e,path:i.path,parent:i}),s=await(Ep(r)?r:Promise.resolve(r));return aA(i,s)}refine(e,n){const i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,s)=>{const o=e(r),c=()=>s.addIssue({code:ue.custom,...i(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(f=>f?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,n){return this._refinement((i,r)=>e(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(e){return new za({schema:this,typeName:ze.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return el.create(this,this._def)}nullable(){return La.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return br.create(this)}promise(){return Op.create(this,this._def)}or(e){return Ap.create([this,e],this._def)}and(e){return Mp.create(this,e,this._def)}transform(e){return new za({...Ke(this._def),schema:this,typeName:ze.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new e1({...Ke(this._def),innerType:this,defaultValue:n,typeName:ze.ZodDefault})}brand(){return new KF({typeName:ze.ZodBranded,type:this,...Ke(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new t1({...Ke(this._def),innerType:this,catchValue:n,typeName:ze.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return jx.create(this,e)}readonly(){return n1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const EF=/^c[^\s-]{8,}$/i,TF=/^[0-9a-z]+$/,AF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,MF=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,OF=/^[a-z0-9_-]{21}$/i,_F=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,DF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,NF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,RF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let I0;const zF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,LF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,IF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,BF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,n2="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",HF=new RegExp(`^${n2}$`);function i2(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function VF(t){return new RegExp(`^${i2(t)}$`)}function PF(t){let e=`${n2}T${i2(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function $F(t,e){return!!((e==="v4"||!e)&&zF.test(t)||(e==="v6"||!e)&&IF.test(t))}function FF(t,e){if(!_F.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function qF(t,e){return!!((e==="v4"||!e)&&LF.test(t)||(e==="v6"||!e)&&BF.test(t))}class Ul extends nt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==we.string){const s=this._getOrReturnCtx(e);return ye(s,{code:ue.invalid_type,expected:we.string,received:s.parsedType}),Re}const i=new wi;let r;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,c=e.data.length<s.value;(o||c)&&(r=this._getOrReturnCtx(e,r),o?ye(r,{code:ue.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&ye(r,{code:ue.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")NF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"email",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")I0||(I0=new RegExp(RF,"u")),I0.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"emoji",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")MF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"uuid",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")OF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"nanoid",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")EF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"cuid",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")TF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"cuid2",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")AF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"ulid",code:ue.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),ye(r,{validation:"url",code:ue.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"regex",code:ue.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?PF(s).test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?HF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?VF(s).test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?DF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"duration",code:ue.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?$F(e.data,s.version)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"ip",code:ue.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?FF(e.data,s.alg)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"jwt",code:ue.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?qF(e.data,s.version)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"cidr",code:ue.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?jF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"base64",code:ue.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?UF.test(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{validation:"base64url",code:ue.invalid_string,message:s.message}),i.dirty()):lt.assertNever(s);return{status:i.value,value:e.data}}_regex(e,n,i){return this.refinement(r=>e.test(r),{validation:n,code:ue.invalid_string,...ke.errToObj(i)})}_addCheck(e){return new Ul({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ke.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ke.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ke.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ke.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ke.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ke.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ke.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ke.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ke.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ke.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ke.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ke.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ke.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...ke.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ke.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ke.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ke.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ke.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ke.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ke.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ke.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ke.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ke.errToObj(n)})}nonempty(e){return this.min(1,ke.errToObj(e))}trim(){return new Ul({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ul({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ul({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ul.create=t=>new Ul({checks:[],typeName:ze.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Ke(t)});function YF(t,e){const n=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,r=n>i?n:i,s=Number.parseInt(t.toFixed(r).replace(".","")),o=Number.parseInt(e.toFixed(r).replace(".",""));return s%o/10**r}class Ku extends nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==we.number){const s=this._getOrReturnCtx(e);return ye(s,{code:ue.invalid_type,expected:we.number,received:s.parsedType}),Re}let i;const r=new wi;for(const s of this._def.checks)s.kind==="int"?lt.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?YF(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.not_finite,message:s.message}),r.dirty()):lt.assertNever(s);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ke.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ke.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ke.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ke.toString(n))}setLimit(e,n,i,r){return new Ku({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ke.toString(r)}]})}_addCheck(e){return new Ku({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ke.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ke.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ke.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ke.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ke.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ke.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ke.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ke.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ke.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&<.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Ku.create=t=>new Ku({checks:[],typeName:ze.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ke(t)});class Gu extends nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==we.bigint)return this._getInvalidInput(e);let i;const r=new wi;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ue.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):lt.assertNever(s);return{status:r.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return ye(n,{code:ue.invalid_type,expected:we.bigint,received:n.parsedType}),Re}gte(e,n){return this.setLimit("min",e,!0,ke.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ke.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ke.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ke.toString(n))}setLimit(e,n,i,r){return new Gu({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:i,message:ke.toString(r)}]})}_addCheck(e){return new Gu({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ke.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ke.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ke.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ke.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ke.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Gu.create=t=>new Gu({checks:[],typeName:ze.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Ke(t)});class cA extends nt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==we.boolean){const i=this._getOrReturnCtx(e);return ye(i,{code:ue.invalid_type,expected:we.boolean,received:i.parsedType}),Re}return $i(e.data)}}cA.create=t=>new cA({typeName:ze.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ke(t)});class Tp extends nt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==we.date){const s=this._getOrReturnCtx(e);return ye(s,{code:ue.invalid_type,expected:we.date,received:s.parsedType}),Re}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ye(s,{code:ue.invalid_date}),Re}const i=new wi;let r;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ue.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):lt.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Tp({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ke.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ke.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Tp.create=t=>new Tp({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ze.ZodDate,...Ke(t)});class uA extends nt{_parse(e){if(this._getType(e)!==we.symbol){const i=this._getOrReturnCtx(e);return ye(i,{code:ue.invalid_type,expected:we.symbol,received:i.parsedType}),Re}return $i(e.data)}}uA.create=t=>new uA({typeName:ze.ZodSymbol,...Ke(t)});class fA extends nt{_parse(e){if(this._getType(e)!==we.undefined){const i=this._getOrReturnCtx(e);return ye(i,{code:ue.invalid_type,expected:we.undefined,received:i.parsedType}),Re}return $i(e.data)}}fA.create=t=>new fA({typeName:ze.ZodUndefined,...Ke(t)});class dA extends nt{_parse(e){if(this._getType(e)!==we.null){const i=this._getOrReturnCtx(e);return ye(i,{code:ue.invalid_type,expected:we.null,received:i.parsedType}),Re}return $i(e.data)}}dA.create=t=>new dA({typeName:ze.ZodNull,...Ke(t)});class hA extends nt{constructor(){super(...arguments),this._any=!0}_parse(e){return $i(e.data)}}hA.create=t=>new hA({typeName:ze.ZodAny,...Ke(t)});class pA extends nt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return $i(e.data)}}pA.create=t=>new pA({typeName:ze.ZodUnknown,...Ke(t)});class ol extends nt{_parse(e){const n=this._getOrReturnCtx(e);return ye(n,{code:ue.invalid_type,expected:we.never,received:n.parsedType}),Re}}ol.create=t=>new ol({typeName:ze.ZodNever,...Ke(t)});class mA extends nt{_parse(e){if(this._getType(e)!==we.undefined){const i=this._getOrReturnCtx(e);return ye(i,{code:ue.invalid_type,expected:we.void,received:i.parsedType}),Re}return $i(e.data)}}mA.create=t=>new mA({typeName:ze.ZodVoid,...Ke(t)});class br extends nt{_parse(e){const{ctx:n,status:i}=this._processInputParams(e),r=this._def;if(n.parsedType!==we.array)return ye(n,{code:ue.invalid_type,expected:we.array,received:n.parsedType}),Re;if(r.exactLength!==null){const o=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(o||c)&&(ye(n,{code:o?ue.too_big:ue.too_small,minimum:c?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(ye(n,{code:ue.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(ye(n,{code:ue.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((o,c)=>r.type._parseAsync(new ll(n,o,n.path,c)))).then(o=>wi.mergeArray(i,o));const s=[...n.data].map((o,c)=>r.type._parseSync(new ll(n,o,n.path,c)));return wi.mergeArray(i,s)}get element(){return this._def.type}min(e,n){return new br({...this._def,minLength:{value:e,message:ke.toString(n)}})}max(e,n){return new br({...this._def,maxLength:{value:e,message:ke.toString(n)}})}length(e,n){return new br({...this._def,exactLength:{value:e,message:ke.toString(n)}})}nonempty(e){return this.min(1,e)}}br.create=(t,e)=>new br({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ze.ZodArray,...Ke(e)});function ia(t){if(t instanceof nn){const e={};for(const n in t.shape){const i=t.shape[n];e[n]=el.create(ia(i))}return new nn({...t._def,shape:()=>e})}else return t instanceof br?new br({...t._def,type:ia(t.element)}):t instanceof el?el.create(ia(t.unwrap())):t instanceof La?La.create(ia(t.unwrap())):t instanceof so?so.create(t.items.map(e=>ia(e))):t}class nn extends nt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=lt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==we.object){const d=this._getOrReturnCtx(e);return ye(d,{code:ue.invalid_type,expected:we.object,received:d.parsedType}),Re}const{status:i,ctx:r}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof ol&&this._def.unknownKeys==="strip"))for(const d in r.data)o.includes(d)||c.push(d);const f=[];for(const d of o){const p=s[d],m=r.data[d];f.push({key:{status:"valid",value:d},value:p._parse(new ll(r,m,r.path,d)),alwaysSet:d in r.data})}if(this._def.catchall instanceof ol){const d=this._def.unknownKeys;if(d==="passthrough")for(const p of c)f.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(d==="strict")c.length>0&&(ye(r,{code:ue.unrecognized_keys,keys:c}),i.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const p of c){const m=r.data[p];f.push({key:{status:"valid",value:p},value:d._parse(new ll(r,m,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const d=[];for(const p of f){const m=await p.key,y=await p.value;d.push({key:m,value:y,alwaysSet:p.alwaysSet})}return d}).then(d=>wi.mergeObjectSync(i,d)):wi.mergeObjectSync(i,f)}get shape(){return this._def.shape()}strict(e){return ke.errToObj,new nn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,i)=>{var s,o;const r=((o=(s=this._def).errorMap)==null?void 0:o.call(s,n,i).message)??i.defaultError;return n.code==="unrecognized_keys"?{message:ke.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new nn({...this._def,unknownKeys:"strip"})}passthrough(){return new nn({...this._def,unknownKeys:"passthrough"})}extend(e){return new nn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ze.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new nn({...this._def,catchall:e})}pick(e){const n={};for(const i of lt.objectKeys(e))e[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new nn({...this._def,shape:()=>n})}omit(e){const n={};for(const i of lt.objectKeys(this.shape))e[i]||(n[i]=this.shape[i]);return new nn({...this._def,shape:()=>n})}deepPartial(){return ia(this)}partial(e){const n={};for(const i of lt.objectKeys(this.shape)){const r=this.shape[i];e&&!e[i]?n[i]=r:n[i]=r.optional()}return new nn({...this._def,shape:()=>n})}required(e){const n={};for(const i of lt.objectKeys(this.shape))if(e&&!e[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof el;)s=s._def.innerType;n[i]=s}return new nn({...this._def,shape:()=>n})}keyof(){return r2(lt.objectKeys(this.shape))}}nn.create=(t,e)=>new nn({shape:()=>t,unknownKeys:"strip",catchall:ol.create(),typeName:ze.ZodObject,...Ke(e)});nn.strictCreate=(t,e)=>new nn({shape:()=>t,unknownKeys:"strict",catchall:ol.create(),typeName:ze.ZodObject,...Ke(e)});nn.lazycreate=(t,e)=>new nn({shape:t,unknownKeys:"strip",catchall:ol.create(),typeName:ze.ZodObject,...Ke(e)});class Ap extends nt{_parse(e){const{ctx:n}=this._processInputParams(e),i=this._def.options;function r(s){for(const c of s)if(c.result.status==="valid")return c.result;for(const c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const o=s.map(c=>new ss(c.ctx.common.issues));return ye(n,{code:ue.invalid_union,unionErrors:o}),Re}if(n.common.async)return Promise.all(i.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(r);{let s;const o=[];for(const f of i){const d={...n,common:{...n.common,issues:[]},parent:null},p=f._parseSync({data:n.data,path:n.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const c=o.map(f=>new ss(f));return ye(n,{code:ue.invalid_union,unionErrors:c}),Re}}get options(){return this._def.options}}Ap.create=(t,e)=>new Ap({options:t,typeName:ze.ZodUnion,...Ke(e)});function Qb(t,e){const n=Vs(t),i=Vs(e);if(t===e)return{valid:!0,data:t};if(n===we.object&&i===we.object){const r=lt.objectKeys(e),s=lt.objectKeys(t).filter(c=>r.indexOf(c)!==-1),o={...t,...e};for(const c of s){const f=Qb(t[c],e[c]);if(!f.valid)return{valid:!1};o[c]=f.data}return{valid:!0,data:o}}else if(n===we.array&&i===we.array){if(t.length!==e.length)return{valid:!1};const r=[];for(let s=0;s<t.length;s++){const o=t[s],c=e[s],f=Qb(o,c);if(!f.valid)return{valid:!1};r.push(f.data)}return{valid:!0,data:r}}else return n===we.date&&i===we.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Mp extends nt{_parse(e){const{status:n,ctx:i}=this._processInputParams(e),r=(s,o)=>{if(lA(s)||lA(o))return Re;const c=Qb(s.value,o.value);return c.valid?((oA(s)||oA(o))&&n.dirty(),{status:n.value,value:c.data}):(ye(i,{code:ue.invalid_intersection_types}),Re)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>r(s,o)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Mp.create=(t,e,n)=>new Mp({left:t,right:e,typeName:ze.ZodIntersection,...Ke(n)});class so extends nt{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==we.array)return ye(i,{code:ue.invalid_type,expected:we.array,received:i.parsedType}),Re;if(i.data.length<this._def.items.length)return ye(i,{code:ue.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Re;!this._def.rest&&i.data.length>this._def.items.length&&(ye(i,{code:ue.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...i.data].map((o,c)=>{const f=this._def.items[c]||this._def.rest;return f?f._parse(new ll(i,o,i.path,c)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>wi.mergeArray(n,o)):wi.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new so({...this._def,rest:e})}}so.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new so({items:t,typeName:ze.ZodTuple,rest:null,...Ke(e)})};class gA extends nt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==we.map)return ye(i,{code:ue.invalid_type,expected:we.map,received:i.parsedType}),Re;const r=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([c,f],d)=>({key:r._parse(new ll(i,c,i.path,[d,"key"])),value:s._parse(new ll(i,f,i.path,[d,"value"]))}));if(i.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const f of o){const d=await f.key,p=await f.value;if(d.status==="aborted"||p.status==="aborted")return Re;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(d.value,p.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const f of o){const d=f.key,p=f.value;if(d.status==="aborted"||p.status==="aborted")return Re;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(d.value,p.value)}return{status:n.value,value:c}}}}gA.create=(t,e,n)=>new gA({valueType:e,keyType:t,typeName:ze.ZodMap,...Ke(n)});class Zu extends nt{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.parsedType!==we.set)return ye(i,{code:ue.invalid_type,expected:we.set,received:i.parsedType}),Re;const r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(ye(i,{code:ue.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(ye(i,{code:ue.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());const s=this._def.valueType;function o(f){const d=new Set;for(const p of f){if(p.status==="aborted")return Re;p.status==="dirty"&&n.dirty(),d.add(p.value)}return{status:n.value,value:d}}const c=[...i.data.values()].map((f,d)=>s._parse(new ll(i,f,i.path,d)));return i.common.async?Promise.all(c).then(f=>o(f)):o(c)}min(e,n){return new Zu({...this._def,minSize:{value:e,message:ke.toString(n)}})}max(e,n){return new Zu({...this._def,maxSize:{value:e,message:ke.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Zu.create=(t,e)=>new Zu({valueType:t,minSize:null,maxSize:null,typeName:ze.ZodSet,...Ke(e)});class yA extends nt{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}yA.create=(t,e)=>new yA({getter:t,typeName:ze.ZodLazy,...Ke(e)});class bA extends nt{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ye(n,{received:n.data,code:ue.invalid_literal,expected:this._def.value}),Re}return{status:"valid",value:e.data}}get value(){return this._def.value}}bA.create=(t,e)=>new bA({value:t,typeName:ze.ZodLiteral,...Ke(e)});function r2(t,e){return new Ra({values:t,typeName:ze.ZodEnum,...Ke(e)})}class Ra extends nt{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),i=this._def.values;return ye(n,{expected:lt.joinValues(i),received:n.parsedType,code:ue.invalid_type}),Re}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),i=this._def.values;return ye(n,{received:n.data,code:ue.invalid_enum_value,options:i}),Re}return $i(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Ra.create(e,{...this._def,...n})}exclude(e,n=this._def){return Ra.create(this.options.filter(i=>!e.includes(i)),{...this._def,...n})}}Ra.create=r2;class xA extends nt{_parse(e){const n=lt.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==we.string&&i.parsedType!==we.number){const r=lt.objectValues(n);return ye(i,{expected:lt.joinValues(r),received:i.parsedType,code:ue.invalid_type}),Re}if(this._cache||(this._cache=new Set(lt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=lt.objectValues(n);return ye(i,{received:i.data,code:ue.invalid_enum_value,options:r}),Re}return $i(e.data)}get enum(){return this._def.values}}xA.create=(t,e)=>new xA({values:t,typeName:ze.ZodNativeEnum,...Ke(e)});class Op extends nt{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==we.promise&&n.common.async===!1)return ye(n,{code:ue.invalid_type,expected:we.promise,received:n.parsedType}),Re;const i=n.parsedType===we.promise?n.data:Promise.resolve(n.data);return $i(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Op.create=(t,e)=>new Op({type:t,typeName:ze.ZodPromise,...Ke(e)});class za extends nt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ze.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:i}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:o=>{ye(i,o),o.fatal?n.abort():n.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){const o=r.transform(i.data,s);if(i.common.async)return Promise.resolve(o).then(async c=>{if(n.value==="aborted")return Re;const f=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return f.status==="aborted"?Re:f.status==="dirty"||n.value==="dirty"?Xc(f.value):f});{if(n.value==="aborted")return Re;const c=this._def.schema._parseSync({data:o,path:i.path,parent:i});return c.status==="aborted"?Re:c.status==="dirty"||n.value==="dirty"?Xc(c.value):c}}if(r.type==="refinement"){const o=c=>{const f=r.refinement(c,s);if(i.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?Re:(c.status==="dirty"&&n.dirty(),o(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?Re:(c.status==="dirty"&&n.dirty(),o(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){const o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!Na(o))return Re;const c=r.transform(o.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>Na(o)?Promise.resolve(r.transform(o.value,s)).then(c=>({status:n.value,value:c})):Re);lt.assertNever(r)}}za.create=(t,e,n)=>new za({schema:t,typeName:ze.ZodEffects,effect:e,...Ke(n)});za.createWithPreprocess=(t,e,n)=>new za({schema:e,effect:{type:"preprocess",transform:t},typeName:ze.ZodEffects,...Ke(n)});class el extends nt{_parse(e){return this._getType(e)===we.undefined?$i(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}el.create=(t,e)=>new el({innerType:t,typeName:ze.ZodOptional,...Ke(e)});class La extends nt{_parse(e){return this._getType(e)===we.null?$i(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}La.create=(t,e)=>new La({innerType:t,typeName:ze.ZodNullable,...Ke(e)});class e1 extends nt{_parse(e){const{ctx:n}=this._processInputParams(e);let i=n.data;return n.parsedType===we.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}e1.create=(t,e)=>new e1({innerType:t,typeName:ze.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ke(e)});class t1 extends nt{_parse(e){const{ctx:n}=this._processInputParams(e),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ep(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ss(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ss(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}t1.create=(t,e)=>new t1({innerType:t,typeName:ze.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ke(e)});class SA extends nt{_parse(e){if(this._getType(e)!==we.nan){const i=this._getOrReturnCtx(e);return ye(i,{code:ue.invalid_type,expected:we.nan,received:i.parsedType}),Re}return{status:"valid",value:e.data}}}SA.create=t=>new SA({typeName:ze.ZodNaN,...Ke(t)});class KF extends nt{_parse(e){const{ctx:n}=this._processInputParams(e),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}}class jx extends nt{_parse(e){const{status:n,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Re:s.status==="dirty"?(n.dirty(),Xc(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{const r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?Re:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(e,n){return new jx({in:e,out:n,typeName:ze.ZodPipeline})}}class n1 extends nt{_parse(e){const n=this._def.innerType._parse(e),i=r=>(Na(r)&&(r.value=Object.freeze(r.value)),r);return Ep(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}}n1.create=(t,e)=>new n1({innerType:t,typeName:ze.ZodReadonly,...Ke(e)});var ze;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ze||(ze={}));ol.create;br.create;Ap.create;Mp.create;so.create;const sr=Ra.create;Op.create;el.create;La.create;sr(["highlight","comment","suggestion","overlay","question","flag"]);sr(["pending","accepted","dismissed"]);sr(["normal","urgent"]);const GF=sr(["all","urgent-only","paused"]);sr(["yellow","red","green","blue","purple"]);sr(["info","warning","error","success"]);sr(["user","claude","import"]);sr(["accept","dismiss"]);sr(["markdown","json"]);sr(["md","txt","html","docx"]);sr(["RANGE_GONE","RANGE_MOVED","FILE_LOCKED","FILE_NOT_FOUND","NO_DOCUMENT","INVALID_RANGE","FORMAT_ERROR","PERMISSION_DENIED"]);function ZF(t,e){return t.status!=="pending"||e==="all"?!0:e==="urgent-only"?t.priority==="urgent"||t.type==="flag"||t.type==="question":!1}function JF(t,e){return N.useMemo(()=>{const n=[];let i=0;for(const r of t)ZF(r,e)?n.push(r):r.status==="pending"&&i++;return{visibleAnnotations:n,heldCount:i}},[t,e])}function XF(){const[t,e]=N.useState(!1),n=N.useCallback(s=>{s.dataTransfer.types.includes("Files")&&(s.preventDefault(),e(!0))},[]),i=N.useCallback(s=>{(s.currentTarget===s.target||!s.currentTarget.contains(s.relatedTarget))&&e(!1)},[]),r=N.useCallback(async s=>{if(e(!1),!s.dataTransfer.files.length)return;s.preventDefault();const o=s.dataTransfer.files[0],c=await yD(o);try{const f=await fetch(`${qu}/upload`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileName:o.name,content:c})});if(!f.ok){const d=await f.json().catch(()=>({message:"Upload failed"}));console.error("[useFileDrop] Upload failed:",f.status,d.message??d.error)}}catch{console.error("[useFileDrop] Server unreachable — file drop ignored")}},[]);return{fileDragOver:t,handleEditorDragOver:n,handleEditorDragLeave:i,handleEditorDrop:r}}function WF(){const[t,e]=N.useState([]),n=N.useRef(new Map),i=N.useCallback((o,c)=>{const f=n.current.get(o);f&&clearTimeout(f);const d=Qk[c]??Qk.info,p=setTimeout(()=>{e(m=>m.filter(y=>y.id!==o)),n.current.delete(o)},d);n.current.set(o,p)},[]),r=N.useCallback(o=>{const c=n.current.get(o);c&&(clearTimeout(c),n.current.delete(o))},[]),s=N.useCallback(o=>{e(c=>c.filter(f=>f.id!==o)),r(o)},[r]);return N.useEffect(()=>{const o=`http://localhost:${c1}/api/notify-stream`,c=new EventSource(o);return c.onmessage=f=>{let d;try{d=JSON.parse(f.data)}catch{console.warn("[useNotifications] Malformed SSE data:",f.data);return}e(p=>{if(d.dedupKey){const b=p.findIndex(S=>S.dedupKey===d.dedupKey);if(b!==-1){const S=p[b];r(S.id);const v={...d,count:S.count+1},k=[...p];return k[b]=v,i(v.id,v.severity),k}}const m={...d,count:1},y=[...p,m];for(;y.length>XR;){const b=y.shift();r(b.id)}return i(m.id,m.severity),y})},c.onerror=()=>{c.readyState===EventSource.CLOSED&&console.warn("[useNotifications] EventSource permanently closed. Notifications will not be delivered. Is the server running?")},()=>{c.close();for(const f of n.current.values())clearTimeout(f);n.current.clear()}},[i,r]),{toasts:t,dismiss:s}}function QF(t){const[e,n]=N.useState(!1),[i,r]=N.useState(null),s=N.useRef(0),{pendingCount:o,acceptedCount:c,dismissedCount:f}=N.useMemo(()=>{let p=0,m=0,y=0;for(const b of t)b.status==="pending"?p++:b.status==="accepted"?m++:b.status==="dismissed"&&y++;return{pendingCount:p,acceptedCount:m,dismissedCount:y}},[t]);N.useEffect(()=>{const p=c+f;s.current>0&&o===0&&p>0&&(r({accepted:c,dismissed:f,total:p}),n(!0)),s.current=o},[o,c,f]);const d=N.useCallback(()=>{n(!1)},[]);return{pendingCount:o,showReviewSummary:e,reviewSummaryData:i,dismissReviewSummary:d}}function wA(t,e){const n=new Set(e),i=t.filter(o=>n.has(o)),r=new Set(i),s=e.filter(o=>!r.has(o));return[...i,...s]}function eq(t,e,n,i,r="left"){const s=t.filter(m=>i.has(m)),o=s.indexOf(e),c=s.indexOf(n);if(o===-1||c===-1)return s;const f=[...s];f.splice(o,1);const d=f.indexOf(n),p=r==="right"?d+1:d;return f.splice(p,0,e),f}function tq(t){const[e,n]=N.useState([]),i=N.useMemo(()=>{const o=new Map(t.map(d=>[d.id,d])),c=t.map(d=>d.id);return wA(e,c).map(d=>o.get(d)).filter(Boolean)},[t,e]),r=N.useMemo(()=>t.map(o=>o.id),[t]);N.useEffect(()=>{n(o=>{const c=wA(o,r);return o.length===c.length&&o.every((f,d)=>f===c[d])?o:c})},[r]);const s=N.useCallback(function(c,f,d="left"){if(c===f)return;const p=new Set(r);n(m=>eq(m,c,f,p,d))},[r]);return{orderedTabs:i,reorder:s}}function nq(){try{return localStorage.getItem(zA)==="true"}catch{return!1}}function vA(){try{localStorage.setItem(zA,"true")}catch{}}function iq(t,e,n){const[i,r]=N.useState(nq),[s,o]=N.useState(0),c=N.useRef(0),d=!i&&n==="welcome.md";N.useEffect(()=>{if(!d||s!==0)return;const b=t.filter(v=>v.id.startsWith(WR));if(b.length===0)return;b.some(v=>v.status!=="pending")&&(c.current=Date.now(),o(1))},[d,s,t]),N.useEffect(()=>{if(!d||s!==1)return;t.some(S=>S.author==="user")&&(c.current=Date.now(),o(2))},[d,s,t]);const p=e.current;N.useEffect(()=>{if(!d||s!==2||!p)return;const b=()=>{Date.now()-c.current<2e3||p.isFocused&&(c.current=Date.now(),o(3))};return p.on("update",b),()=>{p.off("update",b)}},[d,s,p]),N.useEffect(()=>{if(!d||s!==3)return;const b=setTimeout(()=>{vA(),r(!0)},3e3);return()=>clearTimeout(b)},[d,s]);const m=N.useCallback(()=>{vA(),r(!0)},[]),y=N.useCallback(()=>{c.current=Date.now(),o(b=>Math.min(b+1,3))},[]);return{tutorialActive:d,currentStep:s,dismissTutorial:m,nextStep:y}}const rq=Math.floor,sq=(t,e)=>t<e?t:e,lq=(t,e)=>t>e?t:e,s2=128,gh=127,oq=Number.MAX_SAFE_INTEGER,aq=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,i=new Uint8Array(n);for(let r=0;r<n;r++)i[r]=e.codePointAt(r);return i},Ju=typeof TextEncoder<"u"?new TextEncoder:null,cq=t=>Ju.encode(t),uq=Ju?cq:aq;let pu=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});pu&&pu.decode(new Uint8Array).length===1&&(pu=null);const _p=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},hm=(t,e)=>{for(;e>gh;)_p(t,s2|gh&e),e=rq(e/128);_p(t,gh&e)},i1=new Uint8Array(3e4),fq=i1.length/3,dq=(t,e)=>{if(e.length<fq){const n=Ju.encodeInto(e,i1).written||0;hm(t,n);for(let i=0;i<n;i++)_p(t,i1[i])}else gq(t,uq(e))},hq=(t,e)=>{const n=unescape(encodeURIComponent(e)),i=n.length;hm(t,i);for(let r=0;r<i;r++)_p(t,n.codePointAt(r))},pq=Ju&&Ju.encodeInto?dq:hq,mq=(t,e)=>{const n=t.cbuf.length,i=t.cpos,r=sq(n-i,e.length),s=e.length-r;t.cbuf.set(e.subarray(0,r),i),t.cpos+=r,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(lq(n*2,s)),t.cbuf.set(e.subarray(r)),t.cpos=s)},gq=(t,e)=>{hm(t,e.byteLength),mq(t,e)},l2=t=>new Error(t),yq=l2("Unexpected end of array"),bq=l2("Integer out of Range"),xq=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},Sq=t=>xq(t,Ux(t)),kA=t=>t.arr[t.pos++],Ux=t=>{let e=0,n=1;const i=t.arr.length;for(;t.pos<i;){const r=t.arr[t.pos++];if(e=e+(r&gh)*n,n*=128,r<s2)return e;if(e>oq)throw bq}throw yq},wq=t=>{let e=Ux(t);if(e===0)return"";{let n=String.fromCodePoint(kA(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(kA(t));else for(;e>0;){const i=e<1e4?e:1e4,r=t.arr.subarray(t.pos,t.pos+i);t.pos+=i,n+=String.fromCodePoint.apply(null,r),e-=i}return decodeURIComponent(escape(n))}},vq=t=>pu.decode(Sq(t)),CA=pu?vq:wq;var xa;(function(t){t[t.Token=0]="Token",t[t.PermissionDenied=1]="PermissionDenied",t[t.Authenticated=2]="Authenticated"})(xa||(xa={}));const kq=(t,e)=>{hm(t,xa.Token),pq(t,e)},Cq=(t,e,n,i)=>{switch(Ux(t)){case xa.Token:{e();break}case xa.PermissionDenied:{n(CA(t));break}case xa.Authenticated:{i(CA(t));break}}},EA=t=>Array.from(t.entries()).map(([e,n])=>({clientId:e,...n}));var r1;(function(t){t[t.Connecting=0]="Connecting",t[t.Open=1]="Open",t[t.Closing=2]="Closing",t[t.Closed=3]="Closed"})(r1||(r1={}));function Eq(t){return t||(t={}),{delay:t.delay===void 0?200:t.delay,initialDelay:t.initialDelay===void 0?0:t.initialDelay,minDelay:t.minDelay===void 0?0:t.minDelay,maxDelay:t.maxDelay===void 0?0:t.maxDelay,factor:t.factor===void 0?0:t.factor,maxAttempts:t.maxAttempts===void 0?3:t.maxAttempts,timeout:t.timeout===void 0?0:t.timeout,jitter:t.jitter===!0,initialJitter:t.initialJitter===!0,handleError:t.handleError===void 0?null:t.handleError,handleTimeout:t.handleTimeout===void 0?null:t.handleTimeout,beforeAttempt:t.beforeAttempt===void 0?null:t.beforeAttempt,calculateDelay:t.calculateDelay===void 0?null:t.calculateDelay}}async function B0(t){return new Promise(e=>setTimeout(e,t))}function Tq(t,e){let n=e.delay;if(n===0)return 0;if(e.factor&&(n*=Math.pow(e.factor,t.attemptNum-1),e.maxDelay!==0&&(n=Math.min(n,e.maxDelay))),e.jitter){const i=Math.ceil(e.minDelay),r=Math.floor(n);n=Math.floor(Math.random()*(r-i+1))+i}return Math.round(n)}async function Aq(t,e){const n=Eq(e);for(const c of["delay","initialDelay","minDelay","maxDelay","maxAttempts","timeout"]){const f=n[c];if(!Number.isInteger(f)||f<0)throw new Error(`Value for ${c} must be an integer greater than or equal to 0`)}if(n.factor.constructor!==Number||n.factor<0)throw new Error("Value for factor must be a number greater than or equal to 0");if(n.delay<n.minDelay)throw new Error(`delay cannot be less than minDelay (delay: ${n.delay}, minDelay: ${n.minDelay}`);const i={attemptNum:0,attemptsRemaining:n.maxAttempts?n.maxAttempts:-1,aborted:!1,abort(){i.aborted=!0}},r=n.calculateDelay||Tq;async function s(){if(n.beforeAttempt&&n.beforeAttempt(i,n),i.aborted){const f=new Error("Attempt aborted");throw f.code="ATTEMPT_ABORTED",f}const c=async f=>{if(n.handleError&&await n.handleError(f,i,n),i.aborted||i.attemptsRemaining===0)throw f;i.attemptNum++;const d=r(i,n);return d&&await B0(d),s()};return i.attemptsRemaining>0&&i.attemptsRemaining--,n.timeout?new Promise((f,d)=>{const p=setTimeout(()=>{if(n.handleTimeout)try{f(n.handleTimeout(i,n))}catch(m){d(m)}else{const m=new Error(`Retry timeout (attemptNum: ${i.attemptNum}, timeout: ${n.timeout})`);m.code="ATTEMPT_TIMEOUT",d(m)}},n.timeout);t(i,n).then(m=>{clearTimeout(p),f(m)}).catch(m=>{clearTimeout(p),c(m).then(f).catch(d)})}):t(i,n).catch(c)}const o=n.calculateDelay?n.calculateDelay(i,n):n.initialDelay;if(o&&await B0(o),i.attemptNum<1&&n.initialJitter){const c=r(i,n);c&&await B0(c)}return s()}const o2=Math.floor,Mq=(t,e)=>t<e?t:e,Oq=(t,e)=>t>e?t:e,_q=64,Dp=128,Dq=63,mu=127,a2=Number.MAX_SAFE_INTEGER,Nq=()=>new Set,Rq=Array.from,zq=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,i=new Uint8Array(n);for(let r=0;r<n;r++)i[r]=e.codePointAt(r);return i},Xu=typeof TextEncoder<"u"?new TextEncoder:null,Lq=t=>Xu.encode(t),Iq=Xu?Lq:zq;let gu=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});gu&&gu.decode(new Uint8Array).length===1&&(gu=null);class Bq{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Hx=()=>new Bq,c2=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},Vx=t=>{const e=new Uint8Array(c2(t));let n=0;for(let i=0;i<t.bufs.length;i++){const r=t.bufs[i];e.set(r,n),n+=r.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},Np=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},On=(t,e)=>{for(;e>mu;)Np(t,Dp|mu&e),e=o2(e/128);Np(t,mu&e)},s1=new Uint8Array(3e4),jq=s1.length/3,Uq=(t,e)=>{if(e.length<jq){const n=Xu.encodeInto(e,s1).written||0;On(t,n);for(let i=0;i<n;i++)Np(t,s1[i])}else Ka(t,Iq(e))},Hq=(t,e)=>{const n=unescape(encodeURIComponent(e)),i=n.length;On(t,i);for(let r=0;r<i;r++)Np(t,n.codePointAt(r))},ls=Xu&&Xu.encodeInto?Uq:Hq,Vq=(t,e)=>{const n=t.cbuf.length,i=t.cpos,r=Mq(n-i,e.length),s=e.length-r;t.cbuf.set(e.subarray(0,r),i),t.cpos+=r,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Oq(n*2,s)),t.cbuf.set(e.subarray(r)),t.cpos=s)},Ka=(t,e)=>{On(t,e.byteLength),Vq(t,e)},u2=t=>new Error(t),f2=u2("Unexpected end of array"),d2=u2("Integer out of Range");class Pq{constructor(e){this.arr=e,this.pos=0}}const h2=t=>new Pq(t),$q=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},pm=t=>$q(t,Kl(t)),TA=t=>t.arr[t.pos++],Kl=t=>{let e=0,n=1;const i=t.arr.length;for(;t.pos<i;){const r=t.arr[t.pos++];if(e=e+(r&mu)*n,n*=128,r<Dp)return e;if(e>a2)throw d2}throw f2},Fq=t=>{let e=t.arr[t.pos++],n=e&Dq,i=64;const r=(e&_q)>0?-1:1;if((e&Dp)===0)return r*n;const s=t.arr.length;for(;t.pos<s;){if(e=t.arr[t.pos++],n=n+(e&mu)*i,i*=128,e<Dp)return r*n;if(n>a2)throw d2}throw f2},qq=t=>{let e=Kl(t);if(e===0)return"";{let n=String.fromCodePoint(TA(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(TA(t));else for(;e>0;){const i=e<1e4?e:1e4,r=t.arr.subarray(t.pos,t.pos+i);t.pos+=i,n+=String.fromCodePoint.apply(null,r),e-=i}return decodeURIComponent(escape(n))}},Yq=t=>gu.decode(pm(t)),Wu=gu?Yq:qq,Kq=t=>{const e=t.pos,n=Wu(t);return t.pos=e,n},Ia=Date.now,j0=()=>new Map,Gq=(t,e,n)=>{let i=t.get(e);return i===void 0&&t.set(e,i=n()),i};class Zq{constructor(){this._observers=j0()}on(e,n){Gq(this._observers,e,Nq).add(n)}once(e,n){const i=(...r)=>{this.off(e,i),n(...r)};this.on(e,i)}off(e,n){const i=this._observers.get(e);i!==void 0&&(i.delete(n),i.size===0&&this._observers.delete(e))}emit(e,n){return Rq((this._observers.get(e)||j0()).values()).forEach(i=>i(...n))}destroy(){this._observers=j0()}}const Jq=Object.keys,AA=t=>Jq(t).length,Xq=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),Wq=(t,e)=>t===e,yu=(t,e)=>{if(t==null||e==null)return Wq(t,e);if(t.constructor!==e.constructor)return!1;if(t===e)return!0;switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;break}case Set:{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;break}case Map:{if(t.size!==e.size)return!1;for(const n of t.keys())if(!e.has(n)||!yu(t.get(n),e.get(n)))return!1;break}case Object:if(AA(t)!==AA(e))return!1;for(const n in t)if(!Xq(t,n)||!yu(t[n],e[n]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!yu(t[n],e[n]))return!1;break;default:return!1}return!0},U0=3e4;class Qq extends Zq{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const n=Ia();this.getLocalState()!==null&&U0/2<=n-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const i=[];this.meta.forEach((r,s)=>{s!==this.clientID&&U0<=n-r.lastUpdated&&this.states.has(s)&&i.push(s)}),i.length>0&&yh(this,i,"timeout")},o2(U0/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const n=this.clientID,i=this.meta.get(n),r=i===void 0?0:i.clock+1,s=this.states.get(n);e===null?this.states.delete(n):this.states.set(n,e),this.meta.set(n,{clock:r,lastUpdated:Ia()});const o=[],c=[],f=[],d=[];e===null?d.push(n):s==null?e!=null&&o.push(n):(c.push(n),yu(s,e)||f.push(n)),(o.length>0||f.length>0||d.length>0)&&this.emit("change",[{added:o,updated:f,removed:d},"local"]),this.emit("update",[{added:o,updated:c,removed:d},"local"])}setLocalStateField(e,n){const i=this.getLocalState();i!==null&&this.setLocalState({...i,[e]:n})}getStates(){return this.states}}const yh=(t,e,n)=>{const i=[];for(let r=0;r<e.length;r++){const s=e[r];if(t.states.has(s)){if(t.states.delete(s),s===t.clientID){const o=t.meta.get(s);t.meta.set(s,{clock:o.clock+1,lastUpdated:Ia()})}i.push(s)}}i.length>0&&(t.emit("change",[{added:[],updated:[],removed:i},n]),t.emit("update",[{added:[],updated:[],removed:i},n]))},l1=(t,e,n=t.states)=>{const i=e.length,r=Hx();On(r,i);for(let s=0;s<i;s++){const o=e[s],c=n.get(o)||null,f=t.meta.get(o).clock;On(r,o),On(r,f),ls(r,JSON.stringify(c))}return Vx(r)},eY=(t,e,n)=>{const i=h2(e),r=Ia(),s=[],o=[],c=[],f=[],d=Kl(i);for(let p=0;p<d;p++){const m=Kl(i);let y=Kl(i);const b=JSON.parse(Wu(i)),S=t.meta.get(m),v=t.states.get(m),k=S===void 0?0:S.clock;(k<y||k===y&&b===null&&t.states.has(m))&&(b===null?m===t.clientID&&t.getLocalState()!=null?y++:t.states.delete(m):t.states.set(m,b),t.meta.set(m,{clock:y,lastUpdated:r}),S===void 0&&b!==null?s.push(m):S!==void 0&&b===null?f.push(m):b!==null&&(yu(b,v)||c.push(m),o.push(m)))}(s.length>0||c.length>0||f.length>0)&&t.emit("change",[{added:s,updated:c,removed:f},n]),(s.length>0||o.length>0||f.length>0)&&t.emit("update",[{added:s,updated:o,removed:f},n])};class p2{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const i=this.callbacks[e];return i&&i.forEach(r=>r.apply(this,n)),this}off(e,n){const i=this.callbacks[e];return i&&(n?this.callbacks[e]=i.filter(r=>r!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}class o1{constructor(e){this.data=e,this.encoder=Hx(),this.decoder=h2(new Uint8Array(this.data))}peekVarString(){return Kq(this.decoder)}readVarUint(){return Kl(this.decoder)}readVarString(){return Wu(this.decoder)}readVarUint8Array(){return pm(this.decoder)}writeVarUint(e){return On(this.encoder,e)}writeVarString(e){return ls(this.encoder,e)}writeVarUint8Array(e){return Ka(this.encoder,e)}length(){return c2(this.encoder)}}var wn;(function(t){t[t.Sync=0]="Sync",t[t.Awareness=1]="Awareness",t[t.Auth=2]="Auth",t[t.QueryAwareness=3]="QueryAwareness",t[t.Stateless=5]="Stateless",t[t.CLOSE=7]="CLOSE",t[t.SyncStatus=8]="SyncStatus"})(wn||(wn={}));var Bn;(function(t){t.Connecting="connecting",t.Connected="connected",t.Disconnected="disconnected"})(Bn||(Bn={}));class co{constructor(){this.encoder=Hx()}get(e){return e.encoder}toUint8Array(){return Vx(this.encoder)}}class tY extends co{constructor(){super(...arguments),this.type=wn.CLOSE,this.description="Ask the server to close the connection"}get(e){return ls(this.encoder,e.documentName),On(this.encoder,this.type),this.encoder}}class nY extends p2{constructor(e){super(),this.messageQueue=[],this.configuration={url:"",autoConnect:!0,preserveTrailingSlash:!1,document:void 0,WebSocketPolyfill:void 0,messageReconnectTimeout:3e4,delay:1e3,initialDelay:0,factor:2,maxAttempts:0,minDelay:1e3,maxDelay:3e4,jitter:!0,timeout:0,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,handleTimeout:null,providerMap:new Map},this.webSocket=null,this.webSocketHandlers={},this.shouldConnect=!0,this.status=Bn.Disconnected,this.lastMessageReceived=0,this.identifier=0,this.intervals={connectionChecker:null},this.connectionAttempt=null,this.receivedOnOpenPayload=void 0,this.closeTries=0,this.setConfiguration(e),this.configuration.WebSocketPolyfill=e.WebSocketPolyfill?e.WebSocketPolyfill:WebSocket,this.on("open",this.configuration.onOpen),this.on("open",this.onOpen.bind(this)),this.on("connect",this.configuration.onConnect),this.on("message",this.configuration.onMessage),this.on("outgoingMessage",this.configuration.onOutgoingMessage),this.on("status",this.configuration.onStatus),this.on("disconnect",this.configuration.onDisconnect),this.on("close",this.configuration.onClose),this.on("destroy",this.configuration.onDestroy),this.on("awarenessUpdate",this.configuration.onAwarenessUpdate),this.on("awarenessChange",this.configuration.onAwarenessChange),this.on("close",this.onClose.bind(this)),this.on("message",this.onMessage.bind(this)),this.intervals.connectionChecker=setInterval(this.checkConnection.bind(this),this.configuration.messageReconnectTimeout/10),this.shouldConnect&&this.connect()}async onOpen(e){this.status=Bn.Connected,this.emit("status",{status:Bn.Connected}),this.cancelWebsocketRetry=void 0,this.receivedOnOpenPayload=e}attach(e){this.configuration.providerMap.set(e.configuration.name,e),this.status===Bn.Disconnected&&this.shouldConnect&&this.connect(),this.receivedOnOpenPayload&&this.status===Bn.Connected&&e.onOpen(this.receivedOnOpenPayload)}detach(e){this.configuration.providerMap.has(e.configuration.name)&&(e.send(tY,{documentName:e.configuration.name}),this.configuration.providerMap.delete(e.configuration.name))}setConfiguration(e={}){this.configuration={...this.configuration,...e},this.configuration.autoConnect||(this.shouldConnect=!1)}async connect(){if(this.status===Bn.Connected)return;this.cancelWebsocketRetry&&(this.cancelWebsocketRetry(),this.cancelWebsocketRetry=void 0),this.receivedOnOpenPayload=void 0,this.shouldConnect=!0;const e=()=>{let r=!1;return{retryPromise:Aq(this.createWebSocketConnection.bind(this),{delay:this.configuration.delay,initialDelay:this.configuration.initialDelay,factor:this.configuration.factor,maxAttempts:this.configuration.maxAttempts,minDelay:this.configuration.minDelay,maxDelay:this.configuration.maxDelay,jitter:this.configuration.jitter,timeout:this.configuration.timeout,handleTimeout:this.configuration.handleTimeout,beforeAttempt:o=>{(!this.shouldConnect||r)&&o.abort()}}).catch(o=>{if(o&&o.code!=="ATTEMPT_ABORTED")throw o}),cancelFunc:()=>{r=!0}}},{retryPromise:n,cancelFunc:i}=e();return this.cancelWebsocketRetry=i,n}attachWebSocketListeners(e,n){const{identifier:i}=e,r=d=>this.emit("message",d),s=d=>this.emit("close",{event:d}),o=d=>this.emit("open",d),c=d=>{n(d)};this.webSocketHandlers[i]={message:r,close:s,open:o,error:c};const f=this.webSocketHandlers[e.identifier];Object.keys(f).forEach(d=>{e.addEventListener(d,f[d])})}cleanupWebSocket(){if(!this.webSocket)return;const{identifier:e}=this.webSocket,n=this.webSocketHandlers[e];Object.keys(n).forEach(i=>{var r;(r=this.webSocket)===null||r===void 0||r.removeEventListener(i,n[i]),delete this.webSocketHandlers[e]}),this.webSocket.close(),this.webSocket=null}createWebSocketConnection(){return new Promise((e,n)=>{this.webSocket&&(this.messageQueue=[],this.cleanupWebSocket()),this.lastMessageReceived=0,this.identifier+=1;const i=new this.configuration.WebSocketPolyfill(this.url);i.binaryType="arraybuffer",i.identifier=this.identifier,this.attachWebSocketListeners(i,n),this.webSocket=i,this.status=Bn.Connecting,this.emit("status",{status:Bn.Connecting}),this.connectionAttempt={resolve:e,reject:n}})}onMessage(e){var n;this.resolveConnectionAttempt(),this.lastMessageReceived=Ia();const r=new o1(e.data).peekVarString();(n=this.configuration.providerMap.get(r))===null||n===void 0||n.onMessage(e)}resolveConnectionAttempt(){this.connectionAttempt&&(this.connectionAttempt.resolve(),this.connectionAttempt=null,this.status=Bn.Connected,this.emit("status",{status:Bn.Connected}),this.emit("connect"),this.messageQueue.forEach(e=>this.send(e)),this.messageQueue=[])}stopConnectionAttempt(){this.connectionAttempt=null}rejectConnectionAttempt(){var e;(e=this.connectionAttempt)===null||e===void 0||e.reject(),this.connectionAttempt=null}checkConnection(){var e;this.status===Bn.Connected&&this.lastMessageReceived&&(this.configuration.messageReconnectTimeout>=Ia()-this.lastMessageReceived||(this.closeTries+=1,this.closeTries>2?(this.onClose({event:{code:4408,reason:"forced"}}),this.closeTries=0):((e=this.webSocket)===null||e===void 0||e.close(),this.messageQueue=[])))}get serverUrl(){if(this.configuration.preserveTrailingSlash)return this.configuration.url;let e=this.configuration.url;for(;e[e.length-1]==="/";)e=e.slice(0,e.length-1);return e}get url(){return this.serverUrl}disconnect(){if(this.shouldConnect=!1,this.webSocket!==null)try{this.webSocket.close(),this.messageQueue=[]}catch(e){console.error(e)}}send(e){var n;((n=this.webSocket)===null||n===void 0?void 0:n.readyState)===r1.Open?this.webSocket.send(e):this.messageQueue.push(e)}onClose({event:e}){this.closeTries=0,this.cleanupWebSocket(),this.connectionAttempt&&this.rejectConnectionAttempt(),this.status=Bn.Disconnected,this.emit("status",{status:Bn.Disconnected}),this.emit("disconnect",{event:e}),!this.cancelWebsocketRetry&&this.shouldConnect&&setTimeout(()=>{this.connect()},this.configuration.delay)}destroy(){this.emit("destroy"),clearInterval(this.intervals.connectionChecker),this.stopConnectionAttempt(),this.disconnect(),this.removeAllListeners(),this.cleanupWebSocket()}}const m2=0,Px=1,g2=2,iY=(t,e)=>{On(t,m2);const n=I5(e);Ka(t,n)},rY=(t,e,n)=>{On(t,Px),Ka(t,N5(e,n))},sY=(t,e,n)=>rY(e,n,pm(t)),y2=(t,e,n)=>{try{O5(e,pm(t),n)}catch(i){console.error("Caught error while handling a Yjs update",i)}},lY=(t,e)=>{On(t,g2),Ka(t,e)},oY=y2,aY=(t,e,n,i)=>{const r=Kl(t);switch(r){case m2:sY(t,e,n);break;case Px:y2(t,n,i);break;case g2:oY(t,n,i);break;default:throw new Error("Unknown message type")}return r};class cY{constructor(e){this.message=e}apply(e,n){const{message:i}=this,r=i.readVarUint(),s=i.length();switch(r){case wn.Sync:this.applySyncMessage(e,n);break;case wn.Awareness:this.applyAwarenessMessage(e);break;case wn.Auth:this.applyAuthMessage(e);break;case wn.QueryAwareness:this.applyQueryAwarenessMessage(e);break;case wn.Stateless:e.receiveStateless(Wu(i.decoder));break;case wn.SyncStatus:this.applySyncStatusMessage(e,Fq(i.decoder)===1);break;case wn.CLOSE:const o={code:1e3,reason:Wu(i.decoder),target:e.configuration.websocketProvider.webSocket,type:"close"};e.onClose(),e.configuration.onClose({event:o}),e.forwardClose({event:o});break;default:throw new Error(`Can’t apply message of unknown type: ${r}`)}i.length()>s+1&&e.send(co,{encoder:i.encoder})}applySyncMessage(e,n){const{message:i}=this;i.writeVarUint(wn.Sync);const r=aY(i.decoder,i.encoder,e.document,e);n&&r===Px&&(e.synced=!0)}applySyncStatusMessage(e,n){n&&e.decrementUnsyncedChanges()}applyAwarenessMessage(e){if(!e.awareness)return;const{message:n}=this;eY(e.awareness,n.readVarUint8Array(),e)}applyAuthMessage(e){const{message:n}=this;Cq(n.decoder,e.sendToken.bind(e),e.permissionDeniedHandler.bind(e),e.authenticatedHandler.bind(e))}applyQueryAwarenessMessage(e){if(!e.awareness)return;const{message:n}=this;n.writeVarUint(wn.Awareness),n.writeVarUint8Array(l1(e.awareness,Array.from(e.awareness.getStates().keys())))}}class uY{constructor(e,n={}){this.message=new e,this.encoder=this.message.get(n)}create(){return Vx(this.encoder)}send(e){e==null||e.send(this.create())}}class fY extends co{constructor(){super(...arguments),this.type=wn.Auth,this.description="Authentication"}get(e){if(typeof e.token>"u")throw new Error("The authentication message requires `token` as an argument.");return ls(this.encoder,e.documentName),On(this.encoder,this.type),kq(this.encoder,e.token),this.encoder}}class MA extends co{constructor(){super(...arguments),this.type=wn.Awareness,this.description="Awareness states update"}get(e){if(typeof e.awareness>"u")throw new Error("The awareness message requires awareness as an argument");if(typeof e.clients>"u")throw new Error("The awareness message requires clients as an argument");ls(this.encoder,e.documentName),On(this.encoder,this.type);let n;return e.states===void 0?n=l1(e.awareness,e.clients):n=l1(e.awareness,e.clients,e.states),Ka(this.encoder,n),this.encoder}}class dY extends co{constructor(){super(...arguments),this.type=wn.Stateless,this.description="A stateless message"}get(e){var n;return ls(this.encoder,e.documentName),On(this.encoder,this.type),ls(this.encoder,(n=e.payload)!==null&&n!==void 0?n:""),this.encoder}}class OA extends co{constructor(){super(...arguments),this.type=wn.Sync,this.description="First sync step"}get(e){if(typeof e.document>"u")throw new Error("The sync step one message requires document as an argument");return ls(this.encoder,e.documentName),On(this.encoder,this.type),iY(this.encoder,e.document),this.encoder}}class hY extends co{constructor(){super(...arguments),this.type=wn.Sync,this.description="A document update"}get(e){return ls(this.encoder,e.documentName),On(this.encoder,this.type),lY(this.encoder,e.update),this.encoder}}class pY extends Error{constructor(){super(...arguments),this.code=1001}}class _A extends p2{constructor(e){var n,i,r;super(),this.configuration={name:"",document:void 0,awareness:void 0,token:null,forceSyncInterval:!1,onAuthenticated:()=>null,onAuthenticationFailed:()=>null,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onSynced:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,onStateless:()=>null,onUnsyncedChanges:()=>null},this.isSynced=!1,this.unsyncedChanges=0,this.isAuthenticated=!1,this.authorizedScope=void 0,this.manageSocket=!1,this._isAttached=!1,this.intervals={forceSync:null},this.boundDocumentUpdateHandler=this.documentUpdateHandler.bind(this),this.boundAwarenessUpdateHandler=this.awarenessUpdateHandler.bind(this),this.boundPageHide=this.pageHide.bind(this),this.boundOnOpen=this.onOpen.bind(this),this.boundOnClose=this.onClose.bind(this),this.forwardConnect=()=>this.emit("connect"),this.forwardStatus=s=>this.emit("status",s),this.forwardClose=s=>this.emit("close",s),this.forwardDisconnect=s=>this.emit("disconnect",s),this.forwardDestroy=()=>this.emit("destroy"),this.setConfiguration(e),this.configuration.document=e.document?e.document:new kr,this.configuration.awareness=e.awareness!==void 0?e.awareness:new Qq(this.document),this.on("open",this.configuration.onOpen),this.on("message",this.configuration.onMessage),this.on("outgoingMessage",this.configuration.onOutgoingMessage),this.on("synced",this.configuration.onSynced),this.on("destroy",this.configuration.onDestroy),this.on("awarenessUpdate",this.configuration.onAwarenessUpdate),this.on("awarenessChange",this.configuration.onAwarenessChange),this.on("stateless",this.configuration.onStateless),this.on("unsyncedChanges",this.configuration.onUnsyncedChanges),this.on("authenticated",this.configuration.onAuthenticated),this.on("authenticationFailed",this.configuration.onAuthenticationFailed),(n=this.awareness)===null||n===void 0||n.on("update",()=>{this.emit("awarenessUpdate",{states:EA(this.awareness.getStates())})}),(i=this.awareness)===null||i===void 0||i.on("change",()=>{this.emit("awarenessChange",{states:EA(this.awareness.getStates())})}),this.document.on("update",this.boundDocumentUpdateHandler),(r=this.awareness)===null||r===void 0||r.on("update",this.boundAwarenessUpdateHandler),this.registerEventListeners(),this.configuration.forceSyncInterval&&typeof this.configuration.forceSyncInterval=="number"&&(this.intervals.forceSync=setInterval(this.forceSync.bind(this),this.configuration.forceSyncInterval)),this.manageSocket&&this.attach()}setConfiguration(e={}){e.websocketProvider||(this.manageSocket=!0,this.configuration.websocketProvider=new nY(e)),this.configuration={...this.configuration,...e}}get document(){return this.configuration.document}get isAttached(){return this._isAttached}get awareness(){return this.configuration.awareness}get hasUnsyncedChanges(){return this.unsyncedChanges>0}resetUnsyncedChanges(){this.unsyncedChanges=1,this.emit("unsyncedChanges",{number:this.unsyncedChanges})}incrementUnsyncedChanges(){this.unsyncedChanges+=1,this.emit("unsyncedChanges",{number:this.unsyncedChanges})}decrementUnsyncedChanges(){this.unsyncedChanges>0&&(this.unsyncedChanges-=1),this.unsyncedChanges===0&&(this.synced=!0),this.emit("unsyncedChanges",{number:this.unsyncedChanges})}forceSync(){this.resetUnsyncedChanges(),this.send(OA,{document:this.document,documentName:this.configuration.name})}pageHide(){this.awareness&&yh(this.awareness,[this.document.clientID],"page hide")}registerEventListeners(){typeof window>"u"||!("addEventListener"in window)||window.addEventListener("pagehide",this.boundPageHide)}sendStateless(e){this.send(dY,{documentName:this.configuration.name,payload:e})}async sendToken(){let e;try{e=await this.getToken()}catch(n){this.permissionDeniedHandler(`Failed to get token during sendToken(): ${n}`);return}this.send(fY,{token:e??"",documentName:this.configuration.name})}documentUpdateHandler(e,n){n!==this&&(this.incrementUnsyncedChanges(),this.send(hY,{update:e,documentName:this.configuration.name}))}awarenessUpdateHandler({added:e,updated:n,removed:i},r){const s=e.concat(n).concat(i);this.send(MA,{awareness:this.awareness,clients:s,documentName:this.configuration.name})}get synced(){return this.isSynced}set synced(e){this.isSynced!==e&&(this.isSynced=e,e&&this.emit("synced",{state:e}))}receiveStateless(e){this.emit("stateless",{payload:e})}async connect(){if(this.manageSocket)return this.configuration.websocketProvider.connect();console.warn("HocuspocusProvider::connect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.")}disconnect(){if(this.manageSocket)return this.configuration.websocketProvider.disconnect();console.warn("HocuspocusProvider::disconnect() is deprecated and does not do anything. Please connect/disconnect on the websocketProvider, or attach/deattach providers.")}async onOpen(e){this.isAuthenticated=!1,this.emit("open",{event:e}),await this.sendToken(),this.startSync()}async getToken(){return typeof this.configuration.token=="function"?await this.configuration.token():this.configuration.token}startSync(){this.resetUnsyncedChanges(),this.send(OA,{document:this.document,documentName:this.configuration.name}),this.awareness&&this.awareness.getLocalState()!==null&&this.send(MA,{awareness:this.awareness,clients:[this.document.clientID],documentName:this.configuration.name})}send(e,n){if(!this._isAttached)return;const i=new uY(e,n);this.emit("outgoingMessage",{message:i.message}),i.send(this.configuration.websocketProvider)}onMessage(e){const n=new o1(e.data),i=n.readVarString();n.writeVarString(i),this.emit("message",{event:e,message:new o1(e.data)}),new cY(n).apply(this,!0)}onClose(){this.isAuthenticated=!1,this.synced=!1,this.awareness&&yh(this.awareness,Array.from(this.awareness.getStates().keys()).filter(e=>e!==this.document.clientID),this)}destroy(){this.emit("destroy"),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),this.awareness&&(yh(this.awareness,[this.document.clientID],"provider destroy"),this.awareness.off("update",this.boundAwarenessUpdateHandler),this.awareness.destroy()),this.document.off("update",this.boundDocumentUpdateHandler),this.removeAllListeners(),this.detach(),this.manageSocket&&this.configuration.websocketProvider.destroy(),!(typeof window>"u"||!("removeEventListener"in window))&&window.removeEventListener("pagehide",this.boundPageHide)}detach(){this.configuration.websocketProvider.off("connect",this.configuration.onConnect),this.configuration.websocketProvider.off("connect",this.forwardConnect),this.configuration.websocketProvider.off("status",this.forwardStatus),this.configuration.websocketProvider.off("status",this.configuration.onStatus),this.configuration.websocketProvider.off("open",this.boundOnOpen),this.configuration.websocketProvider.off("close",this.boundOnClose),this.configuration.websocketProvider.off("close",this.configuration.onClose),this.configuration.websocketProvider.off("close",this.forwardClose),this.configuration.websocketProvider.off("disconnect",this.configuration.onDisconnect),this.configuration.websocketProvider.off("disconnect",this.forwardDisconnect),this.configuration.websocketProvider.off("destroy",this.configuration.onDestroy),this.configuration.websocketProvider.off("destroy",this.forwardDestroy),this.configuration.websocketProvider.detach(this),this._isAttached=!1}attach(){this._isAttached||(this.configuration.websocketProvider.on("connect",this.configuration.onConnect),this.configuration.websocketProvider.on("connect",this.forwardConnect),this.configuration.websocketProvider.on("status",this.configuration.onStatus),this.configuration.websocketProvider.on("status",this.forwardStatus),this.configuration.websocketProvider.on("open",this.boundOnOpen),this.configuration.websocketProvider.on("close",this.boundOnClose),this.configuration.websocketProvider.on("close",this.configuration.onClose),this.configuration.websocketProvider.on("close",this.forwardClose),this.configuration.websocketProvider.on("disconnect",this.configuration.onDisconnect),this.configuration.websocketProvider.on("disconnect",this.forwardDisconnect),this.configuration.websocketProvider.on("destroy",this.configuration.onDestroy),this.configuration.websocketProvider.on("destroy",this.forwardDestroy),this.configuration.websocketProvider.attach(this),this._isAttached=!0)}permissionDeniedHandler(e){this.emit("authenticationFailed",{reason:e}),this.isAuthenticated=!1}authenticatedHandler(e){this.isAuthenticated=!0,this.authorizedScope=e,this.emit("authenticated",{scope:e})}setAwarenessField(e,n){if(!this.awareness)throw new pY(`Cannot set awareness field "${e}" to ${JSON.stringify(n)}. You have disabled Awareness for this provider by explicitly passing awareness: null in the provider configuration.`);this.awareness.setLocalStateField(e,n)}}function mY(t,e,n){return t.filter(i=>!e.has(i.id)&&!n.has(i.id))}function gY(){var M;const[t,e]=N.useState([]),[n,i]=N.useState(null),[r,s]=N.useState(!1),[o,c]=N.useState("connecting"),[f,d]=N.useState(0),[p,m]=N.useState(null),[y,b]=N.useState([]),[S,v]=N.useState(null),[k,E]=N.useState(!1),[j,L]=N.useState(!1),[re,P]=N.useState(!1),[O,z]=N.useState(!1),F=N.useRef(null),se=N.useRef(!1),te=N.useRef(null),he=N.useRef(null),ce=N.useRef([]);ce.current=t;const Q=N.useRef(new Set),ie=N.useRef(new Map);for(const _ of t)Q.current.delete(_.id),ie.current.delete(_.id);const Z=N.useRef(new Map),I=N.useRef(new Map),K=N.useRef(void 0),pe=N.useCallback(_=>{const{ydoc:U}=_,T=U.getMap(oa),ne=()=>{const Xe=[];T.forEach(Ht=>{Xe.push(Ht)}),b(Xe)};T.observe(ne),ne();const me=U.getMap(NA);let ge=null,Oe=!1;const Ge=()=>{const Xe=me.get("claude"),Ht=(Xe==null?void 0:Xe.status)??null,Nt=(Xe==null?void 0:Xe.active)??!1;Ht!==ge&&(ge=Ht,v(Ht)),Nt!==Oe&&(Oe=Nt,E(Nt))};me.observe(Ge),Ge();const Fe=U.getMap(th);let ct=!1;const Ce=()=>{const Xe=Fe.get("readOnly")===!0;Xe!==ct&&(ct=Xe,L(Xe))};return Fe.observe(Ce),Ce(),()=>{T.unobserve(ne),me.unobserve(Ge),Fe.unobserve(Ce)}},[]);K.current=(_,U)=>{var Fe,ct;const T=ce.current,ne=new Set(T.map(Ce=>Ce.id)),me=new Set(_.map(Ce=>Ce.id));for(const[Ce,Xe]of ie.current)me.has(Ce)||((Fe=I.current.get(Ce))==null||Fe(),I.current.delete(Ce),Xe.provider.destroy(),Xe.ydoc.destroy(),ie.current.delete(Ce),Q.current.delete(Ce));const ge=mY(_,ne,Q.current),Oe=[];for(const Ce of ge){Q.current.add(Ce.id);const Xe=new kr,Ht=new _A({url:`ws://localhost:${Zk}`,name:Ce.id,document:Xe});ie.current.set(Ce.id,{ydoc:Xe,provider:Ht});const Nt=Xe.getMap(th),je=()=>{var qi;const Fn=Nt.get("openDocuments"),Fi=Nt.get("activeDocumentId");Fn&&((qi=K.current)==null||qi.call(K,Fn,Fi??null))};Nt.observe(je),I.current.set(Ce.id,()=>Nt.unobserve(je)),Oe.push({...Ce,ydoc:Xe,provider:Ht})}const Ge=T.filter(Ce=>!me.has(Ce.id));for(const Ce of Ge){const Xe=Z.current.get(Ce.id);Xe&&(Xe.cleanup(),Z.current.delete(Ce.id)),(ct=I.current.get(Ce.id))==null||ct(),I.current.delete(Ce.id),Q.current.delete(Ce.id),ie.current.delete(Ce.id),Ce.provider.destroy(),Ce.ydoc.destroy()}e(Ce=>[...Ce.filter(Ht=>me.has(Ht.id)),...Oe]),U!==null&&i(Ce=>Ce===null||!me.has(Ce)?U:Ge.length>0&&U===Ce?Ce:U)},N.useEffect(()=>{const _=new kr,U=new _A({url:`ws://localhost:${Zk}`,name:ZR,document:_});return te.current={ydoc:_,provider:U},U.on("status",({status:T})=>{s(T==="connected"),c(T),T==="connected"?(se.current=!0,d(0),m(null)):T==="disconnected"?m(ne=>ne??Date.now()):T==="connecting"&&(se.current&&d(ne=>ne+1),m(ne=>ne??Date.now()))}),P(!0),()=>{U.destroy(),_.destroy(),te.current=null}},[]),N.useEffect(()=>{if(!te.current)return;const _=te.current.ydoc.getMap(th),U=()=>{var ge;const T=_.get("generationId");T&&he.current&&T!==he.current&&(console.warn("[Tandem] Server restarted — refreshing documents"),z(!0),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>z(!1),5e3)),T&&(he.current=T);const ne=_.get("openDocuments"),me=_.get("activeDocumentId");ne&&((ge=K.current)==null||ge.call(K,ne,me??null))};return _.observe(U),U(),()=>{_.unobserve(U),F.current&&clearTimeout(F.current)}},[]),N.useEffect(()=>{for(const U of Z.current.values())U.cleanup();Z.current.clear();const _=ce.current.find(U=>U.id===n);if(_){const U=pe(_);Z.current.set(_.id,{cleanup:U})}else b([]),v(null),E(!1),L(!1)},[n,pe]);const fe=N.useCallback(_=>{i(U=>{if(U!==_)return U;const T=ce.current,ne=T.findIndex(ge=>ge.id===_),me=T.filter(ge=>ge.id!==_);return me.length===0?null:me[Math.min(ne,me.length-1)].id}),fetch(`http://localhost:${c1}/api/close`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({documentId:_})}).then(U=>{U.ok||console.warn("[Tandem] Server rejected close:",U.status)}).catch(U=>{console.warn("[Tandem] Failed to close document on server:",U)})},[]);return{tabs:t,activeTabId:n,setActiveTabId:i,handleTabClose:fe,connected:r,connectionStatus:o,reconnectAttempts:f,disconnectedSince:p,annotations:y,claudeStatus:S,claudeActive:k,readOnly:j,bootstrapYdoc:((M=te.current)==null?void 0:M.ydoc)??null,ready:re,serverRestarted:O}}function yY({connected:t,claudeActive:e}){const[n,i]=N.useState(!1);return N.useEffect(()=>{if(t){i(!1);return}const r=setTimeout(()=>i(!0),qR);return()=>clearTimeout(r)},[t]),A.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",color:"#9ca3af",gap:"8px"},children:n?A.jsx("span",{children:"Cannot reach the Tandem server. Is it running?"}):A.jsxs(A.Fragment,{children:[A.jsx("span",{children:"No document open. Click + in the tab bar or drop a file here."}),t&&!e&&A.jsx("span",{style:{fontSize:"0.85em",color:"#b0b8c4"},children:"Tip: open Claude Code in this directory to start collaborating"})]})})}function bY({onDismiss:t}){return A.jsxs("div",{style:{padding:"8px 16px",background:"#fef2f2",borderBottom:"1px solid #fca5a5",fontSize:"13px",color:"#991b1b",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",gap:"12px"},children:[A.jsx("span",{children:"Connection to the Tandem server has been lost. Ensure the server is running."}),A.jsx("button",{onClick:t,style:{background:"none",border:"none",cursor:"pointer",color:"#991b1b",fontSize:"16px",lineHeight:1,padding:"0 4px"},"aria-label":"Dismiss connection banner",children:"\\u00d7"})]})}function xY(){var li;const{tabs:t,activeTabId:e,setActiveTabId:n,handleTabClose:i,connected:r,connectionStatus:s,reconnectAttempts:o,disconnectedSince:c,annotations:f,claudeStatus:d,claudeActive:p,readOnly:m,bootstrapYdoc:y,ready:b,serverRestarted:S}=gY(),{orderedTabs:v,reorder:k}=tq(t),[E,j]=N.useState(()=>{const ee=localStorage.getItem(Jk);return GF.safeParse(ee).success?ee:GR});N.useEffect(()=>{localStorage.setItem(Jk,E)},[E]);const L=(li=t.find(ee=>ee.id===e))==null?void 0:li.ydoc;N.useEffect(()=>{if(!L)return;L.getMap(RA).set("interruptionMode",E)},[E,L]);const[re,P]=N.useState(!1),[O,z]=N.useState(!1);N.useEffect(()=>{if(c==null){P(!1),z(!1);return}const ee=Date.now()-c,Le=YR-ee;if(Le<=0){P(!0);return}const it=setTimeout(()=>P(!0),Le);return()=>clearTimeout(it)},[c]);const{visibleAnnotations:F,heldCount:se}=JF(f,E),te=N.useMemo(()=>t.map(ee=>({id:ee.id,fileName:ee.fileName})),[t]),{toasts:he,dismiss:ce}=WF(),{fileDragOver:Q,handleEditorDragOver:ie,handleEditorDragLeave:Z,handleEditorDrop:I}=XF(),{pendingCount:K,showReviewSummary:pe,reviewSummaryData:fe,dismissReviewSummary:M}=QF(f),[_,U]=N.useState(!1),[T,ne]=N.useState(!1),[me,ge]=N.useState(!1),[Oe,Ge]=N.useState(null),[Fe,ct]=N.useState(!1),Ce=N.useRef(null),Xe=N.useCallback(ee=>{Ce.current=ee},[]);N.useEffect(()=>{K>=KR&&!_&&ne(!0),K===0&&ne(!1)},[K,_]);const Ht=N.useCallback(()=>{U(ee=>!ee),ne(!1)},[]),Nt=N.useCallback(()=>{U(!1),ne(!1)},[]);N.useEffect(()=>{const ee=Le=>{if(Le.key!=="?")return;const it=Le.target;it.tagName==="INPUT"||it.tagName==="TEXTAREA"||it.isContentEditable||ct(qe=>!qe)};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[]);const je=t.find(ee=>ee.id===e),{tutorialActive:Fn,currentStep:Fi,dismissTutorial:qi,nextStep:Yi}=iq(f,Ce,je==null?void 0:je.fileName);return b?A.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh"},children:[S&&A.jsx("div",{style:{padding:"8px 16px",background:"#fef3c7",borderBottom:"1px solid #fbbf24",fontSize:"13px",color:"#92400e",textAlign:"center"},children:"Server restarted — refreshing documents"}),re&&!O&&A.jsx(bY,{onDismiss:()=>z(!0)}),A.jsx(tF,{editor:Ce.current,ydoc:(je==null?void 0:je.ydoc)??null}),A.jsx(dF,{tabs:v,activeTabId:e,onTabSwitch:n,onTabClose:i,reorder:k}),T&&!_&&A.jsxs("div",{style:{padding:"8px 16px",background:"#eef2ff",borderBottom:"1px solid #c7d2fe",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"13px",color:"#4338ca"},children:[A.jsxs("span",{children:[K," annotations pending review."]}),A.jsxs("div",{style:{display:"flex",gap:"8px"},children:[A.jsx("button",{onClick:Ht,style:{padding:"3px 10px",fontSize:"12px",border:"1px solid #6366f1",borderRadius:"4px",background:"#6366f1",color:"white",cursor:"pointer",fontWeight:500},children:"Review in sequence"}),A.jsx("button",{onClick:()=>ne(!1),style:{padding:"3px 10px",fontSize:"12px",border:"1px solid #d1d5db",borderRadius:"4px",background:"white",color:"#6b7280",cursor:"pointer"},children:"Dismiss"})]})]}),A.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[A.jsxs("div",{style:{flex:1,overflow:"auto",padding:"24px 48px",border:Q?"2px dashed #6366f1":"2px solid transparent",background:Q?"#eef2ff":void 0,transition:"border-color 0.15s, background 0.15s"},onDragOver:ie,onDragLeave:Z,onDrop:I,children:[A.jsx(gF,{visible:(je==null?void 0:je.readOnly)===!0&&(je==null?void 0:je.format)==="docx",documentId:je==null?void 0:je.id}),je?A.jsx(p9,{ydoc:je.ydoc,provider:je.provider,readOnly:m,reviewMode:_,activeAnnotationId:Oe,onEditorReady:Xe},je.id):A.jsx(yY,{connected:r,claudeActive:p})]}),A.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"300px",borderLeft:"1px solid #e5e7eb"},children:[A.jsxs("div",{style:{display:"flex",borderBottom:"1px solid #e5e7eb",background:"#f9fafb"},children:[A.jsx("button",{onClick:()=>ge(!1),style:{flex:1,padding:"8px",fontSize:"12px",fontWeight:me?400:600,border:"none",borderBottom:me?"none":"2px solid #6366f1",background:"transparent",cursor:"pointer",color:me?"#6b7280":"#6366f1"},children:"Annotations"}),A.jsx("button",{onClick:()=>ge(!0),style:{flex:1,padding:"8px",fontSize:"12px",fontWeight:me?600:400,border:"none",borderBottom:me?"2px solid #6366f1":"none",background:"transparent",cursor:"pointer",color:me?"#6366f1":"#6b7280"},children:"Chat"})]}),A.jsx("div",{style:{display:me?"flex":"none",flexDirection:"column",flex:1,minHeight:0},children:A.jsx(K$,{ctrlYdoc:y,editor:Ce.current,activeDocId:e,openDocs:te,claudeActive:p,claudeStatus:d,visible:me})}),A.jsx("div",{style:{display:me?"none":"flex",flexDirection:"column",flex:1,minHeight:0},children:A.jsx(v9,{annotations:F,editor:Ce.current,ydoc:(je==null?void 0:je.ydoc)??null,heldCount:se,interruptionMode:E,onModeChange:j,activeDocFormat:je==null?void 0:je.format,documentId:je==null?void 0:je.id,reviewMode:_,onToggleReviewMode:Ht,onExitReviewMode:Nt,activeAnnotationId:Oe,onActiveAnnotationChange:Ge})})]})]}),A.jsx(J$,{connected:r,connectionStatus:s,reconnectAttempts:o,disconnectedSince:c,claudeStatus:d,claudeActive:p,readOnly:m,documentCount:t.length,interruptionMode:E,onModeChange:j,heldCount:se}),pe&&fe&&A.jsx(hF,{accepted:fe.accepted,dismissed:fe.dismissed,total:fe.total,onDismiss:M}),A.jsx(mF,{open:Fe,onClose:()=>ct(!1)}),A.jsx(bF,{toasts:he,onDismiss:ce}),Fn&&A.jsx(wF,{currentStep:Fi,onNext:Yi,onDismiss:qi})]}):A.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100vh",color:"#9ca3af"},children:"Connecting..."})}const SY=PR.createRoot(document.getElementById("root"));SY.render(A.jsx(on.StrictMode,{children:A.jsx($R,{children:A.jsx(xY,{})})}));
|