@kontexted/darwin-arm64 0.1.0

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.

Potentially problematic release.


This version of @kontexted/darwin-arm64 might be problematic. Click here for more details.

@@ -0,0 +1,321 @@
1
+ var LX=Object.defineProperty;var KE=t=>{throw TypeError(t)};var zX=(t,e,n)=>e in t?LX(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var We=(t,e,n)=>zX(t,typeof e!="symbol"?e+"":e,n),JE=(t,e,n)=>e.has(t)||KE("Cannot "+n);var Uf=(t,e,n)=>(JE(t,e,"read from private field"),n?n.call(t):e.get(t)),eR=(t,e,n)=>e.has(t)?KE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),tR=(t,e,n,r)=>(JE(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);import{r as _w,a as w,j as S,R as it,g as jX,b as $w,u as Ur,c as Yr,d as ps,Q as IX,e as ZX}from"./state-vendor-BT1BogGT.js";import{r as W$}from"./react-vendor-Bz9DKma8.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var iv={exports:{}},Vf={},sv={exports:{}},ov={};/**
2
+ * @license React
3
+ * scheduler.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var nR;function XX(){return nR||(nR=1,(function(t){function e(N,V){var Z=N.length;N.push(V);e:for(;0<Z;){var W=Z-1>>>1,fe=N[W];if(0<i(fe,V))N[W]=V,N[Z]=fe,Z=W;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var V=N[0],Z=N.pop();if(Z!==V){N[0]=Z;e:for(var W=0,fe=N.length,se=fe>>>1;W<se;){var ge=2*(W+1)-1,oe=N[ge],he=ge+1,me=N[he];if(0>i(oe,Z))he<fe&&0>i(me,oe)?(N[W]=me,N[he]=Z,W=he):(N[W]=oe,N[ge]=Z,W=ge);else if(he<fe&&0>i(me,Z))N[W]=me,N[he]=Z,W=he;else break e}}return V}function i(N,V){var Z=N.sortIndex-V.sortIndex;return Z!==0?Z:N.id-V.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,l=a.now();t.unstable_now=function(){return a.now()-l}}var u=[],d=[],h=1,g=null,m=3,O=!1,v=!1,x=!1,k=!1,C=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function E(N){for(var V=n(d);V!==null;){if(V.callback===null)r(d);else if(V.startTime<=N)r(d),V.sortIndex=V.expirationTime,e(u,V);else break;V=n(d)}}function P(N){if(x=!1,E(N),!v)if(n(u)!==null)v=!0,$||($=!0,U());else{var V=n(d);V!==null&&ee(P,V.startTime-N)}}var $=!1,_=-1,D=5,B=-1;function L(){return k?!0:!(t.unstable_now()-B<D)}function M(){if(k=!1,$){var N=t.unstable_now();B=N;var V=!0;try{e:{v=!1,x&&(x=!1,Q(_),_=-1),O=!0;var Z=m;try{t:{for(E(N),g=n(u);g!==null&&!(g.expirationTime>N&&L());){var W=g.callback;if(typeof W=="function"){g.callback=null,m=g.priorityLevel;var fe=W(g.expirationTime<=N);if(N=t.unstable_now(),typeof fe=="function"){g.callback=fe,E(N),V=!0;break t}g===n(u)&&r(u),E(N)}else r(u);g=n(u)}if(g!==null)V=!0;else{var se=n(d);se!==null&&ee(P,se.startTime-N),V=!1}}break e}finally{g=null,m=Z,O=!1}V=void 0}}finally{V?U():$=!1}}}var U;if(typeof R=="function")U=function(){R(M)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,H=Y.port2;Y.port1.onmessage=M,U=function(){H.postMessage(null)}}else U=function(){C(M,0)};function ee(N,V){_=C(function(){N(t.unstable_now())},V)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(N){N.callback=null},t.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<N?Math.floor(1e3/N):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function(N){switch(m){case 1:case 2:case 3:var V=3;break;default:V=m}var Z=m;m=V;try{return N()}finally{m=Z}},t.unstable_requestPaint=function(){k=!0},t.unstable_runWithPriority=function(N,V){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var Z=m;m=N;try{return V()}finally{m=Z}},t.unstable_scheduleCallback=function(N,V,Z){var W=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?W+Z:W):Z=W,N){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=Z+fe,N={id:h++,callback:V,priorityLevel:N,startTime:Z,expirationTime:fe,sortIndex:-1},Z>W?(N.sortIndex=Z,e(d,N),n(u)===null&&N===n(d)&&(x?(Q(_),_=-1):x=!0,ee(P,Z-W))):(N.sortIndex=fe,e(u,N),v||O||(v=!0,$||($=!0,U()))),N},t.unstable_shouldYield=L,t.unstable_wrapCallback=function(N){var V=m;return function(){var Z=m;m=V;try{return N.apply(this,arguments)}finally{m=Z}}}})(ov)),ov}var rR;function BX(){return rR||(rR=1,sv.exports=XX()),sv.exports}/**
10
+ * @license React
11
+ * react-dom-client.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var iR;function UX(){if(iR)return Vf;iR=1;var t=BX(),e=_w(),n=W$();function r(o){var c="https://react.dev/errors/"+o;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+o+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function s(o){var c=o,f=o;if(o.alternate)for(;c.return;)c=c.return;else{o=c;do c=o,(c.flags&4098)!==0&&(f=c.return),o=c.return;while(o)}return c.tag===3?f:null}function a(o){if(o.tag===13){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function l(o){if(o.tag===31){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function u(o){if(s(o)!==o)throw Error(r(188))}function d(o){var c=o.alternate;if(!c){if(c=s(o),c===null)throw Error(r(188));return c!==o?null:o}for(var f=o,p=c;;){var y=f.return;if(y===null)break;var b=y.alternate;if(b===null){if(p=y.return,p!==null){f=p;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===f)return u(y),o;if(b===p)return u(y),c;b=b.sibling}throw Error(r(188))}if(f.return!==p.return)f=y,p=b;else{for(var T=!1,A=y.child;A;){if(A===f){T=!0,f=y,p=b;break}if(A===p){T=!0,p=y,f=b;break}A=A.sibling}if(!T){for(A=b.child;A;){if(A===f){T=!0,f=b,p=y;break}if(A===p){T=!0,p=b,f=y;break}A=A.sibling}if(!T)throw Error(r(189))}}if(f.alternate!==p)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?o:c}function h(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o;for(o=o.child;o!==null;){if(c=h(o),c!==null)return c;o=o.sibling}return null}var g=Object.assign,m=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),R=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),M=Symbol.iterator;function U(o){return o===null||typeof o!="object"?null:(o=M&&o[M]||o["@@iterator"],typeof o=="function"?o:null)}var Y=Symbol.for("react.client.reference");function H(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===Y?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case x:return"Fragment";case C:return"Profiler";case k:return"StrictMode";case P:return"Suspense";case $:return"SuspenseList";case B:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case v:return"Portal";case R:return o.displayName||"Context";case Q:return(o._context.displayName||"Context")+".Consumer";case E:var c=o.render;return o=o.displayName,o||(o=c.displayName||c.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case _:return c=o.displayName||null,c!==null?c:H(o.type)||"Memo";case D:c=o._payload,o=o._init;try{return H(o(c))}catch{}}return null}var ee=Array.isArray,N=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},W=[],fe=-1;function se(o){return{current:o}}function ge(o){0>fe||(o.current=W[fe],W[fe]=null,fe--)}function oe(o,c){fe++,W[fe]=o.current,o.current=c}var he=se(null),me=se(null),Ce=se(null),Te=se(null);function Ye(o,c){switch(oe(Ce,c),oe(me,o),oe(he,null),c.nodeType){case 9:case 11:o=(o=c.documentElement)&&(o=o.namespaceURI)?xE(o):0;break;default:if(o=c.tagName,c=c.namespaceURI)c=xE(c),o=SE(c,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}ge(he),oe(he,o)}function je(){ge(he),ge(me),ge(Ce)}function ze(o){o.memoizedState!==null&&oe(Te,o);var c=he.current,f=SE(c,o.type);c!==f&&(oe(me,o),oe(he,f))}function Ct(o){me.current===o&&(ge(he),ge(me)),Te.current===o&&(ge(Te),If._currentValue=Z)}var Fe,Tt;function lt(o){if(Fe===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);Fe=c&&c[1]||"",Tt=-1<f.stack.indexOf(`
18
+ at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
19
+ `+Fe+o+Tt}var ut=!1;function Qt(o,c){if(!o||ut)return"";ut=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(c){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(J){var K=J}Reflect.construct(o,[],ie)}else{try{ie.call()}catch(J){K=J}o.call(ie.prototype)}}else{try{throw Error()}catch(J){K=J}(ie=o())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(J){if(J&&K&&typeof J.stack=="string")return[J.stack,K.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=p.DetermineComponentFrameRoot(),T=b[0],A=b[1];if(T&&A){var z=T.split(`
20
+ `),F=A.split(`
21
+ `);for(y=p=0;p<z.length&&!z[p].includes("DetermineComponentFrameRoot");)p++;for(;y<F.length&&!F[y].includes("DetermineComponentFrameRoot");)y++;if(p===z.length||y===F.length)for(p=z.length-1,y=F.length-1;1<=p&&0<=y&&z[p]!==F[y];)y--;for(;1<=p&&0<=y;p--,y--)if(z[p]!==F[y]){if(p!==1||y!==1)do if(p--,y--,0>y||z[p]!==F[y]){var te=`
22
+ `+z[p].replace(" at new "," at ");return o.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",o.displayName)),te}while(1<=p&&0<=y);break}}}finally{ut=!1,Error.prepareStackTrace=f}return(f=o?o.displayName||o.name:"")?lt(f):""}function on(o,c){switch(o.tag){case 26:case 27:case 5:return lt(o.type);case 16:return lt("Lazy");case 13:return o.child!==c&&c!==null?lt("Suspense Fallback"):lt("Suspense");case 19:return lt("SuspenseList");case 0:case 15:return Qt(o.type,!1);case 11:return Qt(o.type.render,!1);case 1:return Qt(o.type,!0);case 31:return lt("Activity");default:return""}}function Ht(o){try{var c="",f=null;do c+=on(o,f),f=o,o=o.return;while(o);return c}catch(p){return`
23
+ Error generating stack: `+p.message+`
24
+ `+p.stack}}var Ge=Object.prototype.hasOwnProperty,It=t.unstable_scheduleCallback,jn=t.unstable_cancelCallback,He=t.unstable_shouldYield,Gr=t.unstable_requestPaint,Zt=t.unstable_now,In=t.unstable_getCurrentPriorityLevel,Be=t.unstable_ImmediatePriority,Ue=t.unstable_UserBlockingPriority,gt=t.unstable_NormalPriority,Fn=t.unstable_LowPriority,gr=t.unstable_IdlePriority,gn=t.log,Wr=t.unstable_setDisableYieldValue,Hn=null,tn=null;function Dt(o){if(typeof gn=="function"&&Wr(o),tn&&typeof tn.setStrictMode=="function")try{tn.setStrictMode(Hn,o)}catch{}}var Xt=Math.clz32?Math.clz32:eo,bi=Math.log,_r=Math.LN2;function eo(o){return o>>>=0,o===0?32:31-(bi(o)/_r|0)|0}var ar=256,mr=262144,Bt=4194304;function ht(o){var c=o&42;if(c!==0)return c;switch(o&-o){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 o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Kt(o,c,f){var p=o.pendingLanes;if(p===0)return 0;var y=0,b=o.suspendedLanes,T=o.pingedLanes;o=o.warmLanes;var A=p&134217727;return A!==0?(p=A&~b,p!==0?y=ht(p):(T&=A,T!==0?y=ht(T):f||(f=A&~o,f!==0&&(y=ht(f))))):(A=p&~b,A!==0?y=ht(A):T!==0?y=ht(T):f||(f=p&~o,f!==0&&(y=ht(f)))),y===0?0:c!==0&&c!==y&&(c&b)===0&&(b=y&-y,f=c&-c,b>=f||b===32&&(f&4194048)!==0)?c:y}function wn(o,c){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&c)===0}function et(o,c){switch(o){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 Nt(){var o=Bt;return Bt<<=1,(Bt&62914560)===0&&(Bt=4194304),o}function mn(o){for(var c=[],f=0;31>f;f++)c.push(o);return c}function ae(o,c){o.pendingLanes|=c,c!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function ve(o,c,f,p,y,b){var T=o.pendingLanes;o.pendingLanes=f,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=f,o.entangledLanes&=f,o.errorRecoveryDisabledLanes&=f,o.shellSuspendCounter=0;var A=o.entanglements,z=o.expirationTimes,F=o.hiddenUpdates;for(f=T&~f;0<f;){var te=31-Xt(f),ie=1<<te;A[te]=0,z[te]=-1;var K=F[te];if(K!==null)for(F[te]=null,te=0;te<K.length;te++){var J=K[te];J!==null&&(J.lane&=-536870913)}f&=~ie}p!==0&&Ve(o,p,0),b!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=b&~(T&~c))}function Ve(o,c,f){o.pendingLanes|=c,o.suspendedLanes&=~c;var p=31-Xt(c);o.entangledLanes|=c,o.entanglements[p]=o.entanglements[p]|1073741824|f&261930}function re(o,c){var f=o.entangledLanes|=c;for(o=o.entanglements;f;){var p=31-Xt(f),y=1<<p;y&c|o[p]&c&&(o[p]|=c),f&=~y}}function ue(o,c){var f=c&-c;return f=(f&42)!==0?1:Oe(f),(f&(o.suspendedLanes|c))!==0?0:f}function Oe(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Ae(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function vt(){var o=V.p;return o!==0?o:(o=window.event,o===void 0?32:VE(o.type))}function cn(o,c){var f=V.p;try{return V.p=o,c()}finally{V.p=f}}var xt=Math.random().toString(36).slice(2),ft="__reactFiber$"+xt,mt="__reactProps$"+xt,Zn="__reactContainer$"+xt,vi="__reactEvents$"+xt,Kl="__reactListeners$"+xt,Pn="__reactHandles$"+xt,Or="__reactResources$"+xt,ye="__reactMarker$"+xt;function I(o){delete o[ft],delete o[mt],delete o[vi],delete o[Kl],delete o[Pn]}function ce(o){var c=o[ft];if(c)return c;for(var f=o.parentNode;f;){if(c=f[Zn]||f[ft]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(o=RE(o);o!==null;){if(f=o[ft])return f;o=RE(o)}return c}o=f,f=o.parentNode}return null}function be(o){if(o=o[ft]||o[Zn]){var c=o.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return o}return null}function Et(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o.stateNode;throw Error(r(33))}function an(o){var c=o[Or];return c||(c=o[Or]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function Ke(o){o[ye]=!0}var Kn=new Set,xi={};function $r(o,c){bs(o,c),bs(o+"Capture",c)}function bs(o,c){for(xi[o]=c,o=0;o<c.length;o++)Kn.add(c[o])}var _n=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]*$"),ef={},tf={};function RI(o){return Ge.call(tf,o)?!0:Ge.call(ef,o)?!1:_n.test(o)?tf[o]=!0:(ef[o]=!0,!1)}function tp(o,c,f){if(RI(c))if(f===null)o.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":o.removeAttribute(c);return;case"boolean":var p=c.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){o.removeAttribute(c);return}}o.setAttribute(c,""+f)}}function np(o,c,f){if(f===null)o.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(c);return}o.setAttribute(c,""+f)}}function to(o,c,f,p){if(p===null)o.removeAttribute(f);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(f);return}o.setAttributeNS(c,f,""+p)}}function Si(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function hC(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function AI(o,c,f){var p=Object.getOwnPropertyDescriptor(o.constructor.prototype,c);if(!o.hasOwnProperty(c)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var y=p.get,b=p.set;return Object.defineProperty(o,c,{configurable:!0,get:function(){return y.call(this)},set:function(T){f=""+T,b.call(this,T)}}),Object.defineProperty(o,c,{enumerable:p.enumerable}),{getValue:function(){return f},setValue:function(T){f=""+T},stopTracking:function(){o._valueTracker=null,delete o[c]}}}}function Hy(o){if(!o._valueTracker){var c=hC(o)?"checked":"value";o._valueTracker=AI(o,c,""+o[c])}}function pC(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var f=c.getValue(),p="";return o&&(p=hC(o)?o.checked?"true":"false":o.value),o=p,o!==f?(c.setValue(o),!0):!1}function rp(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var PI=/[\n"\\]/g;function wi(o){return o.replace(PI,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Ky(o,c,f,p,y,b,T,A){o.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?o.type=T:o.removeAttribute("type"),c!=null?T==="number"?(c===0&&o.value===""||o.value!=c)&&(o.value=""+Si(c)):o.value!==""+Si(c)&&(o.value=""+Si(c)):T!=="submit"&&T!=="reset"||o.removeAttribute("value"),c!=null?Jy(o,T,Si(c)):f!=null?Jy(o,T,Si(f)):p!=null&&o.removeAttribute("value"),y==null&&b!=null&&(o.defaultChecked=!!b),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?o.name=""+Si(A):o.removeAttribute("name")}function gC(o,c,f,p,y,b,T,A){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(o.type=b),c!=null||f!=null){if(!(b!=="submit"&&b!=="reset"||c!=null)){Hy(o);return}f=f!=null?""+Si(f):"",c=c!=null?""+Si(c):f,A||c===o.value||(o.value=c),o.defaultValue=c}p=p??y,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=A?o.checked:!!p,o.defaultChecked=!!p,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(o.name=T),Hy(o)}function Jy(o,c,f){c==="number"&&rp(o.ownerDocument)===o||o.defaultValue===""+f||(o.defaultValue=""+f)}function Jl(o,c,f,p){if(o=o.options,c){c={};for(var y=0;y<f.length;y++)c["$"+f[y]]=!0;for(f=0;f<o.length;f++)y=c.hasOwnProperty("$"+o[f].value),o[f].selected!==y&&(o[f].selected=y),y&&p&&(o[f].defaultSelected=!0)}else{for(f=""+Si(f),c=null,y=0;y<o.length;y++){if(o[y].value===f){o[y].selected=!0,p&&(o[y].defaultSelected=!0);return}c!==null||o[y].disabled||(c=o[y])}c!==null&&(c.selected=!0)}}function mC(o,c,f){if(c!=null&&(c=""+Si(c),c!==o.value&&(o.value=c),f==null)){o.defaultValue!==c&&(o.defaultValue=c);return}o.defaultValue=f!=null?""+Si(f):""}function OC(o,c,f,p){if(c==null){if(p!=null){if(f!=null)throw Error(r(92));if(ee(p)){if(1<p.length)throw Error(r(93));p=p[0]}f=p}f==null&&(f=""),c=f}f=Si(c),o.defaultValue=f,p=o.textContent,p===f&&p!==""&&p!==null&&(o.value=p),Hy(o)}function ec(o,c){if(c){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=c;return}}o.textContent=c}var _I=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 yC(o,c,f){var p=c.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?p?o.setProperty(c,""):c==="float"?o.cssFloat="":o[c]="":p?o.setProperty(c,f):typeof f!="number"||f===0||_I.has(c)?c==="float"?o.cssFloat=f:o[c]=(""+f).trim():o[c]=f+"px"}function bC(o,c,f){if(c!=null&&typeof c!="object")throw Error(r(62));if(o=o.style,f!=null){for(var p in f)!f.hasOwnProperty(p)||c!=null&&c.hasOwnProperty(p)||(p.indexOf("--")===0?o.setProperty(p,""):p==="float"?o.cssFloat="":o[p]="");for(var y in c)p=c[y],c.hasOwnProperty(y)&&f[y]!==p&&yC(o,y,p)}else for(var b in c)c.hasOwnProperty(b)&&yC(o,b,c[b])}function eb(o){if(o.indexOf("-")===-1)return!1;switch(o){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 $I=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"]]),MI=/^[\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 ip(o){return MI.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function no(){}var tb=null;function nb(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var tc=null,nc=null;function vC(o){var c=be(o);if(c&&(o=c.stateNode)){var f=o[mt]||null;e:switch(o=c.stateNode,c.type){case"input":if(Ky(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),c=f.name,f.type==="radio"&&c!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+wi(""+c)+'"][type="radio"]'),c=0;c<f.length;c++){var p=f[c];if(p!==o&&p.form===o.form){var y=p[mt]||null;if(!y)throw Error(r(90));Ky(p,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(c=0;c<f.length;c++)p=f[c],p.form===o.form&&pC(p)}break e;case"textarea":mC(o,f.value,f.defaultValue);break e;case"select":c=f.value,c!=null&&Jl(o,!!f.multiple,c,!1)}}}var rb=!1;function xC(o,c,f){if(rb)return o(c,f);rb=!0;try{var p=o(c);return p}finally{if(rb=!1,(tc!==null||nc!==null)&&(Vp(),tc&&(c=tc,o=nc,nc=tc=null,vC(c),o)))for(c=0;c<o.length;c++)vC(o[c])}}function nf(o,c){var f=o.stateNode;if(f===null)return null;var p=f[mt]||null;if(p===null)return null;f=p[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(o=o.type,p=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!p;break e;default:o=!1}if(o)return null;if(f&&typeof f!="function")throw Error(r(231,c,typeof f));return f}var ro=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ib=!1;if(ro)try{var rf={};Object.defineProperty(rf,"passive",{get:function(){ib=!0}}),window.addEventListener("test",rf,rf),window.removeEventListener("test",rf,rf)}catch{ib=!1}var Uo=null,sb=null,sp=null;function SC(){if(sp)return sp;var o,c=sb,f=c.length,p,y="value"in Uo?Uo.value:Uo.textContent,b=y.length;for(o=0;o<f&&c[o]===y[o];o++);var T=f-o;for(p=1;p<=T&&c[f-p]===y[b-p];p++);return sp=y.slice(o,1<p?1-p:void 0)}function op(o){var c=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&c===13&&(o=13)):o=c,o===10&&(o=13),32<=o||o===13?o:0}function ap(){return!0}function wC(){return!1}function Mr(o){function c(f,p,y,b,T){this._reactName=f,this._targetInst=y,this.type=p,this.nativeEvent=b,this.target=T,this.currentTarget=null;for(var A in o)o.hasOwnProperty(A)&&(f=o[A],this[A]=f?f(b):b[A]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?ap:wC,this.isPropagationStopped=wC,this}return g(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=ap)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=ap)},persist:function(){},isPersistent:ap}),c}var Fa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lp=Mr(Fa),sf=g({},Fa,{view:0,detail:0}),DI=Mr(sf),ob,ab,of,cp=g({},sf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cb,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==of&&(of&&o.type==="mousemove"?(ob=o.screenX-of.screenX,ab=o.screenY-of.screenY):ab=ob=0,of=o),ob)},movementY:function(o){return"movementY"in o?o.movementY:ab}}),kC=Mr(cp),NI=g({},cp,{dataTransfer:0}),LI=Mr(NI),zI=g({},sf,{relatedTarget:0}),lb=Mr(zI),jI=g({},Fa,{animationName:0,elapsedTime:0,pseudoElement:0}),II=Mr(jI),ZI=g({},Fa,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),XI=Mr(ZI),BI=g({},Fa,{data:0}),CC=Mr(BI),UI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VI={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"},qI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function YI(o){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(o):(o=qI[o])?!!c[o]:!1}function cb(){return YI}var GI=g({},sf,{key:function(o){if(o.key){var c=UI[o.key]||o.key;if(c!=="Unidentified")return c}return o.type==="keypress"?(o=op(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?VI[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cb,charCode:function(o){return o.type==="keypress"?op(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?op(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),WI=Mr(GI),FI=g({},cp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),TC=Mr(FI),HI=g({},sf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cb}),KI=Mr(HI),JI=g({},Fa,{propertyName:0,elapsedTime:0,pseudoElement:0}),eZ=Mr(JI),tZ=g({},cp,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),nZ=Mr(tZ),rZ=g({},Fa,{newState:0,oldState:0}),iZ=Mr(rZ),sZ=[9,13,27,32],ub=ro&&"CompositionEvent"in window,af=null;ro&&"documentMode"in document&&(af=document.documentMode);var oZ=ro&&"TextEvent"in window&&!af,QC=ro&&(!ub||af&&8<af&&11>=af),EC=" ",RC=!1;function AC(o,c){switch(o){case"keyup":return sZ.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function PC(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var rc=!1;function aZ(o,c){switch(o){case"compositionend":return PC(c);case"keypress":return c.which!==32?null:(RC=!0,EC);case"textInput":return o=c.data,o===EC&&RC?null:o;default:return null}}function lZ(o,c){if(rc)return o==="compositionend"||!ub&&AC(o,c)?(o=SC(),sp=sb=Uo=null,rc=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return QC&&c.locale!=="ko"?null:c.data;default:return null}}var cZ={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 _C(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c==="input"?!!cZ[o.type]:c==="textarea"}function $C(o,c,f,p){tc?nc?nc.push(p):nc=[p]:tc=p,c=Kp(c,"onChange"),0<c.length&&(f=new lp("onChange","change",null,f,p),o.push({event:f,listeners:c}))}var lf=null,cf=null;function uZ(o){gE(o,0)}function up(o){var c=Et(o);if(pC(c))return o}function MC(o,c){if(o==="change")return c}var DC=!1;if(ro){var fb;if(ro){var db="oninput"in document;if(!db){var NC=document.createElement("div");NC.setAttribute("oninput","return;"),db=typeof NC.oninput=="function"}fb=db}else fb=!1;DC=fb&&(!document.documentMode||9<document.documentMode)}function LC(){lf&&(lf.detachEvent("onpropertychange",zC),cf=lf=null)}function zC(o){if(o.propertyName==="value"&&up(cf)){var c=[];$C(c,cf,o,nb(o)),xC(uZ,c)}}function fZ(o,c,f){o==="focusin"?(LC(),lf=c,cf=f,lf.attachEvent("onpropertychange",zC)):o==="focusout"&&LC()}function dZ(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return up(cf)}function hZ(o,c){if(o==="click")return up(c)}function pZ(o,c){if(o==="input"||o==="change")return up(c)}function gZ(o,c){return o===c&&(o!==0||1/o===1/c)||o!==o&&c!==c}var Fr=typeof Object.is=="function"?Object.is:gZ;function uf(o,c){if(Fr(o,c))return!0;if(typeof o!="object"||o===null||typeof c!="object"||c===null)return!1;var f=Object.keys(o),p=Object.keys(c);if(f.length!==p.length)return!1;for(p=0;p<f.length;p++){var y=f[p];if(!Ge.call(c,y)||!Fr(o[y],c[y]))return!1}return!0}function jC(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function IC(o,c){var f=jC(o);o=0;for(var p;f;){if(f.nodeType===3){if(p=o+f.textContent.length,o<=c&&p>=c)return{node:f,offset:c-o};o=p}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=jC(f)}}function ZC(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?ZC(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function XC(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var c=rp(o.document);c instanceof o.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)o=c.contentWindow;else break;c=rp(o.document)}return c}function hb(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}var mZ=ro&&"documentMode"in document&&11>=document.documentMode,ic=null,pb=null,ff=null,gb=!1;function BC(o,c,f){var p=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;gb||ic==null||ic!==rp(p)||(p=ic,"selectionStart"in p&&hb(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),ff&&uf(ff,p)||(ff=p,p=Kp(pb,"onSelect"),0<p.length&&(c=new lp("onSelect","select",null,c,f),o.push({event:c,listeners:p}),c.target=ic)))}function Ha(o,c){var f={};return f[o.toLowerCase()]=c.toLowerCase(),f["Webkit"+o]="webkit"+c,f["Moz"+o]="moz"+c,f}var sc={animationend:Ha("Animation","AnimationEnd"),animationiteration:Ha("Animation","AnimationIteration"),animationstart:Ha("Animation","AnimationStart"),transitionrun:Ha("Transition","TransitionRun"),transitionstart:Ha("Transition","TransitionStart"),transitioncancel:Ha("Transition","TransitionCancel"),transitionend:Ha("Transition","TransitionEnd")},mb={},UC={};ro&&(UC=document.createElement("div").style,"AnimationEvent"in window||(delete sc.animationend.animation,delete sc.animationiteration.animation,delete sc.animationstart.animation),"TransitionEvent"in window||delete sc.transitionend.transition);function Ka(o){if(mb[o])return mb[o];if(!sc[o])return o;var c=sc[o],f;for(f in c)if(c.hasOwnProperty(f)&&f in UC)return mb[o]=c[f];return o}var VC=Ka("animationend"),qC=Ka("animationiteration"),YC=Ka("animationstart"),OZ=Ka("transitionrun"),yZ=Ka("transitionstart"),bZ=Ka("transitioncancel"),GC=Ka("transitionend"),WC=new Map,Ob="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(" ");Ob.push("scrollEnd");function Wi(o,c){WC.set(o,c),$r(c,[o])}var fp=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},ki=[],oc=0,yb=0;function dp(){for(var o=oc,c=yb=oc=0;c<o;){var f=ki[c];ki[c++]=null;var p=ki[c];ki[c++]=null;var y=ki[c];ki[c++]=null;var b=ki[c];if(ki[c++]=null,p!==null&&y!==null){var T=p.pending;T===null?y.next=y:(y.next=T.next,T.next=y),p.pending=y}b!==0&&FC(f,y,b)}}function hp(o,c,f,p){ki[oc++]=o,ki[oc++]=c,ki[oc++]=f,ki[oc++]=p,yb|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function bb(o,c,f,p){return hp(o,c,f,p),pp(o)}function Ja(o,c){return hp(o,null,null,c),pp(o)}function FC(o,c,f){o.lanes|=f;var p=o.alternate;p!==null&&(p.lanes|=f);for(var y=!1,b=o.return;b!==null;)b.childLanes|=f,p=b.alternate,p!==null&&(p.childLanes|=f),b.tag===22&&(o=b.stateNode,o===null||o._visibility&1||(y=!0)),o=b,b=b.return;return o.tag===3?(b=o.stateNode,y&&c!==null&&(y=31-Xt(f),o=b.hiddenUpdates,p=o[y],p===null?o[y]=[c]:p.push(c),c.lane=f|536870912),b):null}function pp(o){if(50<$f)throw $f=0,E0=null,Error(r(185));for(var c=o.return;c!==null;)o=c,c=o.return;return o.tag===3?o.stateNode:null}var ac={};function vZ(o,c,f,p){this.tag=o,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hr(o,c,f,p){return new vZ(o,c,f,p)}function vb(o){return o=o.prototype,!(!o||!o.isReactComponent)}function io(o,c){var f=o.alternate;return f===null?(f=Hr(o.tag,c,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=c,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&65011712,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,c=o.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f.refCleanup=o.refCleanup,f}function HC(o,c){o.flags&=65011714;var f=o.alternate;return f===null?(o.childLanes=0,o.lanes=c,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=f.childLanes,o.lanes=f.lanes,o.child=f.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=f.memoizedProps,o.memoizedState=f.memoizedState,o.updateQueue=f.updateQueue,o.type=f.type,c=f.dependencies,o.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),o}function gp(o,c,f,p,y,b){var T=0;if(p=o,typeof o=="function")vb(o)&&(T=1);else if(typeof o=="string")T=CX(o,f,he.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case B:return o=Hr(31,f,c,y),o.elementType=B,o.lanes=b,o;case x:return el(f.children,y,b,c);case k:T=8,y|=24;break;case C:return o=Hr(12,f,c,y|2),o.elementType=C,o.lanes=b,o;case P:return o=Hr(13,f,c,y),o.elementType=P,o.lanes=b,o;case $:return o=Hr(19,f,c,y),o.elementType=$,o.lanes=b,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case R:T=10;break e;case Q:T=9;break e;case E:T=11;break e;case _:T=14;break e;case D:T=16,p=null;break e}T=29,f=Error(r(130,o===null?"null":typeof o,"")),p=null}return c=Hr(T,f,c,y),c.elementType=o,c.type=p,c.lanes=b,c}function el(o,c,f,p){return o=Hr(7,o,p,c),o.lanes=f,o}function xb(o,c,f){return o=Hr(6,o,null,c),o.lanes=f,o}function KC(o){var c=Hr(18,null,null,0);return c.stateNode=o,c}function Sb(o,c,f){return c=Hr(4,o.children!==null?o.children:[],o.key,c),c.lanes=f,c.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},c}var JC=new WeakMap;function Ci(o,c){if(typeof o=="object"&&o!==null){var f=JC.get(o);return f!==void 0?f:(c={value:o,source:c,stack:Ht(c)},JC.set(o,c),c)}return{value:o,source:c,stack:Ht(c)}}var lc=[],cc=0,mp=null,df=0,Ti=[],Qi=0,Vo=null,vs=1,xs="";function so(o,c){lc[cc++]=df,lc[cc++]=mp,mp=o,df=c}function eT(o,c,f){Ti[Qi++]=vs,Ti[Qi++]=xs,Ti[Qi++]=Vo,Vo=o;var p=vs;o=xs;var y=32-Xt(p)-1;p&=~(1<<y),f+=1;var b=32-Xt(c)+y;if(30<b){var T=y-y%5;b=(p&(1<<T)-1).toString(32),p>>=T,y-=T,vs=1<<32-Xt(c)+y|f<<y|p,xs=b+o}else vs=1<<b|f<<y|p,xs=o}function wb(o){o.return!==null&&(so(o,1),eT(o,1,0))}function kb(o){for(;o===mp;)mp=lc[--cc],lc[cc]=null,df=lc[--cc],lc[cc]=null;for(;o===Vo;)Vo=Ti[--Qi],Ti[Qi]=null,xs=Ti[--Qi],Ti[Qi]=null,vs=Ti[--Qi],Ti[Qi]=null}function tT(o,c){Ti[Qi++]=vs,Ti[Qi++]=xs,Ti[Qi++]=Vo,vs=c.id,xs=c.overflow,Vo=o}var Jn=null,Jt=null,ct=!1,qo=null,Ei=!1,Cb=Error(r(519));function Yo(o){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw hf(Ci(c,o)),Cb}function nT(o){var c=o.stateNode,f=o.type,p=o.memoizedProps;switch(c[ft]=o,c[mt]=p,f){case"dialog":rt("cancel",c),rt("close",c);break;case"iframe":case"object":case"embed":rt("load",c);break;case"video":case"audio":for(f=0;f<Df.length;f++)rt(Df[f],c);break;case"source":rt("error",c);break;case"img":case"image":case"link":rt("error",c),rt("load",c);break;case"details":rt("toggle",c);break;case"input":rt("invalid",c),gC(c,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":rt("invalid",c);break;case"textarea":rt("invalid",c),OC(c,p.value,p.defaultValue,p.children)}f=p.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||c.textContent===""+f||p.suppressHydrationWarning===!0||bE(c.textContent,f)?(p.popover!=null&&(rt("beforetoggle",c),rt("toggle",c)),p.onScroll!=null&&rt("scroll",c),p.onScrollEnd!=null&&rt("scrollend",c),p.onClick!=null&&(c.onclick=no),c=!0):c=!1,c||Yo(o,!0)}function rT(o){for(Jn=o.return;Jn;)switch(Jn.tag){case 5:case 31:case 13:Ei=!1;return;case 27:case 3:Ei=!0;return;default:Jn=Jn.return}}function uc(o){if(o!==Jn)return!1;if(!ct)return rT(o),ct=!0,!1;var c=o.tag,f;if((f=c!==3&&c!==27)&&((f=c===5)&&(f=o.type,f=!(f!=="form"&&f!=="button")||B0(o.type,o.memoizedProps)),f=!f),f&&Jt&&Yo(o),rT(o),c===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Jt=EE(o)}else if(c===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Jt=EE(o)}else c===27?(c=Jt,aa(o.type)?(o=G0,G0=null,Jt=o):Jt=c):Jt=Jn?Ai(o.stateNode.nextSibling):null;return!0}function tl(){Jt=Jn=null,ct=!1}function Tb(){var o=qo;return o!==null&&(zr===null?zr=o:zr.push.apply(zr,o),qo=null),o}function hf(o){qo===null?qo=[o]:qo.push(o)}var Qb=se(null),nl=null,oo=null;function Go(o,c,f){oe(Qb,c._currentValue),c._currentValue=f}function ao(o){o._currentValue=Qb.current,ge(Qb)}function Eb(o,c,f){for(;o!==null;){var p=o.alternate;if((o.childLanes&c)!==c?(o.childLanes|=c,p!==null&&(p.childLanes|=c)):p!==null&&(p.childLanes&c)!==c&&(p.childLanes|=c),o===f)break;o=o.return}}function Rb(o,c,f,p){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var b=y.dependencies;if(b!==null){var T=y.child;b=b.firstContext;e:for(;b!==null;){var A=b;b=y;for(var z=0;z<c.length;z++)if(A.context===c[z]){b.lanes|=f,A=b.alternate,A!==null&&(A.lanes|=f),Eb(b.return,f,o),p||(T=null);break e}b=A.next}}else if(y.tag===18){if(T=y.return,T===null)throw Error(r(341));T.lanes|=f,b=T.alternate,b!==null&&(b.lanes|=f),Eb(T,f,o),T=null}else T=y.child;if(T!==null)T.return=y;else for(T=y;T!==null;){if(T===o){T=null;break}if(y=T.sibling,y!==null){y.return=T.return,T=y;break}T=T.return}y=T}}function fc(o,c,f,p){o=null;for(var y=c,b=!1;y!==null;){if(!b){if((y.flags&524288)!==0)b=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var T=y.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var A=y.type;Fr(y.pendingProps.value,T.value)||(o!==null?o.push(A):o=[A])}}else if(y===Te.current){if(T=y.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o!==null?o.push(If):o=[If])}y=y.return}o!==null&&Rb(c,o,f,p),c.flags|=262144}function Op(o){for(o=o.firstContext;o!==null;){if(!Fr(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function rl(o){nl=o,oo=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function er(o){return iT(nl,o)}function yp(o,c){return nl===null&&rl(o),iT(o,c)}function iT(o,c){var f=c._currentValue;if(c={context:c,memoizedValue:f,next:null},oo===null){if(o===null)throw Error(r(308));oo=c,o.dependencies={lanes:0,firstContext:c},o.flags|=524288}else oo=oo.next=c;return f}var xZ=typeof AbortController<"u"?AbortController:function(){var o=[],c=this.signal={aborted:!1,addEventListener:function(f,p){o.push(p)}};this.abort=function(){c.aborted=!0,o.forEach(function(f){return f()})}},SZ=t.unstable_scheduleCallback,wZ=t.unstable_NormalPriority,kn={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ab(){return{controller:new xZ,data:new Map,refCount:0}}function pf(o){o.refCount--,o.refCount===0&&SZ(wZ,function(){o.controller.abort()})}var gf=null,Pb=0,dc=0,hc=null;function kZ(o,c){if(gf===null){var f=gf=[];Pb=0,dc=M0(),hc={status:"pending",value:void 0,then:function(p){f.push(p)}}}return Pb++,c.then(sT,sT),c}function sT(){if(--Pb===0&&gf!==null){hc!==null&&(hc.status="fulfilled");var o=gf;gf=null,dc=0,hc=null;for(var c=0;c<o.length;c++)(0,o[c])()}}function CZ(o,c){var f=[],p={status:"pending",value:null,reason:null,then:function(y){f.push(y)}};return o.then(function(){p.status="fulfilled",p.value=c;for(var y=0;y<f.length;y++)(0,f[y])(c)},function(y){for(p.status="rejected",p.reason=y,y=0;y<f.length;y++)(0,f[y])(void 0)}),p}var oT=N.S;N.S=function(o,c){BQ=Zt(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&kZ(o,c),oT!==null&&oT(o,c)};var il=se(null);function _b(){var o=il.current;return o!==null?o:Ut.pooledCache}function bp(o,c){c===null?oe(il,il.current):oe(il,c.pool)}function aT(){var o=_b();return o===null?null:{parent:kn._currentValue,pool:o}}var pc=Error(r(460)),$b=Error(r(474)),vp=Error(r(542)),xp={then:function(){}};function lT(o){return o=o.status,o==="fulfilled"||o==="rejected"}function cT(o,c,f){switch(f=o[f],f===void 0?o.push(c):f!==c&&(c.then(no,no),c=f),c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,fT(o),o;default:if(typeof c.status=="string")c.then(no,no);else{if(o=Ut,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=c,o.status="pending",o.then(function(p){if(c.status==="pending"){var y=c;y.status="fulfilled",y.value=p}},function(p){if(c.status==="pending"){var y=c;y.status="rejected",y.reason=p}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,fT(o),o}throw ol=c,pc}}function sl(o){try{var c=o._init;return c(o._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(ol=f,pc):f}}var ol=null;function uT(){if(ol===null)throw Error(r(459));var o=ol;return ol=null,o}function fT(o){if(o===pc||o===vp)throw Error(r(483))}var gc=null,mf=0;function Sp(o){var c=mf;return mf+=1,gc===null&&(gc=[]),cT(gc,o,c)}function Of(o,c){c=c.props.ref,o.ref=c!==void 0?c:null}function wp(o,c){throw c.$$typeof===m?Error(r(525)):(o=Object.prototype.toString.call(c),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":o)))}function dT(o){function c(q,X){if(o){var G=q.deletions;G===null?(q.deletions=[X],q.flags|=16):G.push(X)}}function f(q,X){if(!o)return null;for(;X!==null;)c(q,X),X=X.sibling;return null}function p(q){for(var X=new Map;q!==null;)q.key!==null?X.set(q.key,q):X.set(q.index,q),q=q.sibling;return X}function y(q,X){return q=io(q,X),q.index=0,q.sibling=null,q}function b(q,X,G){return q.index=G,o?(G=q.alternate,G!==null?(G=G.index,G<X?(q.flags|=67108866,X):G):(q.flags|=67108866,X)):(q.flags|=1048576,X)}function T(q){return o&&q.alternate===null&&(q.flags|=67108866),q}function A(q,X,G,ne){return X===null||X.tag!==6?(X=xb(G,q.mode,ne),X.return=q,X):(X=y(X,G),X.return=q,X)}function z(q,X,G,ne){var Pe=G.type;return Pe===x?te(q,X,G.props.children,ne,G.key):X!==null&&(X.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===D&&sl(Pe)===X.type)?(X=y(X,G.props),Of(X,G),X.return=q,X):(X=gp(G.type,G.key,G.props,null,q.mode,ne),Of(X,G),X.return=q,X)}function F(q,X,G,ne){return X===null||X.tag!==4||X.stateNode.containerInfo!==G.containerInfo||X.stateNode.implementation!==G.implementation?(X=Sb(G,q.mode,ne),X.return=q,X):(X=y(X,G.children||[]),X.return=q,X)}function te(q,X,G,ne,Pe){return X===null||X.tag!==7?(X=el(G,q.mode,ne,Pe),X.return=q,X):(X=y(X,G),X.return=q,X)}function ie(q,X,G){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=xb(""+X,q.mode,G),X.return=q,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case O:return G=gp(X.type,X.key,X.props,null,q.mode,G),Of(G,X),G.return=q,G;case v:return X=Sb(X,q.mode,G),X.return=q,X;case D:return X=sl(X),ie(q,X,G)}if(ee(X)||U(X))return X=el(X,q.mode,G,null),X.return=q,X;if(typeof X.then=="function")return ie(q,Sp(X),G);if(X.$$typeof===R)return ie(q,yp(q,X),G);wp(q,X)}return null}function K(q,X,G,ne){var Pe=X!==null?X.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return Pe!==null?null:A(q,X,""+G,ne);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case O:return G.key===Pe?z(q,X,G,ne):null;case v:return G.key===Pe?F(q,X,G,ne):null;case D:return G=sl(G),K(q,X,G,ne)}if(ee(G)||U(G))return Pe!==null?null:te(q,X,G,ne,null);if(typeof G.then=="function")return K(q,X,Sp(G),ne);if(G.$$typeof===R)return K(q,X,yp(q,G),ne);wp(q,G)}return null}function J(q,X,G,ne,Pe){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return q=q.get(G)||null,A(X,q,""+ne,Pe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case O:return q=q.get(ne.key===null?G:ne.key)||null,z(X,q,ne,Pe);case v:return q=q.get(ne.key===null?G:ne.key)||null,F(X,q,ne,Pe);case D:return ne=sl(ne),J(q,X,G,ne,Pe)}if(ee(ne)||U(ne))return q=q.get(G)||null,te(X,q,ne,Pe,null);if(typeof ne.then=="function")return J(q,X,G,Sp(ne),Pe);if(ne.$$typeof===R)return J(q,X,G,yp(X,ne),Pe);wp(X,ne)}return null}function Se(q,X,G,ne){for(var Pe=null,Ot=null,Qe=X,qe=X=0,ot=null;Qe!==null&&qe<G.length;qe++){Qe.index>qe?(ot=Qe,Qe=null):ot=Qe.sibling;var yt=K(q,Qe,G[qe],ne);if(yt===null){Qe===null&&(Qe=ot);break}o&&Qe&&yt.alternate===null&&c(q,Qe),X=b(yt,X,qe),Ot===null?Pe=yt:Ot.sibling=yt,Ot=yt,Qe=ot}if(qe===G.length)return f(q,Qe),ct&&so(q,qe),Pe;if(Qe===null){for(;qe<G.length;qe++)Qe=ie(q,G[qe],ne),Qe!==null&&(X=b(Qe,X,qe),Ot===null?Pe=Qe:Ot.sibling=Qe,Ot=Qe);return ct&&so(q,qe),Pe}for(Qe=p(Qe);qe<G.length;qe++)ot=J(Qe,q,qe,G[qe],ne),ot!==null&&(o&&ot.alternate!==null&&Qe.delete(ot.key===null?qe:ot.key),X=b(ot,X,qe),Ot===null?Pe=ot:Ot.sibling=ot,Ot=ot);return o&&Qe.forEach(function(da){return c(q,da)}),ct&&so(q,qe),Pe}function De(q,X,G,ne){if(G==null)throw Error(r(151));for(var Pe=null,Ot=null,Qe=X,qe=X=0,ot=null,yt=G.next();Qe!==null&&!yt.done;qe++,yt=G.next()){Qe.index>qe?(ot=Qe,Qe=null):ot=Qe.sibling;var da=K(q,Qe,yt.value,ne);if(da===null){Qe===null&&(Qe=ot);break}o&&Qe&&da.alternate===null&&c(q,Qe),X=b(da,X,qe),Ot===null?Pe=da:Ot.sibling=da,Ot=da,Qe=ot}if(yt.done)return f(q,Qe),ct&&so(q,qe),Pe;if(Qe===null){for(;!yt.done;qe++,yt=G.next())yt=ie(q,yt.value,ne),yt!==null&&(X=b(yt,X,qe),Ot===null?Pe=yt:Ot.sibling=yt,Ot=yt);return ct&&so(q,qe),Pe}for(Qe=p(Qe);!yt.done;qe++,yt=G.next())yt=J(Qe,q,qe,yt.value,ne),yt!==null&&(o&&yt.alternate!==null&&Qe.delete(yt.key===null?qe:yt.key),X=b(yt,X,qe),Ot===null?Pe=yt:Ot.sibling=yt,Ot=yt);return o&&Qe.forEach(function(NX){return c(q,NX)}),ct&&so(q,qe),Pe}function jt(q,X,G,ne){if(typeof G=="object"&&G!==null&&G.type===x&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case O:e:{for(var Pe=G.key;X!==null;){if(X.key===Pe){if(Pe=G.type,Pe===x){if(X.tag===7){f(q,X.sibling),ne=y(X,G.props.children),ne.return=q,q=ne;break e}}else if(X.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===D&&sl(Pe)===X.type){f(q,X.sibling),ne=y(X,G.props),Of(ne,G),ne.return=q,q=ne;break e}f(q,X);break}else c(q,X);X=X.sibling}G.type===x?(ne=el(G.props.children,q.mode,ne,G.key),ne.return=q,q=ne):(ne=gp(G.type,G.key,G.props,null,q.mode,ne),Of(ne,G),ne.return=q,q=ne)}return T(q);case v:e:{for(Pe=G.key;X!==null;){if(X.key===Pe)if(X.tag===4&&X.stateNode.containerInfo===G.containerInfo&&X.stateNode.implementation===G.implementation){f(q,X.sibling),ne=y(X,G.children||[]),ne.return=q,q=ne;break e}else{f(q,X);break}else c(q,X);X=X.sibling}ne=Sb(G,q.mode,ne),ne.return=q,q=ne}return T(q);case D:return G=sl(G),jt(q,X,G,ne)}if(ee(G))return Se(q,X,G,ne);if(U(G)){if(Pe=U(G),typeof Pe!="function")throw Error(r(150));return G=Pe.call(G),De(q,X,G,ne)}if(typeof G.then=="function")return jt(q,X,Sp(G),ne);if(G.$$typeof===R)return jt(q,X,yp(q,G),ne);wp(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,X!==null&&X.tag===6?(f(q,X.sibling),ne=y(X,G),ne.return=q,q=ne):(f(q,X),ne=xb(G,q.mode,ne),ne.return=q,q=ne),T(q)):f(q,X)}return function(q,X,G,ne){try{mf=0;var Pe=jt(q,X,G,ne);return gc=null,Pe}catch(Qe){if(Qe===pc||Qe===vp)throw Qe;var Ot=Hr(29,Qe,null,q.mode);return Ot.lanes=ne,Ot.return=q,Ot}finally{}}}var al=dT(!0),hT=dT(!1),Wo=!1;function Mb(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Db(o,c){o=o.updateQueue,c.updateQueue===o&&(c.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Fo(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Ho(o,c,f){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(St&2)!==0){var y=p.pending;return y===null?c.next=c:(c.next=y.next,y.next=c),p.pending=c,c=pp(o),FC(o,null,f),c}return hp(o,p,c,f),pp(o)}function yf(o,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194048)!==0)){var p=c.lanes;p&=o.pendingLanes,f|=p,c.lanes=f,re(o,f)}}function Nb(o,c){var f=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,f===p)){var y=null,b=null;if(f=f.firstBaseUpdate,f!==null){do{var T={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};b===null?y=b=T:b=b.next=T,f=f.next}while(f!==null);b===null?y=b=c:b=b.next=c}else y=b=c;f={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:p.shared,callbacks:p.callbacks},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=c:o.next=c,f.lastBaseUpdate=c}var Lb=!1;function bf(){if(Lb){var o=hc;if(o!==null)throw o}}function vf(o,c,f,p){Lb=!1;var y=o.updateQueue;Wo=!1;var b=y.firstBaseUpdate,T=y.lastBaseUpdate,A=y.shared.pending;if(A!==null){y.shared.pending=null;var z=A,F=z.next;z.next=null,T===null?b=F:T.next=F,T=z;var te=o.alternate;te!==null&&(te=te.updateQueue,A=te.lastBaseUpdate,A!==T&&(A===null?te.firstBaseUpdate=F:A.next=F,te.lastBaseUpdate=z))}if(b!==null){var ie=y.baseState;T=0,te=F=z=null,A=b;do{var K=A.lane&-536870913,J=K!==A.lane;if(J?(st&K)===K:(p&K)===K){K!==0&&K===dc&&(Lb=!0),te!==null&&(te=te.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var Se=o,De=A;K=c;var jt=f;switch(De.tag){case 1:if(Se=De.payload,typeof Se=="function"){ie=Se.call(jt,ie,K);break e}ie=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=De.payload,K=typeof Se=="function"?Se.call(jt,ie,K):Se,K==null)break e;ie=g({},ie,K);break e;case 2:Wo=!0}}K=A.callback,K!==null&&(o.flags|=64,J&&(o.flags|=8192),J=y.callbacks,J===null?y.callbacks=[K]:J.push(K))}else J={lane:K,tag:A.tag,payload:A.payload,callback:A.callback,next:null},te===null?(F=te=J,z=ie):te=te.next=J,T|=K;if(A=A.next,A===null){if(A=y.shared.pending,A===null)break;J=A,A=J.next,J.next=null,y.lastBaseUpdate=J,y.shared.pending=null}}while(!0);te===null&&(z=ie),y.baseState=z,y.firstBaseUpdate=F,y.lastBaseUpdate=te,b===null&&(y.shared.lanes=0),na|=T,o.lanes=T,o.memoizedState=ie}}function pT(o,c){if(typeof o!="function")throw Error(r(191,o));o.call(c)}function gT(o,c){var f=o.callbacks;if(f!==null)for(o.callbacks=null,o=0;o<f.length;o++)pT(f[o],c)}var mc=se(null),kp=se(0);function mT(o,c){o=Oo,oe(kp,o),oe(mc,c),Oo=o|c.baseLanes}function zb(){oe(kp,Oo),oe(mc,mc.current)}function jb(){Oo=kp.current,ge(mc),ge(kp)}var Kr=se(null),Ri=null;function Ko(o){var c=o.alternate;oe(On,On.current&1),oe(Kr,o),Ri===null&&(c===null||mc.current!==null||c.memoizedState!==null)&&(Ri=o)}function Ib(o){oe(On,On.current),oe(Kr,o),Ri===null&&(Ri=o)}function OT(o){o.tag===22?(oe(On,On.current),oe(Kr,o),Ri===null&&(Ri=o)):Jo()}function Jo(){oe(On,On.current),oe(Kr,Kr.current)}function Jr(o){ge(Kr),Ri===o&&(Ri=null),ge(On)}var On=se(0);function Cp(o){for(var c=o;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||q0(f)||Y0(f)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var lo=0,Ze=null,Lt=null,Cn=null,Tp=!1,Oc=!1,ll=!1,Qp=0,xf=0,yc=null,TZ=0;function un(){throw Error(r(321))}function Zb(o,c){if(c===null)return!1;for(var f=0;f<c.length&&f<o.length;f++)if(!Fr(o[f],c[f]))return!1;return!0}function Xb(o,c,f,p,y,b){return lo=b,Ze=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,N.H=o===null||o.memoizedState===null?eQ:r0,ll=!1,b=f(p,y),ll=!1,Oc&&(b=bT(c,f,p,y)),yT(o),b}function yT(o){N.H=kf;var c=Lt!==null&&Lt.next!==null;if(lo=0,Cn=Lt=Ze=null,Tp=!1,xf=0,yc=null,c)throw Error(r(300));o===null||Tn||(o=o.dependencies,o!==null&&Op(o)&&(Tn=!0))}function bT(o,c,f,p){Ze=o;var y=0;do{if(Oc&&(yc=null),xf=0,Oc=!1,25<=y)throw Error(r(301));if(y+=1,Cn=Lt=null,o.updateQueue!=null){var b=o.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}N.H=tQ,b=c(f,p)}while(Oc);return b}function QZ(){var o=N.H,c=o.useState()[0];return c=typeof c.then=="function"?Sf(c):c,o=o.useState()[0],(Lt!==null?Lt.memoizedState:null)!==o&&(Ze.flags|=1024),c}function Bb(){var o=Qp!==0;return Qp=0,o}function Ub(o,c,f){c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~f}function Vb(o){if(Tp){for(o=o.memoizedState;o!==null;){var c=o.queue;c!==null&&(c.pending=null),o=o.next}Tp=!1}lo=0,Cn=Lt=Ze=null,Oc=!1,xf=Qp=0,yc=null}function yr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cn===null?Ze.memoizedState=Cn=o:Cn=Cn.next=o,Cn}function yn(){if(Lt===null){var o=Ze.alternate;o=o!==null?o.memoizedState:null}else o=Lt.next;var c=Cn===null?Ze.memoizedState:Cn.next;if(c!==null)Cn=c,Lt=o;else{if(o===null)throw Ze.alternate===null?Error(r(467)):Error(r(310));Lt=o,o={memoizedState:Lt.memoizedState,baseState:Lt.baseState,baseQueue:Lt.baseQueue,queue:Lt.queue,next:null},Cn===null?Ze.memoizedState=Cn=o:Cn=Cn.next=o}return Cn}function Ep(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sf(o){var c=xf;return xf+=1,yc===null&&(yc=[]),o=cT(yc,o,c),c=Ze,(Cn===null?c.memoizedState:Cn.next)===null&&(c=c.alternate,N.H=c===null||c.memoizedState===null?eQ:r0),o}function Rp(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Sf(o);if(o.$$typeof===R)return er(o)}throw Error(r(438,String(o)))}function qb(o){var c=null,f=Ze.updateQueue;if(f!==null&&(c=f.memoCache),c==null){var p=Ze.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(c={data:p.data.map(function(y){return y.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),f===null&&(f=Ep(),Ze.updateQueue=f),f.memoCache=c,f=c.data[c.index],f===void 0)for(f=c.data[c.index]=Array(o),p=0;p<o;p++)f[p]=L;return c.index++,f}function co(o,c){return typeof c=="function"?c(o):c}function Ap(o){var c=yn();return Yb(c,Lt,o)}function Yb(o,c,f){var p=o.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=f;var y=o.baseQueue,b=p.pending;if(b!==null){if(y!==null){var T=y.next;y.next=b.next,b.next=T}c.baseQueue=y=b,p.pending=null}if(b=o.baseState,y===null)o.memoizedState=b;else{c=y.next;var A=T=null,z=null,F=c,te=!1;do{var ie=F.lane&-536870913;if(ie!==F.lane?(st&ie)===ie:(lo&ie)===ie){var K=F.revertLane;if(K===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ie===dc&&(te=!0);else if((lo&K)===K){F=F.next,K===dc&&(te=!0);continue}else ie={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},z===null?(A=z=ie,T=b):z=z.next=ie,Ze.lanes|=K,na|=K;ie=F.action,ll&&f(b,ie),b=F.hasEagerState?F.eagerState:f(b,ie)}else K={lane:ie,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},z===null?(A=z=K,T=b):z=z.next=K,Ze.lanes|=ie,na|=ie;F=F.next}while(F!==null&&F!==c);if(z===null?T=b:z.next=A,!Fr(b,o.memoizedState)&&(Tn=!0,te&&(f=hc,f!==null)))throw f;o.memoizedState=b,o.baseState=T,o.baseQueue=z,p.lastRenderedState=b}return y===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function Gb(o){var c=yn(),f=c.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=o;var p=f.dispatch,y=f.pending,b=c.memoizedState;if(y!==null){f.pending=null;var T=y=y.next;do b=o(b,T.action),T=T.next;while(T!==y);Fr(b,c.memoizedState)||(Tn=!0),c.memoizedState=b,c.baseQueue===null&&(c.baseState=b),f.lastRenderedState=b}return[b,p]}function vT(o,c,f){var p=Ze,y=yn(),b=ct;if(b){if(f===void 0)throw Error(r(407));f=f()}else f=c();var T=!Fr((Lt||y).memoizedState,f);if(T&&(y.memoizedState=f,Tn=!0),y=y.queue,Hb(wT.bind(null,p,y,o),[o]),y.getSnapshot!==c||T||Cn!==null&&Cn.memoizedState.tag&1){if(p.flags|=2048,bc(9,{destroy:void 0},ST.bind(null,p,y,f,c),null),Ut===null)throw Error(r(349));b||(lo&127)!==0||xT(p,c,f)}return f}function xT(o,c,f){o.flags|=16384,o={getSnapshot:c,value:f},c=Ze.updateQueue,c===null?(c=Ep(),Ze.updateQueue=c,c.stores=[o]):(f=c.stores,f===null?c.stores=[o]:f.push(o))}function ST(o,c,f,p){c.value=f,c.getSnapshot=p,kT(c)&&CT(o)}function wT(o,c,f){return f(function(){kT(c)&&CT(o)})}function kT(o){var c=o.getSnapshot;o=o.value;try{var f=c();return!Fr(o,f)}catch{return!0}}function CT(o){var c=Ja(o,2);c!==null&&jr(c,o,2)}function Wb(o){var c=yr();if(typeof o=="function"){var f=o;if(o=f(),ll){Dt(!0);try{f()}finally{Dt(!1)}}}return c.memoizedState=c.baseState=o,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:co,lastRenderedState:o},c}function TT(o,c,f,p){return o.baseState=f,Yb(o,Lt,typeof p=="function"?p:co)}function EZ(o,c,f,p,y){if($p(o))throw Error(r(485));if(o=c.action,o!==null){var b={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){b.listeners.push(T)}};N.T!==null?f(!0):b.isTransition=!1,p(b),f=c.pending,f===null?(b.next=c.pending=b,QT(c,b)):(b.next=f.next,c.pending=f.next=b)}}function QT(o,c){var f=c.action,p=c.payload,y=o.state;if(c.isTransition){var b=N.T,T={};N.T=T;try{var A=f(y,p),z=N.S;z!==null&&z(T,A),ET(o,c,A)}catch(F){Fb(o,c,F)}finally{b!==null&&T.types!==null&&(b.types=T.types),N.T=b}}else try{b=f(y,p),ET(o,c,b)}catch(F){Fb(o,c,F)}}function ET(o,c,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(p){RT(o,c,p)},function(p){return Fb(o,c,p)}):RT(o,c,f)}function RT(o,c,f){c.status="fulfilled",c.value=f,AT(c),o.state=f,c=o.pending,c!==null&&(f=c.next,f===c?o.pending=null:(f=f.next,c.next=f,QT(o,f)))}function Fb(o,c,f){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do c.status="rejected",c.reason=f,AT(c),c=c.next;while(c!==p)}o.action=null}function AT(o){o=o.listeners;for(var c=0;c<o.length;c++)(0,o[c])()}function PT(o,c){return c}function _T(o,c){if(ct){var f=Ut.formState;if(f!==null){e:{var p=Ze;if(ct){if(Jt){t:{for(var y=Jt,b=Ei;y.nodeType!==8;){if(!b){y=null;break t}if(y=Ai(y.nextSibling),y===null){y=null;break t}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){Jt=Ai(y.nextSibling),p=y.data==="F!";break e}}Yo(p)}p=!1}p&&(c=f[0])}}return f=yr(),f.memoizedState=f.baseState=c,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:PT,lastRenderedState:c},f.queue=p,f=HT.bind(null,Ze,p),p.dispatch=f,p=Wb(!1),b=n0.bind(null,Ze,!1,p.queue),p=yr(),y={state:c,dispatch:null,action:o,pending:null},p.queue=y,f=EZ.bind(null,Ze,y,b,f),y.dispatch=f,p.memoizedState=o,[c,f,!1]}function $T(o){var c=yn();return MT(c,Lt,o)}function MT(o,c,f){if(c=Yb(o,c,PT)[0],o=Ap(co)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var p=Sf(c)}catch(T){throw T===pc?vp:T}else p=c;c=yn();var y=c.queue,b=y.dispatch;return f!==c.memoizedState&&(Ze.flags|=2048,bc(9,{destroy:void 0},RZ.bind(null,y,f),null)),[p,b,o]}function RZ(o,c){o.action=c}function DT(o){var c=yn(),f=Lt;if(f!==null)return MT(c,f,o);yn(),c=c.memoizedState,f=yn();var p=f.queue.dispatch;return f.memoizedState=o,[c,p,!1]}function bc(o,c,f,p){return o={tag:o,create:f,deps:p,inst:c,next:null},c=Ze.updateQueue,c===null&&(c=Ep(),Ze.updateQueue=c),f=c.lastEffect,f===null?c.lastEffect=o.next=o:(p=f.next,f.next=o,o.next=p,c.lastEffect=o),o}function NT(){return yn().memoizedState}function Pp(o,c,f,p){var y=yr();Ze.flags|=o,y.memoizedState=bc(1|c,{destroy:void 0},f,p===void 0?null:p)}function _p(o,c,f,p){var y=yn();p=p===void 0?null:p;var b=y.memoizedState.inst;Lt!==null&&p!==null&&Zb(p,Lt.memoizedState.deps)?y.memoizedState=bc(c,b,f,p):(Ze.flags|=o,y.memoizedState=bc(1|c,b,f,p))}function LT(o,c){Pp(8390656,8,o,c)}function Hb(o,c){_p(2048,8,o,c)}function AZ(o){Ze.flags|=4;var c=Ze.updateQueue;if(c===null)c=Ep(),Ze.updateQueue=c,c.events=[o];else{var f=c.events;f===null?c.events=[o]:f.push(o)}}function zT(o){var c=yn().memoizedState;return AZ({ref:c,nextImpl:o}),function(){if((St&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function jT(o,c){return _p(4,2,o,c)}function IT(o,c){return _p(4,4,o,c)}function ZT(o,c){if(typeof c=="function"){o=o();var f=c(o);return function(){typeof f=="function"?f():c(null)}}if(c!=null)return o=o(),c.current=o,function(){c.current=null}}function XT(o,c,f){f=f!=null?f.concat([o]):null,_p(4,4,ZT.bind(null,c,o),f)}function Kb(){}function BT(o,c){var f=yn();c=c===void 0?null:c;var p=f.memoizedState;return c!==null&&Zb(c,p[1])?p[0]:(f.memoizedState=[o,c],o)}function UT(o,c){var f=yn();c=c===void 0?null:c;var p=f.memoizedState;if(c!==null&&Zb(c,p[1]))return p[0];if(p=o(),ll){Dt(!0);try{o()}finally{Dt(!1)}}return f.memoizedState=[p,c],p}function Jb(o,c,f){return f===void 0||(lo&1073741824)!==0&&(st&261930)===0?o.memoizedState=c:(o.memoizedState=f,o=VQ(),Ze.lanes|=o,na|=o,f)}function VT(o,c,f,p){return Fr(f,c)?f:mc.current!==null?(o=Jb(o,f,p),Fr(o,c)||(Tn=!0),o):(lo&42)===0||(lo&1073741824)!==0&&(st&261930)===0?(Tn=!0,o.memoizedState=f):(o=VQ(),Ze.lanes|=o,na|=o,c)}function qT(o,c,f,p,y){var b=V.p;V.p=b!==0&&8>b?b:8;var T=N.T,A={};N.T=A,n0(o,!1,c,f);try{var z=y(),F=N.S;if(F!==null&&F(A,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var te=CZ(z,p);wf(o,c,te,ni(o))}else wf(o,c,p,ni(o))}catch(ie){wf(o,c,{then:function(){},status:"rejected",reason:ie},ni())}finally{V.p=b,T!==null&&A.types!==null&&(T.types=A.types),N.T=T}}function PZ(){}function e0(o,c,f,p){if(o.tag!==5)throw Error(r(476));var y=YT(o).queue;qT(o,y,c,Z,f===null?PZ:function(){return GT(o),f(p)})}function YT(o){var c=o.memoizedState;if(c!==null)return c;c={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:co,lastRenderedState:Z},next:null};var f={};return c.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:co,lastRenderedState:f},next:null},o.memoizedState=c,o=o.alternate,o!==null&&(o.memoizedState=c),c}function GT(o){var c=YT(o);c.next===null&&(c=o.alternate.memoizedState),wf(o,c.next.queue,{},ni())}function t0(){return er(If)}function WT(){return yn().memoizedState}function FT(){return yn().memoizedState}function _Z(o){for(var c=o.return;c!==null;){switch(c.tag){case 24:case 3:var f=ni();o=Fo(f);var p=Ho(c,o,f);p!==null&&(jr(p,c,f),yf(p,c,f)),c={cache:Ab()},o.payload=c;return}c=c.return}}function $Z(o,c,f){var p=ni();f={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},$p(o)?KT(c,f):(f=bb(o,c,f,p),f!==null&&(jr(f,o,p),JT(f,c,p)))}function HT(o,c,f){var p=ni();wf(o,c,f,p)}function wf(o,c,f,p){var y={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if($p(o))KT(c,y);else{var b=o.alternate;if(o.lanes===0&&(b===null||b.lanes===0)&&(b=c.lastRenderedReducer,b!==null))try{var T=c.lastRenderedState,A=b(T,f);if(y.hasEagerState=!0,y.eagerState=A,Fr(A,T))return hp(o,c,y,0),Ut===null&&dp(),!1}catch{}finally{}if(f=bb(o,c,y,p),f!==null)return jr(f,o,p),JT(f,c,p),!0}return!1}function n0(o,c,f,p){if(p={lane:2,revertLane:M0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},$p(o)){if(c)throw Error(r(479))}else c=bb(o,f,p,2),c!==null&&jr(c,o,2)}function $p(o){var c=o.alternate;return o===Ze||c!==null&&c===Ze}function KT(o,c){Oc=Tp=!0;var f=o.pending;f===null?c.next=c:(c.next=f.next,f.next=c),o.pending=c}function JT(o,c,f){if((f&4194048)!==0){var p=c.lanes;p&=o.pendingLanes,f|=p,c.lanes=f,re(o,f)}}var kf={readContext:er,use:Rp,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useLayoutEffect:un,useInsertionEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useSyncExternalStore:un,useId:un,useHostTransitionStatus:un,useFormState:un,useActionState:un,useOptimistic:un,useMemoCache:un,useCacheRefresh:un};kf.useEffectEvent=un;var eQ={readContext:er,use:Rp,useCallback:function(o,c){return yr().memoizedState=[o,c===void 0?null:c],o},useContext:er,useEffect:LT,useImperativeHandle:function(o,c,f){f=f!=null?f.concat([o]):null,Pp(4194308,4,ZT.bind(null,c,o),f)},useLayoutEffect:function(o,c){return Pp(4194308,4,o,c)},useInsertionEffect:function(o,c){Pp(4,2,o,c)},useMemo:function(o,c){var f=yr();c=c===void 0?null:c;var p=o();if(ll){Dt(!0);try{o()}finally{Dt(!1)}}return f.memoizedState=[p,c],p},useReducer:function(o,c,f){var p=yr();if(f!==void 0){var y=f(c);if(ll){Dt(!0);try{f(c)}finally{Dt(!1)}}}else y=c;return p.memoizedState=p.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},p.queue=o,o=o.dispatch=$Z.bind(null,Ze,o),[p.memoizedState,o]},useRef:function(o){var c=yr();return o={current:o},c.memoizedState=o},useState:function(o){o=Wb(o);var c=o.queue,f=HT.bind(null,Ze,c);return c.dispatch=f,[o.memoizedState,f]},useDebugValue:Kb,useDeferredValue:function(o,c){var f=yr();return Jb(f,o,c)},useTransition:function(){var o=Wb(!1);return o=qT.bind(null,Ze,o.queue,!0,!1),yr().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,c,f){var p=Ze,y=yr();if(ct){if(f===void 0)throw Error(r(407));f=f()}else{if(f=c(),Ut===null)throw Error(r(349));(st&127)!==0||xT(p,c,f)}y.memoizedState=f;var b={value:f,getSnapshot:c};return y.queue=b,LT(wT.bind(null,p,b,o),[o]),p.flags|=2048,bc(9,{destroy:void 0},ST.bind(null,p,b,f,c),null),f},useId:function(){var o=yr(),c=Ut.identifierPrefix;if(ct){var f=xs,p=vs;f=(p&~(1<<32-Xt(p)-1)).toString(32)+f,c="_"+c+"R_"+f,f=Qp++,0<f&&(c+="H"+f.toString(32)),c+="_"}else f=TZ++,c="_"+c+"r_"+f.toString(32)+"_";return o.memoizedState=c},useHostTransitionStatus:t0,useFormState:_T,useActionState:_T,useOptimistic:function(o){var c=yr();c.memoizedState=c.baseState=o;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=f,c=n0.bind(null,Ze,!0,f),f.dispatch=c,[o,c]},useMemoCache:qb,useCacheRefresh:function(){return yr().memoizedState=_Z.bind(null,Ze)},useEffectEvent:function(o){var c=yr(),f={impl:o};return c.memoizedState=f,function(){if((St&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},r0={readContext:er,use:Rp,useCallback:BT,useContext:er,useEffect:Hb,useImperativeHandle:XT,useInsertionEffect:jT,useLayoutEffect:IT,useMemo:UT,useReducer:Ap,useRef:NT,useState:function(){return Ap(co)},useDebugValue:Kb,useDeferredValue:function(o,c){var f=yn();return VT(f,Lt.memoizedState,o,c)},useTransition:function(){var o=Ap(co)[0],c=yn().memoizedState;return[typeof o=="boolean"?o:Sf(o),c]},useSyncExternalStore:vT,useId:WT,useHostTransitionStatus:t0,useFormState:$T,useActionState:$T,useOptimistic:function(o,c){var f=yn();return TT(f,Lt,o,c)},useMemoCache:qb,useCacheRefresh:FT};r0.useEffectEvent=zT;var tQ={readContext:er,use:Rp,useCallback:BT,useContext:er,useEffect:Hb,useImperativeHandle:XT,useInsertionEffect:jT,useLayoutEffect:IT,useMemo:UT,useReducer:Gb,useRef:NT,useState:function(){return Gb(co)},useDebugValue:Kb,useDeferredValue:function(o,c){var f=yn();return Lt===null?Jb(f,o,c):VT(f,Lt.memoizedState,o,c)},useTransition:function(){var o=Gb(co)[0],c=yn().memoizedState;return[typeof o=="boolean"?o:Sf(o),c]},useSyncExternalStore:vT,useId:WT,useHostTransitionStatus:t0,useFormState:DT,useActionState:DT,useOptimistic:function(o,c){var f=yn();return Lt!==null?TT(f,Lt,o,c):(f.baseState=o,[o,f.queue.dispatch])},useMemoCache:qb,useCacheRefresh:FT};tQ.useEffectEvent=zT;function i0(o,c,f,p){c=o.memoizedState,f=f(p,c),f=f==null?c:g({},c,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var s0={enqueueSetState:function(o,c,f){o=o._reactInternals;var p=ni(),y=Fo(p);y.payload=c,f!=null&&(y.callback=f),c=Ho(o,y,p),c!==null&&(jr(c,o,p),yf(c,o,p))},enqueueReplaceState:function(o,c,f){o=o._reactInternals;var p=ni(),y=Fo(p);y.tag=1,y.payload=c,f!=null&&(y.callback=f),c=Ho(o,y,p),c!==null&&(jr(c,o,p),yf(c,o,p))},enqueueForceUpdate:function(o,c){o=o._reactInternals;var f=ni(),p=Fo(f);p.tag=2,c!=null&&(p.callback=c),c=Ho(o,p,f),c!==null&&(jr(c,o,f),yf(c,o,f))}};function nQ(o,c,f,p,y,b,T){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,b,T):c.prototype&&c.prototype.isPureReactComponent?!uf(f,p)||!uf(y,b):!0}function rQ(o,c,f,p){o=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,p),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,p),c.state!==o&&s0.enqueueReplaceState(c,c.state,null)}function cl(o,c){var f=c;if("ref"in c){f={};for(var p in c)p!=="ref"&&(f[p]=c[p])}if(o=o.defaultProps){f===c&&(f=g({},f));for(var y in o)f[y]===void 0&&(f[y]=o[y])}return f}function iQ(o){fp(o)}function sQ(o){console.error(o)}function oQ(o){fp(o)}function Mp(o,c){try{var f=o.onUncaughtError;f(c.value,{componentStack:c.stack})}catch(p){setTimeout(function(){throw p})}}function aQ(o,c,f){try{var p=o.onCaughtError;p(f.value,{componentStack:f.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function o0(o,c,f){return f=Fo(f),f.tag=3,f.payload={element:null},f.callback=function(){Mp(o,c)},f}function lQ(o){return o=Fo(o),o.tag=3,o}function cQ(o,c,f,p){var y=f.type.getDerivedStateFromError;if(typeof y=="function"){var b=p.value;o.payload=function(){return y(b)},o.callback=function(){aQ(c,f,p)}}var T=f.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(o.callback=function(){aQ(c,f,p),typeof y!="function"&&(ra===null?ra=new Set([this]):ra.add(this));var A=p.stack;this.componentDidCatch(p.value,{componentStack:A!==null?A:""})})}function MZ(o,c,f,p,y){if(f.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(c=f.alternate,c!==null&&fc(c,f,y,!0),f=Kr.current,f!==null){switch(f.tag){case 31:case 13:return Ri===null?qp():f.alternate===null&&fn===0&&(fn=3),f.flags&=-257,f.flags|=65536,f.lanes=y,p===xp?f.flags|=16384:(c=f.updateQueue,c===null?f.updateQueue=new Set([p]):c.add(p),P0(o,p,y)),!1;case 22:return f.flags|=65536,p===xp?f.flags|=16384:(c=f.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([p])},f.updateQueue=c):(f=c.retryQueue,f===null?c.retryQueue=new Set([p]):f.add(p)),P0(o,p,y)),!1}throw Error(r(435,f.tag))}return P0(o,p,y),qp(),!1}if(ct)return c=Kr.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=y,p!==Cb&&(o=Error(r(422),{cause:p}),hf(Ci(o,f)))):(p!==Cb&&(c=Error(r(423),{cause:p}),hf(Ci(c,f))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,p=Ci(p,f),y=o0(o.stateNode,p,y),Nb(o,y),fn!==4&&(fn=2)),!1;var b=Error(r(520),{cause:p});if(b=Ci(b,f),_f===null?_f=[b]:_f.push(b),fn!==4&&(fn=2),c===null)return!0;p=Ci(p,f),f=c;do{switch(f.tag){case 3:return f.flags|=65536,o=y&-y,f.lanes|=o,o=o0(f.stateNode,p,o),Nb(f,o),!1;case 1:if(c=f.type,b=f.stateNode,(f.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(ra===null||!ra.has(b))))return f.flags|=65536,y&=-y,f.lanes|=y,y=lQ(y),cQ(y,o,f,p),Nb(f,y),!1}f=f.return}while(f!==null);return!1}var a0=Error(r(461)),Tn=!1;function tr(o,c,f,p){c.child=o===null?hT(c,null,f,p):al(c,o.child,f,p)}function uQ(o,c,f,p,y){f=f.render;var b=c.ref;if("ref"in p){var T={};for(var A in p)A!=="ref"&&(T[A]=p[A])}else T=p;return rl(c),p=Xb(o,c,f,T,b,y),A=Bb(),o!==null&&!Tn?(Ub(o,c,y),uo(o,c,y)):(ct&&A&&wb(c),c.flags|=1,tr(o,c,p,y),c.child)}function fQ(o,c,f,p,y){if(o===null){var b=f.type;return typeof b=="function"&&!vb(b)&&b.defaultProps===void 0&&f.compare===null?(c.tag=15,c.type=b,dQ(o,c,b,p,y)):(o=gp(f.type,null,p,c,c.mode,y),o.ref=c.ref,o.return=c,c.child=o)}if(b=o.child,!g0(o,y)){var T=b.memoizedProps;if(f=f.compare,f=f!==null?f:uf,f(T,p)&&o.ref===c.ref)return uo(o,c,y)}return c.flags|=1,o=io(b,p),o.ref=c.ref,o.return=c,c.child=o}function dQ(o,c,f,p,y){if(o!==null){var b=o.memoizedProps;if(uf(b,p)&&o.ref===c.ref)if(Tn=!1,c.pendingProps=p=b,g0(o,y))(o.flags&131072)!==0&&(Tn=!0);else return c.lanes=o.lanes,uo(o,c,y)}return l0(o,c,f,p,y)}function hQ(o,c,f,p){var y=p.children,b=o!==null?o.memoizedState:null;if(o===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((c.flags&128)!==0){if(b=b!==null?b.baseLanes|f:f,o!==null){for(p=c.child=o.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;p=y&~b}else p=0,c.child=null;return pQ(o,c,b,f,p)}if((f&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},o!==null&&bp(c,b!==null?b.cachePool:null),b!==null?mT(c,b):zb(),OT(c);else return p=c.lanes=536870912,pQ(o,c,b!==null?b.baseLanes|f:f,f,p)}else b!==null?(bp(c,b.cachePool),mT(c,b),Jo(),c.memoizedState=null):(o!==null&&bp(c,null),zb(),Jo());return tr(o,c,y,f),c.child}function Cf(o,c){return o!==null&&o.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function pQ(o,c,f,p,y){var b=_b();return b=b===null?null:{parent:kn._currentValue,pool:b},c.memoizedState={baseLanes:f,cachePool:b},o!==null&&bp(c,null),zb(),OT(c),o!==null&&fc(o,c,p,!0),c.childLanes=y,null}function Dp(o,c){return c=Lp({mode:c.mode,children:c.children},o.mode),c.ref=o.ref,o.child=c,c.return=o,c}function gQ(o,c,f){return al(c,o.child,null,f),o=Dp(c,c.pendingProps),o.flags|=2,Jr(c),c.memoizedState=null,o}function DZ(o,c,f){var p=c.pendingProps,y=(c.flags&128)!==0;if(c.flags&=-129,o===null){if(ct){if(p.mode==="hidden")return o=Dp(c,p),c.lanes=536870912,Cf(null,o);if(Ib(c),(o=Jt)?(o=QE(o,Ei),o=o!==null&&o.data==="&"?o:null,o!==null&&(c.memoizedState={dehydrated:o,treeContext:Vo!==null?{id:vs,overflow:xs}:null,retryLane:536870912,hydrationErrors:null},f=KC(o),f.return=c,c.child=f,Jn=c,Jt=null)):o=null,o===null)throw Yo(c);return c.lanes=536870912,null}return Dp(c,p)}var b=o.memoizedState;if(b!==null){var T=b.dehydrated;if(Ib(c),y)if(c.flags&256)c.flags&=-257,c=gQ(o,c,f);else if(c.memoizedState!==null)c.child=o.child,c.flags|=128,c=null;else throw Error(r(558));else if(Tn||fc(o,c,f,!1),y=(f&o.childLanes)!==0,Tn||y){if(p=Ut,p!==null&&(T=ue(p,f),T!==0&&T!==b.retryLane))throw b.retryLane=T,Ja(o,T),jr(p,o,T),a0;qp(),c=gQ(o,c,f)}else o=b.treeContext,Jt=Ai(T.nextSibling),Jn=c,ct=!0,qo=null,Ei=!1,o!==null&&tT(c,o),c=Dp(c,p),c.flags|=4096;return c}return o=io(o.child,{mode:p.mode,children:p.children}),o.ref=c.ref,c.child=o,o.return=c,o}function Np(o,c){var f=c.ref;if(f===null)o!==null&&o.ref!==null&&(c.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(o===null||o.ref!==f)&&(c.flags|=4194816)}}function l0(o,c,f,p,y){return rl(c),f=Xb(o,c,f,p,void 0,y),p=Bb(),o!==null&&!Tn?(Ub(o,c,y),uo(o,c,y)):(ct&&p&&wb(c),c.flags|=1,tr(o,c,f,y),c.child)}function mQ(o,c,f,p,y,b){return rl(c),c.updateQueue=null,f=bT(c,p,f,y),yT(o),p=Bb(),o!==null&&!Tn?(Ub(o,c,b),uo(o,c,b)):(ct&&p&&wb(c),c.flags|=1,tr(o,c,f,b),c.child)}function OQ(o,c,f,p,y){if(rl(c),c.stateNode===null){var b=ac,T=f.contextType;typeof T=="object"&&T!==null&&(b=er(T)),b=new f(p,b),c.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=s0,c.stateNode=b,b._reactInternals=c,b=c.stateNode,b.props=p,b.state=c.memoizedState,b.refs={},Mb(c),T=f.contextType,b.context=typeof T=="object"&&T!==null?er(T):ac,b.state=c.memoizedState,T=f.getDerivedStateFromProps,typeof T=="function"&&(i0(c,f,T,p),b.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(T=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),T!==b.state&&s0.enqueueReplaceState(b,b.state,null),vf(c,p,b,y),bf(),b.state=c.memoizedState),typeof b.componentDidMount=="function"&&(c.flags|=4194308),p=!0}else if(o===null){b=c.stateNode;var A=c.memoizedProps,z=cl(f,A);b.props=z;var F=b.context,te=f.contextType;T=ac,typeof te=="object"&&te!==null&&(T=er(te));var ie=f.getDerivedStateFromProps;te=typeof ie=="function"||typeof b.getSnapshotBeforeUpdate=="function",A=c.pendingProps!==A,te||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(A||F!==T)&&rQ(c,b,p,T),Wo=!1;var K=c.memoizedState;b.state=K,vf(c,p,b,y),bf(),F=c.memoizedState,A||K!==F||Wo?(typeof ie=="function"&&(i0(c,f,ie,p),F=c.memoizedState),(z=Wo||nQ(c,f,z,p,K,F,T))?(te||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(c.flags|=4194308)):(typeof b.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=p,c.memoizedState=F),b.props=p,b.state=F,b.context=T,p=z):(typeof b.componentDidMount=="function"&&(c.flags|=4194308),p=!1)}else{b=c.stateNode,Db(o,c),T=c.memoizedProps,te=cl(f,T),b.props=te,ie=c.pendingProps,K=b.context,F=f.contextType,z=ac,typeof F=="object"&&F!==null&&(z=er(F)),A=f.getDerivedStateFromProps,(F=typeof A=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(T!==ie||K!==z)&&rQ(c,b,p,z),Wo=!1,K=c.memoizedState,b.state=K,vf(c,p,b,y),bf();var J=c.memoizedState;T!==ie||K!==J||Wo||o!==null&&o.dependencies!==null&&Op(o.dependencies)?(typeof A=="function"&&(i0(c,f,A,p),J=c.memoizedState),(te=Wo||nQ(c,f,te,p,K,J,z)||o!==null&&o.dependencies!==null&&Op(o.dependencies))?(F||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(p,J,z),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(p,J,z)),typeof b.componentDidUpdate=="function"&&(c.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof b.componentDidUpdate!="function"||T===o.memoizedProps&&K===o.memoizedState||(c.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||T===o.memoizedProps&&K===o.memoizedState||(c.flags|=1024),c.memoizedProps=p,c.memoizedState=J),b.props=p,b.state=J,b.context=z,p=te):(typeof b.componentDidUpdate!="function"||T===o.memoizedProps&&K===o.memoizedState||(c.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||T===o.memoizedProps&&K===o.memoizedState||(c.flags|=1024),p=!1)}return b=p,Np(o,c),p=(c.flags&128)!==0,b||p?(b=c.stateNode,f=p&&typeof f.getDerivedStateFromError!="function"?null:b.render(),c.flags|=1,o!==null&&p?(c.child=al(c,o.child,null,y),c.child=al(c,null,f,y)):tr(o,c,f,y),c.memoizedState=b.state,o=c.child):o=uo(o,c,y),o}function yQ(o,c,f,p){return tl(),c.flags|=256,tr(o,c,f,p),c.child}var c0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function u0(o){return{baseLanes:o,cachePool:aT()}}function f0(o,c,f){return o=o!==null?o.childLanes&~f:0,c&&(o|=ti),o}function bQ(o,c,f){var p=c.pendingProps,y=!1,b=(c.flags&128)!==0,T;if((T=b)||(T=o!==null&&o.memoizedState===null?!1:(On.current&2)!==0),T&&(y=!0,c.flags&=-129),T=(c.flags&32)!==0,c.flags&=-33,o===null){if(ct){if(y?Ko(c):Jo(),(o=Jt)?(o=QE(o,Ei),o=o!==null&&o.data!=="&"?o:null,o!==null&&(c.memoizedState={dehydrated:o,treeContext:Vo!==null?{id:vs,overflow:xs}:null,retryLane:536870912,hydrationErrors:null},f=KC(o),f.return=c,c.child=f,Jn=c,Jt=null)):o=null,o===null)throw Yo(c);return Y0(o)?c.lanes=32:c.lanes=536870912,null}var A=p.children;return p=p.fallback,y?(Jo(),y=c.mode,A=Lp({mode:"hidden",children:A},y),p=el(p,y,f,null),A.return=c,p.return=c,A.sibling=p,c.child=A,p=c.child,p.memoizedState=u0(f),p.childLanes=f0(o,T,f),c.memoizedState=c0,Cf(null,p)):(Ko(c),d0(c,A))}var z=o.memoizedState;if(z!==null&&(A=z.dehydrated,A!==null)){if(b)c.flags&256?(Ko(c),c.flags&=-257,c=h0(o,c,f)):c.memoizedState!==null?(Jo(),c.child=o.child,c.flags|=128,c=null):(Jo(),A=p.fallback,y=c.mode,p=Lp({mode:"visible",children:p.children},y),A=el(A,y,f,null),A.flags|=2,p.return=c,A.return=c,p.sibling=A,c.child=p,al(c,o.child,null,f),p=c.child,p.memoizedState=u0(f),p.childLanes=f0(o,T,f),c.memoizedState=c0,c=Cf(null,p));else if(Ko(c),Y0(A)){if(T=A.nextSibling&&A.nextSibling.dataset,T)var F=T.dgst;T=F,p=Error(r(419)),p.stack="",p.digest=T,hf({value:p,source:null,stack:null}),c=h0(o,c,f)}else if(Tn||fc(o,c,f,!1),T=(f&o.childLanes)!==0,Tn||T){if(T=Ut,T!==null&&(p=ue(T,f),p!==0&&p!==z.retryLane))throw z.retryLane=p,Ja(o,p),jr(T,o,p),a0;q0(A)||qp(),c=h0(o,c,f)}else q0(A)?(c.flags|=192,c.child=o.child,c=null):(o=z.treeContext,Jt=Ai(A.nextSibling),Jn=c,ct=!0,qo=null,Ei=!1,o!==null&&tT(c,o),c=d0(c,p.children),c.flags|=4096);return c}return y?(Jo(),A=p.fallback,y=c.mode,z=o.child,F=z.sibling,p=io(z,{mode:"hidden",children:p.children}),p.subtreeFlags=z.subtreeFlags&65011712,F!==null?A=io(F,A):(A=el(A,y,f,null),A.flags|=2),A.return=c,p.return=c,p.sibling=A,c.child=p,Cf(null,p),p=c.child,A=o.child.memoizedState,A===null?A=u0(f):(y=A.cachePool,y!==null?(z=kn._currentValue,y=y.parent!==z?{parent:z,pool:z}:y):y=aT(),A={baseLanes:A.baseLanes|f,cachePool:y}),p.memoizedState=A,p.childLanes=f0(o,T,f),c.memoizedState=c0,Cf(o.child,p)):(Ko(c),f=o.child,o=f.sibling,f=io(f,{mode:"visible",children:p.children}),f.return=c,f.sibling=null,o!==null&&(T=c.deletions,T===null?(c.deletions=[o],c.flags|=16):T.push(o)),c.child=f,c.memoizedState=null,f)}function d0(o,c){return c=Lp({mode:"visible",children:c},o.mode),c.return=o,o.child=c}function Lp(o,c){return o=Hr(22,o,null,c),o.lanes=0,o}function h0(o,c,f){return al(c,o.child,null,f),o=d0(c,c.pendingProps.children),o.flags|=2,c.memoizedState=null,o}function vQ(o,c,f){o.lanes|=c;var p=o.alternate;p!==null&&(p.lanes|=c),Eb(o.return,c,f)}function p0(o,c,f,p,y,b){var T=o.memoizedState;T===null?o.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:p,tail:f,tailMode:y,treeForkCount:b}:(T.isBackwards=c,T.rendering=null,T.renderingStartTime=0,T.last=p,T.tail=f,T.tailMode=y,T.treeForkCount=b)}function xQ(o,c,f){var p=c.pendingProps,y=p.revealOrder,b=p.tail;p=p.children;var T=On.current,A=(T&2)!==0;if(A?(T=T&1|2,c.flags|=128):T&=1,oe(On,T),tr(o,c,p,f),p=ct?df:0,!A&&o!==null&&(o.flags&128)!==0)e:for(o=c.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&vQ(o,f,c);else if(o.tag===19)vQ(o,f,c);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===c)break e;for(;o.sibling===null;){if(o.return===null||o.return===c)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(y){case"forwards":for(f=c.child,y=null;f!==null;)o=f.alternate,o!==null&&Cp(o)===null&&(y=f),f=f.sibling;f=y,f===null?(y=c.child,c.child=null):(y=f.sibling,f.sibling=null),p0(c,!1,y,f,b,p);break;case"backwards":case"unstable_legacy-backwards":for(f=null,y=c.child,c.child=null;y!==null;){if(o=y.alternate,o!==null&&Cp(o)===null){c.child=y;break}o=y.sibling,y.sibling=f,f=y,y=o}p0(c,!0,f,null,b,p);break;case"together":p0(c,!1,null,null,void 0,p);break;default:c.memoizedState=null}return c.child}function uo(o,c,f){if(o!==null&&(c.dependencies=o.dependencies),na|=c.lanes,(f&c.childLanes)===0)if(o!==null){if(fc(o,c,f,!1),(f&c.childLanes)===0)return null}else return null;if(o!==null&&c.child!==o.child)throw Error(r(153));if(c.child!==null){for(o=c.child,f=io(o,o.pendingProps),c.child=f,f.return=c;o.sibling!==null;)o=o.sibling,f=f.sibling=io(o,o.pendingProps),f.return=c;f.sibling=null}return c.child}function g0(o,c){return(o.lanes&c)!==0?!0:(o=o.dependencies,!!(o!==null&&Op(o)))}function NZ(o,c,f){switch(c.tag){case 3:Ye(c,c.stateNode.containerInfo),Go(c,kn,o.memoizedState.cache),tl();break;case 27:case 5:ze(c);break;case 4:Ye(c,c.stateNode.containerInfo);break;case 10:Go(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,Ib(c),null;break;case 13:var p=c.memoizedState;if(p!==null)return p.dehydrated!==null?(Ko(c),c.flags|=128,null):(f&c.child.childLanes)!==0?bQ(o,c,f):(Ko(c),o=uo(o,c,f),o!==null?o.sibling:null);Ko(c);break;case 19:var y=(o.flags&128)!==0;if(p=(f&c.childLanes)!==0,p||(fc(o,c,f,!1),p=(f&c.childLanes)!==0),y){if(p)return xQ(o,c,f);c.flags|=128}if(y=c.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),oe(On,On.current),p)break;return null;case 22:return c.lanes=0,hQ(o,c,f,c.pendingProps);case 24:Go(c,kn,o.memoizedState.cache)}return uo(o,c,f)}function SQ(o,c,f){if(o!==null)if(o.memoizedProps!==c.pendingProps)Tn=!0;else{if(!g0(o,f)&&(c.flags&128)===0)return Tn=!1,NZ(o,c,f);Tn=(o.flags&131072)!==0}else Tn=!1,ct&&(c.flags&1048576)!==0&&eT(c,df,c.index);switch(c.lanes=0,c.tag){case 16:e:{var p=c.pendingProps;if(o=sl(c.elementType),c.type=o,typeof o=="function")vb(o)?(p=cl(o,p),c.tag=1,c=OQ(null,c,o,p,f)):(c.tag=0,c=l0(null,c,o,p,f));else{if(o!=null){var y=o.$$typeof;if(y===E){c.tag=11,c=uQ(null,c,o,p,f);break e}else if(y===_){c.tag=14,c=fQ(null,c,o,p,f);break e}}throw c=H(o)||o,Error(r(306,c,""))}}return c;case 0:return l0(o,c,c.type,c.pendingProps,f);case 1:return p=c.type,y=cl(p,c.pendingProps),OQ(o,c,p,y,f);case 3:e:{if(Ye(c,c.stateNode.containerInfo),o===null)throw Error(r(387));p=c.pendingProps;var b=c.memoizedState;y=b.element,Db(o,c),vf(c,p,null,f);var T=c.memoizedState;if(p=T.cache,Go(c,kn,p),p!==b.cache&&Rb(c,[kn],f,!0),bf(),p=T.element,b.isDehydrated)if(b={element:p,isDehydrated:!1,cache:T.cache},c.updateQueue.baseState=b,c.memoizedState=b,c.flags&256){c=yQ(o,c,p,f);break e}else if(p!==y){y=Ci(Error(r(424)),c),hf(y),c=yQ(o,c,p,f);break e}else{switch(o=c.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Jt=Ai(o.firstChild),Jn=c,ct=!0,qo=null,Ei=!0,f=hT(c,null,p,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(tl(),p===y){c=uo(o,c,f);break e}tr(o,c,p,f)}c=c.child}return c;case 26:return Np(o,c),o===null?(f=$E(c.type,null,c.pendingProps,null))?c.memoizedState=f:ct||(f=c.type,o=c.pendingProps,p=Jp(Ce.current).createElement(f),p[ft]=c,p[mt]=o,nr(p,f,o),Ke(p),c.stateNode=p):c.memoizedState=$E(c.type,o.memoizedProps,c.pendingProps,o.memoizedState),null;case 27:return ze(c),o===null&&ct&&(p=c.stateNode=AE(c.type,c.pendingProps,Ce.current),Jn=c,Ei=!0,y=Jt,aa(c.type)?(G0=y,Jt=Ai(p.firstChild)):Jt=y),tr(o,c,c.pendingProps.children,f),Np(o,c),o===null&&(c.flags|=4194304),c.child;case 5:return o===null&&ct&&((y=p=Jt)&&(p=dX(p,c.type,c.pendingProps,Ei),p!==null?(c.stateNode=p,Jn=c,Jt=Ai(p.firstChild),Ei=!1,y=!0):y=!1),y||Yo(c)),ze(c),y=c.type,b=c.pendingProps,T=o!==null?o.memoizedProps:null,p=b.children,B0(y,b)?p=null:T!==null&&B0(y,T)&&(c.flags|=32),c.memoizedState!==null&&(y=Xb(o,c,QZ,null,null,f),If._currentValue=y),Np(o,c),tr(o,c,p,f),c.child;case 6:return o===null&&ct&&((o=f=Jt)&&(f=hX(f,c.pendingProps,Ei),f!==null?(c.stateNode=f,Jn=c,Jt=null,o=!0):o=!1),o||Yo(c)),null;case 13:return bQ(o,c,f);case 4:return Ye(c,c.stateNode.containerInfo),p=c.pendingProps,o===null?c.child=al(c,null,p,f):tr(o,c,p,f),c.child;case 11:return uQ(o,c,c.type,c.pendingProps,f);case 7:return tr(o,c,c.pendingProps,f),c.child;case 8:return tr(o,c,c.pendingProps.children,f),c.child;case 12:return tr(o,c,c.pendingProps.children,f),c.child;case 10:return p=c.pendingProps,Go(c,c.type,p.value),tr(o,c,p.children,f),c.child;case 9:return y=c.type._context,p=c.pendingProps.children,rl(c),y=er(y),p=p(y),c.flags|=1,tr(o,c,p,f),c.child;case 14:return fQ(o,c,c.type,c.pendingProps,f);case 15:return dQ(o,c,c.type,c.pendingProps,f);case 19:return xQ(o,c,f);case 31:return DZ(o,c,f);case 22:return hQ(o,c,f,c.pendingProps);case 24:return rl(c),p=er(kn),o===null?(y=_b(),y===null&&(y=Ut,b=Ab(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=f),y=b),c.memoizedState={parent:p,cache:y},Mb(c),Go(c,kn,y)):((o.lanes&f)!==0&&(Db(o,c),vf(c,null,null,f),bf()),y=o.memoizedState,b=c.memoizedState,y.parent!==p?(y={parent:p,cache:p},c.memoizedState=y,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=y),Go(c,kn,p)):(p=b.cache,Go(c,kn,p),p!==y.cache&&Rb(c,[kn],f,!0))),tr(o,c,c.pendingProps.children,f),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function fo(o){o.flags|=4}function m0(o,c,f,p,y){if((c=(o.mode&32)!==0)&&(c=!1),c){if(o.flags|=16777216,(y&335544128)===y)if(o.stateNode.complete)o.flags|=8192;else if(WQ())o.flags|=8192;else throw ol=xp,$b}else o.flags&=-16777217}function wQ(o,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!zE(c))if(WQ())o.flags|=8192;else throw ol=xp,$b}function zp(o,c){c!==null&&(o.flags|=4),o.flags&16384&&(c=o.tag!==22?Nt():536870912,o.lanes|=c,wc|=c)}function Tf(o,c){if(!ct)switch(o.tailMode){case"hidden":c=o.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?o.tail=null:f.sibling=null;break;case"collapsed":f=o.tail;for(var p=null;f!==null;)f.alternate!==null&&(p=f),f=f.sibling;p===null?c||o.tail===null?o.tail=null:o.tail.sibling=null:p.sibling=null}}function en(o){var c=o.alternate!==null&&o.alternate.child===o.child,f=0,p=0;if(c)for(var y=o.child;y!==null;)f|=y.lanes|y.childLanes,p|=y.subtreeFlags&65011712,p|=y.flags&65011712,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)f|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=p,o.childLanes=f,c}function LZ(o,c,f){var p=c.pendingProps;switch(kb(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return en(c),null;case 1:return en(c),null;case 3:return f=c.stateNode,p=null,o!==null&&(p=o.memoizedState.cache),c.memoizedState.cache!==p&&(c.flags|=2048),ao(kn),je(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(o===null||o.child===null)&&(uc(c)?fo(c):o===null||o.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Tb())),en(c),null;case 26:var y=c.type,b=c.memoizedState;return o===null?(fo(c),b!==null?(en(c),wQ(c,b)):(en(c),m0(c,y,null,p,f))):b?b!==o.memoizedState?(fo(c),en(c),wQ(c,b)):(en(c),c.flags&=-16777217):(o=o.memoizedProps,o!==p&&fo(c),en(c),m0(c,y,o,p,f)),null;case 27:if(Ct(c),f=Ce.current,y=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==p&&fo(c);else{if(!p){if(c.stateNode===null)throw Error(r(166));return en(c),null}o=he.current,uc(c)?nT(c):(o=AE(y,p,f),c.stateNode=o,fo(c))}return en(c),null;case 5:if(Ct(c),y=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==p&&fo(c);else{if(!p){if(c.stateNode===null)throw Error(r(166));return en(c),null}if(b=he.current,uc(c))nT(c);else{var T=Jp(Ce.current);switch(b){case 1:b=T.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:b=T.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":b=T.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":b=T.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":b=T.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof p.is=="string"?T.createElement("select",{is:p.is}):T.createElement("select"),p.multiple?b.multiple=!0:p.size&&(b.size=p.size);break;default:b=typeof p.is=="string"?T.createElement(y,{is:p.is}):T.createElement(y)}}b[ft]=c,b[mt]=p;e:for(T=c.child;T!==null;){if(T.tag===5||T.tag===6)b.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===c)break e;for(;T.sibling===null;){if(T.return===null||T.return===c)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}c.stateNode=b;e:switch(nr(b,y,p),y){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&fo(c)}}return en(c),m0(c,c.type,o===null?null:o.memoizedProps,c.pendingProps,f),null;case 6:if(o&&c.stateNode!=null)o.memoizedProps!==p&&fo(c);else{if(typeof p!="string"&&c.stateNode===null)throw Error(r(166));if(o=Ce.current,uc(c)){if(o=c.stateNode,f=c.memoizedProps,p=null,y=Jn,y!==null)switch(y.tag){case 27:case 5:p=y.memoizedProps}o[ft]=c,o=!!(o.nodeValue===f||p!==null&&p.suppressHydrationWarning===!0||bE(o.nodeValue,f)),o||Yo(c,!0)}else o=Jp(o).createTextNode(p),o[ft]=c,c.stateNode=o}return en(c),null;case 31:if(f=c.memoizedState,o===null||o.memoizedState!==null){if(p=uc(c),f!==null){if(o===null){if(!p)throw Error(r(318));if(o=c.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[ft]=c}else tl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;en(c),o=!1}else f=Tb(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=f),o=!0;if(!o)return c.flags&256?(Jr(c),c):(Jr(c),null);if((c.flags&128)!==0)throw Error(r(558))}return en(c),null;case 13:if(p=c.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=uc(c),p!==null&&p.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=c.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[ft]=c}else tl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;en(c),y=!1}else y=Tb(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return c.flags&256?(Jr(c),c):(Jr(c),null)}return Jr(c),(c.flags&128)!==0?(c.lanes=f,c):(f=p!==null,o=o!==null&&o.memoizedState!==null,f&&(p=c.child,y=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(y=p.alternate.memoizedState.cachePool.pool),b=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(b=p.memoizedState.cachePool.pool),b!==y&&(p.flags|=2048)),f!==o&&f&&(c.child.flags|=8192),zp(c,c.updateQueue),en(c),null);case 4:return je(),o===null&&z0(c.stateNode.containerInfo),en(c),null;case 10:return ao(c.type),en(c),null;case 19:if(ge(On),p=c.memoizedState,p===null)return en(c),null;if(y=(c.flags&128)!==0,b=p.rendering,b===null)if(y)Tf(p,!1);else{if(fn!==0||o!==null&&(o.flags&128)!==0)for(o=c.child;o!==null;){if(b=Cp(o),b!==null){for(c.flags|=128,Tf(p,!1),o=b.updateQueue,c.updateQueue=o,zp(c,o),c.subtreeFlags=0,o=f,f=c.child;f!==null;)HC(f,o),f=f.sibling;return oe(On,On.current&1|2),ct&&so(c,p.treeForkCount),c.child}o=o.sibling}p.tail!==null&&Zt()>Bp&&(c.flags|=128,y=!0,Tf(p,!1),c.lanes=4194304)}else{if(!y)if(o=Cp(b),o!==null){if(c.flags|=128,y=!0,o=o.updateQueue,c.updateQueue=o,zp(c,o),Tf(p,!0),p.tail===null&&p.tailMode==="hidden"&&!b.alternate&&!ct)return en(c),null}else 2*Zt()-p.renderingStartTime>Bp&&f!==536870912&&(c.flags|=128,y=!0,Tf(p,!1),c.lanes=4194304);p.isBackwards?(b.sibling=c.child,c.child=b):(o=p.last,o!==null?o.sibling=b:c.child=b,p.last=b)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=Zt(),o.sibling=null,f=On.current,oe(On,y?f&1|2:f&1),ct&&so(c,p.treeForkCount),o):(en(c),null);case 22:case 23:return Jr(c),jb(),p=c.memoizedState!==null,o!==null?o.memoizedState!==null!==p&&(c.flags|=8192):p&&(c.flags|=8192),p?(f&536870912)!==0&&(c.flags&128)===0&&(en(c),c.subtreeFlags&6&&(c.flags|=8192)):en(c),f=c.updateQueue,f!==null&&zp(c,f.retryQueue),f=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),p=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),p!==f&&(c.flags|=2048),o!==null&&ge(il),null;case 24:return f=null,o!==null&&(f=o.memoizedState.cache),c.memoizedState.cache!==f&&(c.flags|=2048),ao(kn),en(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function zZ(o,c){switch(kb(c),c.tag){case 1:return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return ao(kn),je(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 26:case 27:case 5:return Ct(c),null;case 31:if(c.memoizedState!==null){if(Jr(c),c.alternate===null)throw Error(r(340));tl()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 13:if(Jr(c),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(r(340));tl()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return ge(On),null;case 4:return je(),null;case 10:return ao(c.type),null;case 22:case 23:return Jr(c),jb(),o!==null&&ge(il),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 24:return ao(kn),null;case 25:return null;default:return null}}function kQ(o,c){switch(kb(c),c.tag){case 3:ao(kn),je();break;case 26:case 27:case 5:Ct(c);break;case 4:je();break;case 31:c.memoizedState!==null&&Jr(c);break;case 13:Jr(c);break;case 19:ge(On);break;case 10:ao(c.type);break;case 22:case 23:Jr(c),jb(),o!==null&&ge(il);break;case 24:ao(kn)}}function Qf(o,c){try{var f=c.updateQueue,p=f!==null?f.lastEffect:null;if(p!==null){var y=p.next;f=y;do{if((f.tag&o)===o){p=void 0;var b=f.create,T=f.inst;p=b(),T.destroy=p}f=f.next}while(f!==y)}}catch(A){$t(c,c.return,A)}}function ea(o,c,f){try{var p=c.updateQueue,y=p!==null?p.lastEffect:null;if(y!==null){var b=y.next;p=b;do{if((p.tag&o)===o){var T=p.inst,A=T.destroy;if(A!==void 0){T.destroy=void 0,y=c;var z=f,F=A;try{F()}catch(te){$t(y,z,te)}}}p=p.next}while(p!==b)}}catch(te){$t(c,c.return,te)}}function CQ(o){var c=o.updateQueue;if(c!==null){var f=o.stateNode;try{gT(c,f)}catch(p){$t(o,o.return,p)}}}function TQ(o,c,f){f.props=cl(o.type,o.memoizedProps),f.state=o.memoizedState;try{f.componentWillUnmount()}catch(p){$t(o,c,p)}}function Ef(o,c){try{var f=o.ref;if(f!==null){switch(o.tag){case 26:case 27:case 5:var p=o.stateNode;break;case 30:p=o.stateNode;break;default:p=o.stateNode}typeof f=="function"?o.refCleanup=f(p):f.current=p}}catch(y){$t(o,c,y)}}function Ss(o,c){var f=o.ref,p=o.refCleanup;if(f!==null)if(typeof p=="function")try{p()}catch(y){$t(o,c,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(y){$t(o,c,y)}else f.current=null}function QQ(o){var c=o.type,f=o.memoizedProps,p=o.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":f.autoFocus&&p.focus();break e;case"img":f.src?p.src=f.src:f.srcSet&&(p.srcset=f.srcSet)}}catch(y){$t(o,o.return,y)}}function O0(o,c,f){try{var p=o.stateNode;oX(p,o.type,f,c),p[mt]=c}catch(y){$t(o,o.return,y)}}function EQ(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&aa(o.type)||o.tag===4}function y0(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||EQ(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&aa(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function b0(o,c,f){var p=o.tag;if(p===5||p===6)o=o.stateNode,c?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(o,c):(c=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,c.appendChild(o),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=no));else if(p!==4&&(p===27&&aa(o.type)&&(f=o.stateNode,c=null),o=o.child,o!==null))for(b0(o,c,f),o=o.sibling;o!==null;)b0(o,c,f),o=o.sibling}function jp(o,c,f){var p=o.tag;if(p===5||p===6)o=o.stateNode,c?f.insertBefore(o,c):f.appendChild(o);else if(p!==4&&(p===27&&aa(o.type)&&(f=o.stateNode),o=o.child,o!==null))for(jp(o,c,f),o=o.sibling;o!==null;)jp(o,c,f),o=o.sibling}function RQ(o){var c=o.stateNode,f=o.memoizedProps;try{for(var p=o.type,y=c.attributes;y.length;)c.removeAttributeNode(y[0]);nr(c,p,f),c[ft]=o,c[mt]=f}catch(b){$t(o,o.return,b)}}var ho=!1,Qn=!1,v0=!1,AQ=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function jZ(o,c){if(o=o.containerInfo,Z0=og,o=XC(o),hb(o)){if("selectionStart"in o)var f={start:o.selectionStart,end:o.selectionEnd};else e:{f=(f=o.ownerDocument)&&f.defaultView||window;var p=f.getSelection&&f.getSelection();if(p&&p.rangeCount!==0){f=p.anchorNode;var y=p.anchorOffset,b=p.focusNode;p=p.focusOffset;try{f.nodeType,b.nodeType}catch{f=null;break e}var T=0,A=-1,z=-1,F=0,te=0,ie=o,K=null;t:for(;;){for(var J;ie!==f||y!==0&&ie.nodeType!==3||(A=T+y),ie!==b||p!==0&&ie.nodeType!==3||(z=T+p),ie.nodeType===3&&(T+=ie.nodeValue.length),(J=ie.firstChild)!==null;)K=ie,ie=J;for(;;){if(ie===o)break t;if(K===f&&++F===y&&(A=T),K===b&&++te===p&&(z=T),(J=ie.nextSibling)!==null)break;ie=K,K=ie.parentNode}ie=J}f=A===-1||z===-1?null:{start:A,end:z}}else f=null}f=f||{start:0,end:0}}else f=null;for(X0={focusedElem:o,selectionRange:f},og=!1,Xn=c;Xn!==null;)if(c=Xn,o=c.child,(c.subtreeFlags&1028)!==0&&o!==null)o.return=c,Xn=o;else for(;Xn!==null;){switch(c=Xn,b=c.alternate,o=c.flags,c.tag){case 0:if((o&4)!==0&&(o=c.updateQueue,o=o!==null?o.events:null,o!==null))for(f=0;f<o.length;f++)y=o[f],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&b!==null){o=void 0,f=c,y=b.memoizedProps,b=b.memoizedState,p=f.stateNode;try{var Se=cl(f.type,y);o=p.getSnapshotBeforeUpdate(Se,b),p.__reactInternalSnapshotBeforeUpdate=o}catch(De){$t(f,f.return,De)}}break;case 3:if((o&1024)!==0){if(o=c.stateNode.containerInfo,f=o.nodeType,f===9)V0(o);else if(f===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":V0(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=c.sibling,o!==null){o.return=c.return,Xn=o;break}Xn=c.return}}function PQ(o,c,f){var p=f.flags;switch(f.tag){case 0:case 11:case 15:go(o,f),p&4&&Qf(5,f);break;case 1:if(go(o,f),p&4)if(o=f.stateNode,c===null)try{o.componentDidMount()}catch(T){$t(f,f.return,T)}else{var y=cl(f.type,c.memoizedProps);c=c.memoizedState;try{o.componentDidUpdate(y,c,o.__reactInternalSnapshotBeforeUpdate)}catch(T){$t(f,f.return,T)}}p&64&&CQ(f),p&512&&Ef(f,f.return);break;case 3:if(go(o,f),p&64&&(o=f.updateQueue,o!==null)){if(c=null,f.child!==null)switch(f.child.tag){case 27:case 5:c=f.child.stateNode;break;case 1:c=f.child.stateNode}try{gT(o,c)}catch(T){$t(f,f.return,T)}}break;case 27:c===null&&p&4&&RQ(f);case 26:case 5:go(o,f),c===null&&p&4&&QQ(f),p&512&&Ef(f,f.return);break;case 12:go(o,f);break;case 31:go(o,f),p&4&&MQ(o,f);break;case 13:go(o,f),p&4&&DQ(o,f),p&64&&(o=f.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(f=GZ.bind(null,f),pX(o,f))));break;case 22:if(p=f.memoizedState!==null||ho,!p){c=c!==null&&c.memoizedState!==null||Qn,y=ho;var b=Qn;ho=p,(Qn=c)&&!b?mo(o,f,(f.subtreeFlags&8772)!==0):go(o,f),ho=y,Qn=b}break;case 30:break;default:go(o,f)}}function _Q(o){var c=o.alternate;c!==null&&(o.alternate=null,_Q(c)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(c=o.stateNode,c!==null&&I(c)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var nn=null,Dr=!1;function po(o,c,f){for(f=f.child;f!==null;)$Q(o,c,f),f=f.sibling}function $Q(o,c,f){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(Hn,f)}catch{}switch(f.tag){case 26:Qn||Ss(f,c),po(o,c,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:Qn||Ss(f,c);var p=nn,y=Dr;aa(f.type)&&(nn=f.stateNode,Dr=!1),po(o,c,f),Lf(f.stateNode),nn=p,Dr=y;break;case 5:Qn||Ss(f,c);case 6:if(p=nn,y=Dr,nn=null,po(o,c,f),nn=p,Dr=y,nn!==null)if(Dr)try{(nn.nodeType===9?nn.body:nn.nodeName==="HTML"?nn.ownerDocument.body:nn).removeChild(f.stateNode)}catch(b){$t(f,c,b)}else try{nn.removeChild(f.stateNode)}catch(b){$t(f,c,b)}break;case 18:nn!==null&&(Dr?(o=nn,CE(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,f.stateNode),Pc(o)):CE(nn,f.stateNode));break;case 4:p=nn,y=Dr,nn=f.stateNode.containerInfo,Dr=!0,po(o,c,f),nn=p,Dr=y;break;case 0:case 11:case 14:case 15:ea(2,f,c),Qn||ea(4,f,c),po(o,c,f);break;case 1:Qn||(Ss(f,c),p=f.stateNode,typeof p.componentWillUnmount=="function"&&TQ(f,c,p)),po(o,c,f);break;case 21:po(o,c,f);break;case 22:Qn=(p=Qn)||f.memoizedState!==null,po(o,c,f),Qn=p;break;default:po(o,c,f)}}function MQ(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Pc(o)}catch(f){$t(c,c.return,f)}}}function DQ(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Pc(o)}catch(f){$t(c,c.return,f)}}function IZ(o){switch(o.tag){case 31:case 13:case 19:var c=o.stateNode;return c===null&&(c=o.stateNode=new AQ),c;case 22:return o=o.stateNode,c=o._retryCache,c===null&&(c=o._retryCache=new AQ),c;default:throw Error(r(435,o.tag))}}function Ip(o,c){var f=IZ(o);c.forEach(function(p){if(!f.has(p)){f.add(p);var y=WZ.bind(null,o,p);p.then(y,y)}})}function Nr(o,c){var f=c.deletions;if(f!==null)for(var p=0;p<f.length;p++){var y=f[p],b=o,T=c,A=T;e:for(;A!==null;){switch(A.tag){case 27:if(aa(A.type)){nn=A.stateNode,Dr=!1;break e}break;case 5:nn=A.stateNode,Dr=!1;break e;case 3:case 4:nn=A.stateNode.containerInfo,Dr=!0;break e}A=A.return}if(nn===null)throw Error(r(160));$Q(b,T,y),nn=null,Dr=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)NQ(c,o),c=c.sibling}var Fi=null;function NQ(o,c){var f=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Nr(c,o),Lr(o),p&4&&(ea(3,o,o.return),Qf(3,o),ea(5,o,o.return));break;case 1:Nr(c,o),Lr(o),p&512&&(Qn||f===null||Ss(f,f.return)),p&64&&ho&&(o=o.updateQueue,o!==null&&(p=o.callbacks,p!==null&&(f=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=f===null?p:f.concat(p))));break;case 26:var y=Fi;if(Nr(c,o),Lr(o),p&512&&(Qn||f===null||Ss(f,f.return)),p&4){var b=f!==null?f.memoizedState:null;if(p=o.memoizedState,f===null)if(p===null)if(o.stateNode===null){e:{p=o.type,f=o.memoizedProps,y=y.ownerDocument||y;t:switch(p){case"title":b=y.getElementsByTagName("title")[0],(!b||b[ye]||b[ft]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(p),y.head.insertBefore(b,y.querySelector("head > title"))),nr(b,p,f),b[ft]=o,Ke(b),p=b;break e;case"link":var T=NE("link","href",y).get(p+(f.href||""));if(T){for(var A=0;A<T.length;A++)if(b=T[A],b.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&b.getAttribute("rel")===(f.rel==null?null:f.rel)&&b.getAttribute("title")===(f.title==null?null:f.title)&&b.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){T.splice(A,1);break t}}b=y.createElement(p),nr(b,p,f),y.head.appendChild(b);break;case"meta":if(T=NE("meta","content",y).get(p+(f.content||""))){for(A=0;A<T.length;A++)if(b=T[A],b.getAttribute("content")===(f.content==null?null:""+f.content)&&b.getAttribute("name")===(f.name==null?null:f.name)&&b.getAttribute("property")===(f.property==null?null:f.property)&&b.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&b.getAttribute("charset")===(f.charSet==null?null:f.charSet)){T.splice(A,1);break t}}b=y.createElement(p),nr(b,p,f),y.head.appendChild(b);break;default:throw Error(r(468,p))}b[ft]=o,Ke(b),p=b}o.stateNode=p}else LE(y,o.type,o.stateNode);else o.stateNode=DE(y,p,o.memoizedProps);else b!==p?(b===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):b.count--,p===null?LE(y,o.type,o.stateNode):DE(y,p,o.memoizedProps)):p===null&&o.stateNode!==null&&O0(o,o.memoizedProps,f.memoizedProps)}break;case 27:Nr(c,o),Lr(o),p&512&&(Qn||f===null||Ss(f,f.return)),f!==null&&p&4&&O0(o,o.memoizedProps,f.memoizedProps);break;case 5:if(Nr(c,o),Lr(o),p&512&&(Qn||f===null||Ss(f,f.return)),o.flags&32){y=o.stateNode;try{ec(y,"")}catch(Se){$t(o,o.return,Se)}}p&4&&o.stateNode!=null&&(y=o.memoizedProps,O0(o,y,f!==null?f.memoizedProps:y)),p&1024&&(v0=!0);break;case 6:if(Nr(c,o),Lr(o),p&4){if(o.stateNode===null)throw Error(r(162));p=o.memoizedProps,f=o.stateNode;try{f.nodeValue=p}catch(Se){$t(o,o.return,Se)}}break;case 3:if(ng=null,y=Fi,Fi=eg(c.containerInfo),Nr(c,o),Fi=y,Lr(o),p&4&&f!==null&&f.memoizedState.isDehydrated)try{Pc(c.containerInfo)}catch(Se){$t(o,o.return,Se)}v0&&(v0=!1,LQ(o));break;case 4:p=Fi,Fi=eg(o.stateNode.containerInfo),Nr(c,o),Lr(o),Fi=p;break;case 12:Nr(c,o),Lr(o);break;case 31:Nr(c,o),Lr(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Ip(o,p)));break;case 13:Nr(c,o),Lr(o),o.child.flags&8192&&o.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(Xp=Zt()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Ip(o,p)));break;case 22:y=o.memoizedState!==null;var z=f!==null&&f.memoizedState!==null,F=ho,te=Qn;if(ho=F||y,Qn=te||z,Nr(c,o),Qn=te,ho=F,Lr(o),p&8192)e:for(c=o.stateNode,c._visibility=y?c._visibility&-2:c._visibility|1,y&&(f===null||z||ho||Qn||ul(o)),f=null,c=o;;){if(c.tag===5||c.tag===26){if(f===null){z=f=c;try{if(b=z.stateNode,y)T=b.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{A=z.stateNode;var ie=z.memoizedProps.style,K=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;A.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(Se){$t(z,z.return,Se)}}}else if(c.tag===6){if(f===null){z=c;try{z.stateNode.nodeValue=y?"":z.memoizedProps}catch(Se){$t(z,z.return,Se)}}}else if(c.tag===18){if(f===null){z=c;try{var J=z.stateNode;y?TE(J,!0):TE(z.stateNode,!1)}catch(Se){$t(z,z.return,Se)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===o)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break e;for(;c.sibling===null;){if(c.return===null||c.return===o)break e;f===c&&(f=null),c=c.return}f===c&&(f=null),c.sibling.return=c.return,c=c.sibling}p&4&&(p=o.updateQueue,p!==null&&(f=p.retryQueue,f!==null&&(p.retryQueue=null,Ip(o,f))));break;case 19:Nr(c,o),Lr(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Ip(o,p)));break;case 30:break;case 21:break;default:Nr(c,o),Lr(o)}}function Lr(o){var c=o.flags;if(c&2){try{for(var f,p=o.return;p!==null;){if(EQ(p)){f=p;break}p=p.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var y=f.stateNode,b=y0(o);jp(o,b,y);break;case 5:var T=f.stateNode;f.flags&32&&(ec(T,""),f.flags&=-33);var A=y0(o);jp(o,A,T);break;case 3:case 4:var z=f.stateNode.containerInfo,F=y0(o);b0(o,F,z);break;default:throw Error(r(161))}}catch(te){$t(o,o.return,te)}o.flags&=-3}c&4096&&(o.flags&=-4097)}function LQ(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var c=o;LQ(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),o=o.sibling}}function go(o,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)PQ(o,c.alternate,c),c=c.sibling}function ul(o){for(o=o.child;o!==null;){var c=o;switch(c.tag){case 0:case 11:case 14:case 15:ea(4,c,c.return),ul(c);break;case 1:Ss(c,c.return);var f=c.stateNode;typeof f.componentWillUnmount=="function"&&TQ(c,c.return,f),ul(c);break;case 27:Lf(c.stateNode);case 26:case 5:Ss(c,c.return),ul(c);break;case 22:c.memoizedState===null&&ul(c);break;case 30:ul(c);break;default:ul(c)}o=o.sibling}}function mo(o,c,f){for(f=f&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var p=c.alternate,y=o,b=c,T=b.flags;switch(b.tag){case 0:case 11:case 15:mo(y,b,f),Qf(4,b);break;case 1:if(mo(y,b,f),p=b,y=p.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(F){$t(p,p.return,F)}if(p=b,y=p.updateQueue,y!==null){var A=p.stateNode;try{var z=y.shared.hiddenCallbacks;if(z!==null)for(y.shared.hiddenCallbacks=null,y=0;y<z.length;y++)pT(z[y],A)}catch(F){$t(p,p.return,F)}}f&&T&64&&CQ(b),Ef(b,b.return);break;case 27:RQ(b);case 26:case 5:mo(y,b,f),f&&p===null&&T&4&&QQ(b),Ef(b,b.return);break;case 12:mo(y,b,f);break;case 31:mo(y,b,f),f&&T&4&&MQ(y,b);break;case 13:mo(y,b,f),f&&T&4&&DQ(y,b);break;case 22:b.memoizedState===null&&mo(y,b,f),Ef(b,b.return);break;case 30:break;default:mo(y,b,f)}c=c.sibling}}function x0(o,c){var f=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),o=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(o=c.memoizedState.cachePool.pool),o!==f&&(o!=null&&o.refCount++,f!=null&&pf(f))}function S0(o,c){o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&pf(o))}function Hi(o,c,f,p){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)zQ(o,c,f,p),c=c.sibling}function zQ(o,c,f,p){var y=c.flags;switch(c.tag){case 0:case 11:case 15:Hi(o,c,f,p),y&2048&&Qf(9,c);break;case 1:Hi(o,c,f,p);break;case 3:Hi(o,c,f,p),y&2048&&(o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&pf(o)));break;case 12:if(y&2048){Hi(o,c,f,p),o=c.stateNode;try{var b=c.memoizedProps,T=b.id,A=b.onPostCommit;typeof A=="function"&&A(T,c.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(z){$t(c,c.return,z)}}else Hi(o,c,f,p);break;case 31:Hi(o,c,f,p);break;case 13:Hi(o,c,f,p);break;case 23:break;case 22:b=c.stateNode,T=c.alternate,c.memoizedState!==null?b._visibility&2?Hi(o,c,f,p):Rf(o,c):b._visibility&2?Hi(o,c,f,p):(b._visibility|=2,vc(o,c,f,p,(c.subtreeFlags&10256)!==0||!1)),y&2048&&x0(T,c);break;case 24:Hi(o,c,f,p),y&2048&&S0(c.alternate,c);break;default:Hi(o,c,f,p)}}function vc(o,c,f,p,y){for(y=y&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var b=o,T=c,A=f,z=p,F=T.flags;switch(T.tag){case 0:case 11:case 15:vc(b,T,A,z,y),Qf(8,T);break;case 23:break;case 22:var te=T.stateNode;T.memoizedState!==null?te._visibility&2?vc(b,T,A,z,y):Rf(b,T):(te._visibility|=2,vc(b,T,A,z,y)),y&&F&2048&&x0(T.alternate,T);break;case 24:vc(b,T,A,z,y),y&&F&2048&&S0(T.alternate,T);break;default:vc(b,T,A,z,y)}c=c.sibling}}function Rf(o,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var f=o,p=c,y=p.flags;switch(p.tag){case 22:Rf(f,p),y&2048&&x0(p.alternate,p);break;case 24:Rf(f,p),y&2048&&S0(p.alternate,p);break;default:Rf(f,p)}c=c.sibling}}var Af=8192;function xc(o,c,f){if(o.subtreeFlags&Af)for(o=o.child;o!==null;)jQ(o,c,f),o=o.sibling}function jQ(o,c,f){switch(o.tag){case 26:xc(o,c,f),o.flags&Af&&o.memoizedState!==null&&TX(f,Fi,o.memoizedState,o.memoizedProps);break;case 5:xc(o,c,f);break;case 3:case 4:var p=Fi;Fi=eg(o.stateNode.containerInfo),xc(o,c,f),Fi=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=Af,Af=16777216,xc(o,c,f),Af=p):xc(o,c,f));break;default:xc(o,c,f)}}function IQ(o){var c=o.alternate;if(c!==null&&(o=c.child,o!==null)){c.child=null;do c=o.sibling,o.sibling=null,o=c;while(o!==null)}}function Pf(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var f=0;f<c.length;f++){var p=c[f];Xn=p,XQ(p,o)}IQ(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)ZQ(o),o=o.sibling}function ZQ(o){switch(o.tag){case 0:case 11:case 15:Pf(o),o.flags&2048&&ea(9,o,o.return);break;case 3:Pf(o);break;case 12:Pf(o);break;case 22:var c=o.stateNode;o.memoizedState!==null&&c._visibility&2&&(o.return===null||o.return.tag!==13)?(c._visibility&=-3,Zp(o)):Pf(o);break;default:Pf(o)}}function Zp(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var f=0;f<c.length;f++){var p=c[f];Xn=p,XQ(p,o)}IQ(o)}for(o=o.child;o!==null;){switch(c=o,c.tag){case 0:case 11:case 15:ea(8,c,c.return),Zp(c);break;case 22:f=c.stateNode,f._visibility&2&&(f._visibility&=-3,Zp(c));break;default:Zp(c)}o=o.sibling}}function XQ(o,c){for(;Xn!==null;){var f=Xn;switch(f.tag){case 0:case 11:case 15:ea(8,f,c);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var p=f.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:pf(f.memoizedState.cache)}if(p=f.child,p!==null)p.return=f,Xn=p;else e:for(f=o;Xn!==null;){p=Xn;var y=p.sibling,b=p.return;if(_Q(p),p===f){Xn=null;break e}if(y!==null){y.return=b,Xn=y;break e}Xn=b}}}var ZZ={getCacheForType:function(o){var c=er(kn),f=c.data.get(o);return f===void 0&&(f=o(),c.data.set(o,f)),f},cacheSignal:function(){return er(kn).controller.signal}},XZ=typeof WeakMap=="function"?WeakMap:Map,St=0,Ut=null,nt=null,st=0,_t=0,ei=null,ta=!1,Sc=!1,w0=!1,Oo=0,fn=0,na=0,fl=0,k0=0,ti=0,wc=0,_f=null,zr=null,C0=!1,Xp=0,BQ=0,Bp=1/0,Up=null,ra=null,$n=0,ia=null,kc=null,yo=0,T0=0,Q0=null,UQ=null,$f=0,E0=null;function ni(){return(St&2)!==0&&st!==0?st&-st:N.T!==null?M0():vt()}function VQ(){if(ti===0)if((st&536870912)===0||ct){var o=mr;mr<<=1,(mr&3932160)===0&&(mr=262144),ti=o}else ti=536870912;return o=Kr.current,o!==null&&(o.flags|=32),ti}function jr(o,c,f){(o===Ut&&(_t===2||_t===9)||o.cancelPendingCommit!==null)&&(Cc(o,0),sa(o,st,ti,!1)),ae(o,f),((St&2)===0||o!==Ut)&&(o===Ut&&((St&2)===0&&(fl|=f),fn===4&&sa(o,st,ti,!1)),ws(o))}function qQ(o,c,f){if((St&6)!==0)throw Error(r(327));var p=!f&&(c&127)===0&&(c&o.expiredLanes)===0||wn(o,c),y=p?VZ(o,c):A0(o,c,!0),b=p;do{if(y===0){Sc&&!p&&sa(o,c,0,!1);break}else{if(f=o.current.alternate,b&&!BZ(f)){y=A0(o,c,!1),b=!1;continue}if(y===2){if(b=c,o.errorRecoveryDisabledLanes&b)var T=0;else T=o.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){c=T;e:{var A=o;y=_f;var z=A.current.memoizedState.isDehydrated;if(z&&(Cc(A,T).flags|=256),T=A0(A,T,!1),T!==2){if(w0&&!z){A.errorRecoveryDisabledLanes|=b,fl|=b,y=4;break e}b=zr,zr=y,b!==null&&(zr===null?zr=b:zr.push.apply(zr,b))}y=T}if(b=!1,y!==2)continue}}if(y===1){Cc(o,0),sa(o,c,0,!0);break}e:{switch(p=o,b=y,b){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:sa(p,c,ti,!ta);break e;case 2:zr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(y=Xp+300-Zt(),10<y)){if(sa(p,c,ti,!ta),Kt(p,0,!0)!==0)break e;yo=c,p.timeoutHandle=wE(YQ.bind(null,p,f,zr,Up,C0,c,ti,fl,wc,ta,b,"Throttled",-0,0),y);break e}YQ(p,f,zr,Up,C0,c,ti,fl,wc,ta,b,null,-0,0)}}break}while(!0);ws(o)}function YQ(o,c,f,p,y,b,T,A,z,F,te,ie,K,J){if(o.timeoutHandle=-1,ie=c.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:no},jQ(c,b,ie);var Se=(b&62914560)===b?Xp-Zt():(b&4194048)===b?BQ-Zt():0;if(Se=QX(ie,Se),Se!==null){yo=b,o.cancelPendingCommit=Se(tE.bind(null,o,c,b,f,p,y,T,A,z,te,ie,null,K,J)),sa(o,b,T,!F);return}}tE(o,c,b,f,p,y,T,A,z)}function BZ(o){for(var c=o;;){var f=c.tag;if((f===0||f===11||f===15)&&c.flags&16384&&(f=c.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var p=0;p<f.length;p++){var y=f[p],b=y.getSnapshot;y=y.value;try{if(!Fr(b(),y))return!1}catch{return!1}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function sa(o,c,f,p){c&=~k0,c&=~fl,o.suspendedLanes|=c,o.pingedLanes&=~c,p&&(o.warmLanes|=c),p=o.expirationTimes;for(var y=c;0<y;){var b=31-Xt(y),T=1<<b;p[b]=-1,y&=~T}f!==0&&Ve(o,f,c)}function Vp(){return(St&6)===0?(Mf(0),!1):!0}function R0(){if(nt!==null){if(_t===0)var o=nt.return;else o=nt,oo=nl=null,Vb(o),gc=null,mf=0,o=nt;for(;o!==null;)kQ(o.alternate,o),o=o.return;nt=null}}function Cc(o,c){var f=o.timeoutHandle;f!==-1&&(o.timeoutHandle=-1,cX(f)),f=o.cancelPendingCommit,f!==null&&(o.cancelPendingCommit=null,f()),yo=0,R0(),Ut=o,nt=f=io(o.current,null),st=c,_t=0,ei=null,ta=!1,Sc=wn(o,c),w0=!1,wc=ti=k0=fl=na=fn=0,zr=_f=null,C0=!1,(c&8)!==0&&(c|=c&32);var p=o.entangledLanes;if(p!==0)for(o=o.entanglements,p&=c;0<p;){var y=31-Xt(p),b=1<<y;c|=o[y],p&=~b}return Oo=c,dp(),f}function GQ(o,c){Ze=null,N.H=kf,c===pc||c===vp?(c=uT(),_t=3):c===$b?(c=uT(),_t=4):_t=c===a0?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,ei=c,nt===null&&(fn=1,Mp(o,Ci(c,o.current)))}function WQ(){var o=Kr.current;return o===null?!0:(st&4194048)===st?Ri===null:(st&62914560)===st||(st&536870912)!==0?o===Ri:!1}function FQ(){var o=N.H;return N.H=kf,o===null?kf:o}function HQ(){var o=N.A;return N.A=ZZ,o}function qp(){fn=4,ta||(st&4194048)!==st&&Kr.current!==null||(Sc=!0),(na&134217727)===0&&(fl&134217727)===0||Ut===null||sa(Ut,st,ti,!1)}function A0(o,c,f){var p=St;St|=2;var y=FQ(),b=HQ();(Ut!==o||st!==c)&&(Up=null,Cc(o,c)),c=!1;var T=fn;e:do try{if(_t!==0&&nt!==null){var A=nt,z=ei;switch(_t){case 8:R0(),T=6;break e;case 3:case 2:case 9:case 6:Kr.current===null&&(c=!0);var F=_t;if(_t=0,ei=null,Tc(o,A,z,F),f&&Sc){T=0;break e}break;default:F=_t,_t=0,ei=null,Tc(o,A,z,F)}}UZ(),T=fn;break}catch(te){GQ(o,te)}while(!0);return c&&o.shellSuspendCounter++,oo=nl=null,St=p,N.H=y,N.A=b,nt===null&&(Ut=null,st=0,dp()),T}function UZ(){for(;nt!==null;)KQ(nt)}function VZ(o,c){var f=St;St|=2;var p=FQ(),y=HQ();Ut!==o||st!==c?(Up=null,Bp=Zt()+500,Cc(o,c)):Sc=wn(o,c);e:do try{if(_t!==0&&nt!==null){c=nt;var b=ei;t:switch(_t){case 1:_t=0,ei=null,Tc(o,c,b,1);break;case 2:case 9:if(lT(b)){_t=0,ei=null,JQ(c);break}c=function(){_t!==2&&_t!==9||Ut!==o||(_t=7),ws(o)},b.then(c,c);break e;case 3:_t=7;break e;case 4:_t=5;break e;case 7:lT(b)?(_t=0,ei=null,JQ(c)):(_t=0,ei=null,Tc(o,c,b,7));break;case 5:var T=null;switch(nt.tag){case 26:T=nt.memoizedState;case 5:case 27:var A=nt;if(T?zE(T):A.stateNode.complete){_t=0,ei=null;var z=A.sibling;if(z!==null)nt=z;else{var F=A.return;F!==null?(nt=F,Yp(F)):nt=null}break t}}_t=0,ei=null,Tc(o,c,b,5);break;case 6:_t=0,ei=null,Tc(o,c,b,6);break;case 8:R0(),fn=6;break e;default:throw Error(r(462))}}qZ();break}catch(te){GQ(o,te)}while(!0);return oo=nl=null,N.H=p,N.A=y,St=f,nt!==null?0:(Ut=null,st=0,dp(),fn)}function qZ(){for(;nt!==null&&!He();)KQ(nt)}function KQ(o){var c=SQ(o.alternate,o,Oo);o.memoizedProps=o.pendingProps,c===null?Yp(o):nt=c}function JQ(o){var c=o,f=c.alternate;switch(c.tag){case 15:case 0:c=mQ(f,c,c.pendingProps,c.type,void 0,st);break;case 11:c=mQ(f,c,c.pendingProps,c.type.render,c.ref,st);break;case 5:Vb(c);default:kQ(f,c),c=nt=HC(c,Oo),c=SQ(f,c,Oo)}o.memoizedProps=o.pendingProps,c===null?Yp(o):nt=c}function Tc(o,c,f,p){oo=nl=null,Vb(c),gc=null,mf=0;var y=c.return;try{if(MZ(o,y,c,f,st)){fn=1,Mp(o,Ci(f,o.current)),nt=null;return}}catch(b){if(y!==null)throw nt=y,b;fn=1,Mp(o,Ci(f,o.current)),nt=null;return}c.flags&32768?(ct||p===1?o=!0:Sc||(st&536870912)!==0?o=!1:(ta=o=!0,(p===2||p===9||p===3||p===6)&&(p=Kr.current,p!==null&&p.tag===13&&(p.flags|=16384))),eE(c,o)):Yp(c)}function Yp(o){var c=o;do{if((c.flags&32768)!==0){eE(c,ta);return}o=c.return;var f=LZ(c.alternate,c,Oo);if(f!==null){nt=f;return}if(c=c.sibling,c!==null){nt=c;return}nt=c=o}while(c!==null);fn===0&&(fn=5)}function eE(o,c){do{var f=zZ(o.alternate,o);if(f!==null){f.flags&=32767,nt=f;return}if(f=o.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!c&&(o=o.sibling,o!==null)){nt=o;return}nt=o=f}while(o!==null);fn=6,nt=null}function tE(o,c,f,p,y,b,T,A,z){o.cancelPendingCommit=null;do Gp();while($n!==0);if((St&6)!==0)throw Error(r(327));if(c!==null){if(c===o.current)throw Error(r(177));if(b=c.lanes|c.childLanes,b|=yb,ve(o,f,b,T,A,z),o===Ut&&(nt=Ut=null,st=0),kc=c,ia=o,yo=f,T0=b,Q0=y,UQ=p,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,FZ(gt,function(){return oE(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||p){p=N.T,N.T=null,y=V.p,V.p=2,T=St,St|=4;try{jZ(o,c,f)}finally{St=T,V.p=y,N.T=p}}$n=1,nE(),rE(),iE()}}function nE(){if($n===1){$n=0;var o=ia,c=kc,f=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||f){f=N.T,N.T=null;var p=V.p;V.p=2;var y=St;St|=4;try{NQ(c,o);var b=X0,T=XC(o.containerInfo),A=b.focusedElem,z=b.selectionRange;if(T!==A&&A&&A.ownerDocument&&ZC(A.ownerDocument.documentElement,A)){if(z!==null&&hb(A)){var F=z.start,te=z.end;if(te===void 0&&(te=F),"selectionStart"in A)A.selectionStart=F,A.selectionEnd=Math.min(te,A.value.length);else{var ie=A.ownerDocument||document,K=ie&&ie.defaultView||window;if(K.getSelection){var J=K.getSelection(),Se=A.textContent.length,De=Math.min(z.start,Se),jt=z.end===void 0?De:Math.min(z.end,Se);!J.extend&&De>jt&&(T=jt,jt=De,De=T);var q=IC(A,De),X=IC(A,jt);if(q&&X&&(J.rangeCount!==1||J.anchorNode!==q.node||J.anchorOffset!==q.offset||J.focusNode!==X.node||J.focusOffset!==X.offset)){var G=ie.createRange();G.setStart(q.node,q.offset),J.removeAllRanges(),De>jt?(J.addRange(G),J.extend(X.node,X.offset)):(G.setEnd(X.node,X.offset),J.addRange(G))}}}}for(ie=[],J=A;J=J.parentNode;)J.nodeType===1&&ie.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<ie.length;A++){var ne=ie[A];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}og=!!Z0,X0=Z0=null}finally{St=y,V.p=p,N.T=f}}o.current=c,$n=2}}function rE(){if($n===2){$n=0;var o=ia,c=kc,f=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||f){f=N.T,N.T=null;var p=V.p;V.p=2;var y=St;St|=4;try{PQ(o,c.alternate,c)}finally{St=y,V.p=p,N.T=f}}$n=3}}function iE(){if($n===4||$n===3){$n=0,Gr();var o=ia,c=kc,f=yo,p=UQ;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?$n=5:($n=0,kc=ia=null,sE(o,o.pendingLanes));var y=o.pendingLanes;if(y===0&&(ra=null),Ae(f),c=c.stateNode,tn&&typeof tn.onCommitFiberRoot=="function")try{tn.onCommitFiberRoot(Hn,c,void 0,(c.current.flags&128)===128)}catch{}if(p!==null){c=N.T,y=V.p,V.p=2,N.T=null;try{for(var b=o.onRecoverableError,T=0;T<p.length;T++){var A=p[T];b(A.value,{componentStack:A.stack})}}finally{N.T=c,V.p=y}}(yo&3)!==0&&Gp(),ws(o),y=o.pendingLanes,(f&261930)!==0&&(y&42)!==0?o===E0?$f++:($f=0,E0=o):$f=0,Mf(0)}}function sE(o,c){(o.pooledCacheLanes&=c)===0&&(c=o.pooledCache,c!=null&&(o.pooledCache=null,pf(c)))}function Gp(){return nE(),rE(),iE(),oE()}function oE(){if($n!==5)return!1;var o=ia,c=T0;T0=0;var f=Ae(yo),p=N.T,y=V.p;try{V.p=32>f?32:f,N.T=null,f=Q0,Q0=null;var b=ia,T=yo;if($n=0,kc=ia=null,yo=0,(St&6)!==0)throw Error(r(331));var A=St;if(St|=4,ZQ(b.current),zQ(b,b.current,T,f),St=A,Mf(0,!1),tn&&typeof tn.onPostCommitFiberRoot=="function")try{tn.onPostCommitFiberRoot(Hn,b)}catch{}return!0}finally{V.p=y,N.T=p,sE(o,c)}}function aE(o,c,f){c=Ci(f,c),c=o0(o.stateNode,c,2),o=Ho(o,c,2),o!==null&&(ae(o,2),ws(o))}function $t(o,c,f){if(o.tag===3)aE(o,o,f);else for(;c!==null;){if(c.tag===3){aE(c,o,f);break}else if(c.tag===1){var p=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(ra===null||!ra.has(p))){o=Ci(f,o),f=lQ(2),p=Ho(c,f,2),p!==null&&(cQ(f,p,c,o),ae(p,2),ws(p));break}}c=c.return}}function P0(o,c,f){var p=o.pingCache;if(p===null){p=o.pingCache=new XZ;var y=new Set;p.set(c,y)}else y=p.get(c),y===void 0&&(y=new Set,p.set(c,y));y.has(f)||(w0=!0,y.add(f),o=YZ.bind(null,o,c,f),c.then(o,o))}function YZ(o,c,f){var p=o.pingCache;p!==null&&p.delete(c),o.pingedLanes|=o.suspendedLanes&f,o.warmLanes&=~f,Ut===o&&(st&f)===f&&(fn===4||fn===3&&(st&62914560)===st&&300>Zt()-Xp?(St&2)===0&&Cc(o,0):k0|=f,wc===st&&(wc=0)),ws(o)}function lE(o,c){c===0&&(c=Nt()),o=Ja(o,c),o!==null&&(ae(o,c),ws(o))}function GZ(o){var c=o.memoizedState,f=0;c!==null&&(f=c.retryLane),lE(o,f)}function WZ(o,c){var f=0;switch(o.tag){case 31:case 13:var p=o.stateNode,y=o.memoizedState;y!==null&&(f=y.retryLane);break;case 19:p=o.stateNode;break;case 22:p=o.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(c),lE(o,f)}function FZ(o,c){return It(o,c)}var Wp=null,Qc=null,_0=!1,Fp=!1,$0=!1,oa=0;function ws(o){o!==Qc&&o.next===null&&(Qc===null?Wp=Qc=o:Qc=Qc.next=o),Fp=!0,_0||(_0=!0,KZ())}function Mf(o,c){if(!$0&&Fp){$0=!0;do for(var f=!1,p=Wp;p!==null;){if(o!==0){var y=p.pendingLanes;if(y===0)var b=0;else{var T=p.suspendedLanes,A=p.pingedLanes;b=(1<<31-Xt(42|o)+1)-1,b&=y&~(T&~A),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(f=!0,dE(p,b))}else b=st,b=Kt(p,p===Ut?b:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(b&3)===0||wn(p,b)||(f=!0,dE(p,b));p=p.next}while(f);$0=!1}}function HZ(){cE()}function cE(){Fp=_0=!1;var o=0;oa!==0&&lX()&&(o=oa);for(var c=Zt(),f=null,p=Wp;p!==null;){var y=p.next,b=uE(p,c);b===0?(p.next=null,f===null?Wp=y:f.next=y,y===null&&(Qc=f)):(f=p,(o!==0||(b&3)!==0)&&(Fp=!0)),p=y}$n!==0&&$n!==5||Mf(o),oa!==0&&(oa=0)}function uE(o,c){for(var f=o.suspendedLanes,p=o.pingedLanes,y=o.expirationTimes,b=o.pendingLanes&-62914561;0<b;){var T=31-Xt(b),A=1<<T,z=y[T];z===-1?((A&f)===0||(A&p)!==0)&&(y[T]=et(A,c)):z<=c&&(o.expiredLanes|=A),b&=~A}if(c=Ut,f=st,f=Kt(o,o===c?f:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,f===0||o===c&&(_t===2||_t===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&jn(p),o.callbackNode=null,o.callbackPriority=0;if((f&3)===0||wn(o,f)){if(c=f&-f,c===o.callbackPriority)return c;switch(p!==null&&jn(p),Ae(f)){case 2:case 8:f=Ue;break;case 32:f=gt;break;case 268435456:f=gr;break;default:f=gt}return p=fE.bind(null,o),f=It(f,p),o.callbackPriority=c,o.callbackNode=f,c}return p!==null&&p!==null&&jn(p),o.callbackPriority=2,o.callbackNode=null,2}function fE(o,c){if($n!==0&&$n!==5)return o.callbackNode=null,o.callbackPriority=0,null;var f=o.callbackNode;if(Gp()&&o.callbackNode!==f)return null;var p=st;return p=Kt(o,o===Ut?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(qQ(o,p,c),uE(o,Zt()),o.callbackNode!=null&&o.callbackNode===f?fE.bind(null,o):null)}function dE(o,c){if(Gp())return null;qQ(o,c,!0)}function KZ(){uX(function(){(St&6)!==0?It(Be,HZ):cE()})}function M0(){if(oa===0){var o=dc;o===0&&(o=ar,ar<<=1,(ar&261888)===0&&(ar=256)),oa=o}return oa}function hE(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:ip(""+o)}function pE(o,c){var f=c.ownerDocument.createElement("input");return f.name=c.name,f.value=c.value,o.id&&f.setAttribute("form",o.id),c.parentNode.insertBefore(f,c),o=new FormData(o),f.parentNode.removeChild(f),o}function JZ(o,c,f,p,y){if(c==="submit"&&f&&f.stateNode===y){var b=hE((y[mt]||null).action),T=p.submitter;T&&(c=(c=T[mt]||null)?hE(c.formAction):T.getAttribute("formAction"),c!==null&&(b=c,T=null));var A=new lp("action","action",null,p,y);o.push({event:A,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(oa!==0){var z=T?pE(y,T):new FormData(y);e0(f,{pending:!0,data:z,method:y.method,action:b},null,z)}}else typeof b=="function"&&(A.preventDefault(),z=T?pE(y,T):new FormData(y),e0(f,{pending:!0,data:z,method:y.method,action:b},b,z))},currentTarget:y}]})}}for(var D0=0;D0<Ob.length;D0++){var N0=Ob[D0],eX=N0.toLowerCase(),tX=N0[0].toUpperCase()+N0.slice(1);Wi(eX,"on"+tX)}Wi(VC,"onAnimationEnd"),Wi(qC,"onAnimationIteration"),Wi(YC,"onAnimationStart"),Wi("dblclick","onDoubleClick"),Wi("focusin","onFocus"),Wi("focusout","onBlur"),Wi(OZ,"onTransitionRun"),Wi(yZ,"onTransitionStart"),Wi(bZ,"onTransitionCancel"),Wi(GC,"onTransitionEnd"),bs("onMouseEnter",["mouseout","mouseover"]),bs("onMouseLeave",["mouseout","mouseover"]),bs("onPointerEnter",["pointerout","pointerover"]),bs("onPointerLeave",["pointerout","pointerover"]),$r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$r("onBeforeInput",["compositionend","keypress","textInput","paste"]),$r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Df="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(" "),nX=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Df));function gE(o,c){c=(c&4)!==0;for(var f=0;f<o.length;f++){var p=o[f],y=p.event;p=p.listeners;e:{var b=void 0;if(c)for(var T=p.length-1;0<=T;T--){var A=p[T],z=A.instance,F=A.currentTarget;if(A=A.listener,z!==b&&y.isPropagationStopped())break e;b=A,y.currentTarget=F;try{b(y)}catch(te){fp(te)}y.currentTarget=null,b=z}else for(T=0;T<p.length;T++){if(A=p[T],z=A.instance,F=A.currentTarget,A=A.listener,z!==b&&y.isPropagationStopped())break e;b=A,y.currentTarget=F;try{b(y)}catch(te){fp(te)}y.currentTarget=null,b=z}}}}function rt(o,c){var f=c[vi];f===void 0&&(f=c[vi]=new Set);var p=o+"__bubble";f.has(p)||(mE(c,o,2,!1),f.add(p))}function L0(o,c,f){var p=0;c&&(p|=4),mE(f,o,p,c)}var Hp="_reactListening"+Math.random().toString(36).slice(2);function z0(o){if(!o[Hp]){o[Hp]=!0,Kn.forEach(function(f){f!=="selectionchange"&&(nX.has(f)||L0(f,!1,o),L0(f,!0,o))});var c=o.nodeType===9?o:o.ownerDocument;c===null||c[Hp]||(c[Hp]=!0,L0("selectionchange",!1,c))}}function mE(o,c,f,p){switch(VE(c)){case 2:var y=AX;break;case 8:y=PX;break;default:y=J0}f=y.bind(null,c,f,o),y=void 0,!ib||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(y=!0),p?y!==void 0?o.addEventListener(c,f,{capture:!0,passive:y}):o.addEventListener(c,f,!0):y!==void 0?o.addEventListener(c,f,{passive:y}):o.addEventListener(c,f,!1)}function j0(o,c,f,p,y){var b=p;if((c&1)===0&&(c&2)===0&&p!==null)e:for(;;){if(p===null)return;var T=p.tag;if(T===3||T===4){var A=p.stateNode.containerInfo;if(A===y)break;if(T===4)for(T=p.return;T!==null;){var z=T.tag;if((z===3||z===4)&&T.stateNode.containerInfo===y)return;T=T.return}for(;A!==null;){if(T=ce(A),T===null)return;if(z=T.tag,z===5||z===6||z===26||z===27){p=b=T;continue e}A=A.parentNode}}p=p.return}xC(function(){var F=b,te=nb(f),ie=[];e:{var K=WC.get(o);if(K!==void 0){var J=lp,Se=o;switch(o){case"keypress":if(op(f)===0)break e;case"keydown":case"keyup":J=WI;break;case"focusin":Se="focus",J=lb;break;case"focusout":Se="blur",J=lb;break;case"beforeblur":case"afterblur":J=lb;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=kC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=LI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=KI;break;case VC:case qC:case YC:J=II;break;case GC:J=eZ;break;case"scroll":case"scrollend":J=DI;break;case"wheel":J=nZ;break;case"copy":case"cut":case"paste":J=XI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=TC;break;case"toggle":case"beforetoggle":J=iZ}var De=(c&4)!==0,jt=!De&&(o==="scroll"||o==="scrollend"),q=De?K!==null?K+"Capture":null:K;De=[];for(var X=F,G;X!==null;){var ne=X;if(G=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||G===null||q===null||(ne=nf(X,q),ne!=null&&De.push(Nf(X,ne,G))),jt)break;X=X.return}0<De.length&&(K=new J(K,Se,null,f,te),ie.push({event:K,listeners:De}))}}if((c&7)===0){e:{if(K=o==="mouseover"||o==="pointerover",J=o==="mouseout"||o==="pointerout",K&&f!==tb&&(Se=f.relatedTarget||f.fromElement)&&(ce(Se)||Se[Zn]))break e;if((J||K)&&(K=te.window===te?te:(K=te.ownerDocument)?K.defaultView||K.parentWindow:window,J?(Se=f.relatedTarget||f.toElement,J=F,Se=Se?ce(Se):null,Se!==null&&(jt=s(Se),De=Se.tag,Se!==jt||De!==5&&De!==27&&De!==6)&&(Se=null)):(J=null,Se=F),J!==Se)){if(De=kC,ne="onMouseLeave",q="onMouseEnter",X="mouse",(o==="pointerout"||o==="pointerover")&&(De=TC,ne="onPointerLeave",q="onPointerEnter",X="pointer"),jt=J==null?K:Et(J),G=Se==null?K:Et(Se),K=new De(ne,X+"leave",J,f,te),K.target=jt,K.relatedTarget=G,ne=null,ce(te)===F&&(De=new De(q,X+"enter",Se,f,te),De.target=G,De.relatedTarget=jt,ne=De),jt=ne,J&&Se)t:{for(De=rX,q=J,X=Se,G=0,ne=q;ne;ne=De(ne))G++;ne=0;for(var Pe=X;Pe;Pe=De(Pe))ne++;for(;0<G-ne;)q=De(q),G--;for(;0<ne-G;)X=De(X),ne--;for(;G--;){if(q===X||X!==null&&q===X.alternate){De=q;break t}q=De(q),X=De(X)}De=null}else De=null;J!==null&&OE(ie,K,J,De,!1),Se!==null&&jt!==null&&OE(ie,jt,Se,De,!0)}}e:{if(K=F?Et(F):window,J=K.nodeName&&K.nodeName.toLowerCase(),J==="select"||J==="input"&&K.type==="file")var Ot=MC;else if(_C(K))if(DC)Ot=pZ;else{Ot=dZ;var Qe=fZ}else J=K.nodeName,!J||J.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?F&&eb(F.elementType)&&(Ot=MC):Ot=hZ;if(Ot&&(Ot=Ot(o,F))){$C(ie,Ot,f,te);break e}Qe&&Qe(o,K,F),o==="focusout"&&F&&K.type==="number"&&F.memoizedProps.value!=null&&Jy(K,"number",K.value)}switch(Qe=F?Et(F):window,o){case"focusin":(_C(Qe)||Qe.contentEditable==="true")&&(ic=Qe,pb=F,ff=null);break;case"focusout":ff=pb=ic=null;break;case"mousedown":gb=!0;break;case"contextmenu":case"mouseup":case"dragend":gb=!1,BC(ie,f,te);break;case"selectionchange":if(mZ)break;case"keydown":case"keyup":BC(ie,f,te)}var qe;if(ub)e:{switch(o){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else rc?AC(o,f)&&(ot="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(ot="onCompositionStart");ot&&(QC&&f.locale!=="ko"&&(rc||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&rc&&(qe=SC()):(Uo=te,sb="value"in Uo?Uo.value:Uo.textContent,rc=!0)),Qe=Kp(F,ot),0<Qe.length&&(ot=new CC(ot,o,null,f,te),ie.push({event:ot,listeners:Qe}),qe?ot.data=qe:(qe=PC(f),qe!==null&&(ot.data=qe)))),(qe=oZ?aZ(o,f):lZ(o,f))&&(ot=Kp(F,"onBeforeInput"),0<ot.length&&(Qe=new CC("onBeforeInput","beforeinput",null,f,te),ie.push({event:Qe,listeners:ot}),Qe.data=qe)),JZ(ie,o,F,f,te)}gE(ie,c)})}function Nf(o,c,f){return{instance:o,listener:c,currentTarget:f}}function Kp(o,c){for(var f=c+"Capture",p=[];o!==null;){var y=o,b=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=nf(o,f),y!=null&&p.unshift(Nf(o,y,b)),y=nf(o,c),y!=null&&p.push(Nf(o,y,b))),o.tag===3)return p;o=o.return}return[]}function rX(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function OE(o,c,f,p,y){for(var b=c._reactName,T=[];f!==null&&f!==p;){var A=f,z=A.alternate,F=A.stateNode;if(A=A.tag,z!==null&&z===p)break;A!==5&&A!==26&&A!==27||F===null||(z=F,y?(F=nf(f,b),F!=null&&T.unshift(Nf(f,F,z))):y||(F=nf(f,b),F!=null&&T.push(Nf(f,F,z)))),f=f.return}T.length!==0&&o.push({event:c,listeners:T})}var iX=/\r\n?/g,sX=/\u0000|\uFFFD/g;function yE(o){return(typeof o=="string"?o:""+o).replace(iX,`
25
+ `).replace(sX,"")}function bE(o,c){return c=yE(c),yE(o)===c}function zt(o,c,f,p,y,b){switch(f){case"children":typeof p=="string"?c==="body"||c==="textarea"&&p===""||ec(o,p):(typeof p=="number"||typeof p=="bigint")&&c!=="body"&&ec(o,""+p);break;case"className":np(o,"class",p);break;case"tabIndex":np(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":np(o,f,p);break;case"style":bC(o,p,b);break;case"data":if(c!=="object"){np(o,"data",p);break}case"src":case"href":if(p===""&&(c!=="a"||f!=="href")){o.removeAttribute(f);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(f);break}p=ip(""+p),o.setAttribute(f,p);break;case"action":case"formAction":if(typeof p=="function"){o.setAttribute(f,"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 b=="function"&&(f==="formAction"?(c!=="input"&&zt(o,c,"name",y.name,y,null),zt(o,c,"formEncType",y.formEncType,y,null),zt(o,c,"formMethod",y.formMethod,y,null),zt(o,c,"formTarget",y.formTarget,y,null)):(zt(o,c,"encType",y.encType,y,null),zt(o,c,"method",y.method,y,null),zt(o,c,"target",y.target,y,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(f);break}p=ip(""+p),o.setAttribute(f,p);break;case"onClick":p!=null&&(o.onclick=no);break;case"onScroll":p!=null&&rt("scroll",o);break;case"onScrollEnd":p!=null&&rt("scrollend",o);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(f=p.__html,f!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=f}}break;case"multiple":o.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":o.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){o.removeAttribute("xlink:href");break}f=ip(""+p),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(f,""+p):o.removeAttribute(f);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":p&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(f,""):o.removeAttribute(f);break;case"capture":case"download":p===!0?o.setAttribute(f,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(f,p):o.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?o.setAttribute(f,p):o.removeAttribute(f);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?o.removeAttribute(f):o.setAttribute(f,p);break;case"popover":rt("beforetoggle",o),rt("toggle",o),tp(o,"popover",p);break;case"xlinkActuate":to(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":to(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":to(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":to(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":to(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":to(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":to(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":to(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":to(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":tp(o,"is",p);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=$I.get(f)||f,tp(o,f,p))}}function I0(o,c,f,p,y,b){switch(f){case"style":bC(o,p,b);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(f=p.__html,f!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=f}}break;case"children":typeof p=="string"?ec(o,p):(typeof p=="number"||typeof p=="bigint")&&ec(o,""+p);break;case"onScroll":p!=null&&rt("scroll",o);break;case"onScrollEnd":p!=null&&rt("scrollend",o);break;case"onClick":p!=null&&(o.onclick=no);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xi.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(y=f.endsWith("Capture"),c=f.slice(2,y?f.length-7:void 0),b=o[mt]||null,b=b!=null?b[f]:null,typeof b=="function"&&o.removeEventListener(c,b,y),typeof p=="function")){typeof b!="function"&&b!==null&&(f in o?o[f]=null:o.hasAttribute(f)&&o.removeAttribute(f)),o.addEventListener(c,p,y);break e}f in o?o[f]=p:p===!0?o.setAttribute(f,""):tp(o,f,p)}}}function nr(o,c,f){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":rt("error",o),rt("load",o);var p=!1,y=!1,b;for(b in f)if(f.hasOwnProperty(b)){var T=f[b];if(T!=null)switch(b){case"src":p=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:zt(o,c,b,T,f,null)}}y&&zt(o,c,"srcSet",f.srcSet,f,null),p&&zt(o,c,"src",f.src,f,null);return;case"input":rt("invalid",o);var A=b=T=y=null,z=null,F=null;for(p in f)if(f.hasOwnProperty(p)){var te=f[p];if(te!=null)switch(p){case"name":y=te;break;case"type":T=te;break;case"checked":z=te;break;case"defaultChecked":F=te;break;case"value":b=te;break;case"defaultValue":A=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,c));break;default:zt(o,c,p,te,f,null)}}gC(o,b,A,z,F,T,y,!1);return;case"select":rt("invalid",o),p=T=b=null;for(y in f)if(f.hasOwnProperty(y)&&(A=f[y],A!=null))switch(y){case"value":b=A;break;case"defaultValue":T=A;break;case"multiple":p=A;default:zt(o,c,y,A,f,null)}c=b,f=T,o.multiple=!!p,c!=null?Jl(o,!!p,c,!1):f!=null&&Jl(o,!!p,f,!0);return;case"textarea":rt("invalid",o),b=y=p=null;for(T in f)if(f.hasOwnProperty(T)&&(A=f[T],A!=null))switch(T){case"value":p=A;break;case"defaultValue":y=A;break;case"children":b=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(91));break;default:zt(o,c,T,A,f,null)}OC(o,p,y,b);return;case"option":for(z in f)if(f.hasOwnProperty(z)&&(p=f[z],p!=null))switch(z){case"selected":o.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:zt(o,c,z,p,f,null)}return;case"dialog":rt("beforetoggle",o),rt("toggle",o),rt("cancel",o),rt("close",o);break;case"iframe":case"object":rt("load",o);break;case"video":case"audio":for(p=0;p<Df.length;p++)rt(Df[p],o);break;case"image":rt("error",o),rt("load",o);break;case"details":rt("toggle",o);break;case"embed":case"source":case"link":rt("error",o),rt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in f)if(f.hasOwnProperty(F)&&(p=f[F],p!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:zt(o,c,F,p,f,null)}return;default:if(eb(c)){for(te in f)f.hasOwnProperty(te)&&(p=f[te],p!==void 0&&I0(o,c,te,p,f,void 0));return}}for(A in f)f.hasOwnProperty(A)&&(p=f[A],p!=null&&zt(o,c,A,p,f,null))}function oX(o,c,f,p){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,b=null,T=null,A=null,z=null,F=null,te=null;for(J in f){var ie=f[J];if(f.hasOwnProperty(J)&&ie!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":z=ie;default:p.hasOwnProperty(J)||zt(o,c,J,null,p,ie)}}for(var K in p){var J=p[K];if(ie=f[K],p.hasOwnProperty(K)&&(J!=null||ie!=null))switch(K){case"type":b=J;break;case"name":y=J;break;case"checked":F=J;break;case"defaultChecked":te=J;break;case"value":T=J;break;case"defaultValue":A=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,c));break;default:J!==ie&&zt(o,c,K,J,p,ie)}}Ky(o,T,A,z,F,te,b,y);return;case"select":J=T=A=K=null;for(b in f)if(z=f[b],f.hasOwnProperty(b)&&z!=null)switch(b){case"value":break;case"multiple":J=z;default:p.hasOwnProperty(b)||zt(o,c,b,null,p,z)}for(y in p)if(b=p[y],z=f[y],p.hasOwnProperty(y)&&(b!=null||z!=null))switch(y){case"value":K=b;break;case"defaultValue":A=b;break;case"multiple":T=b;default:b!==z&&zt(o,c,y,b,p,z)}c=A,f=T,p=J,K!=null?Jl(o,!!f,K,!1):!!p!=!!f&&(c!=null?Jl(o,!!f,c,!0):Jl(o,!!f,f?[]:"",!1));return;case"textarea":J=K=null;for(A in f)if(y=f[A],f.hasOwnProperty(A)&&y!=null&&!p.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:zt(o,c,A,null,p,y)}for(T in p)if(y=p[T],b=f[T],p.hasOwnProperty(T)&&(y!=null||b!=null))switch(T){case"value":K=y;break;case"defaultValue":J=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==b&&zt(o,c,T,y,p,b)}mC(o,K,J);return;case"option":for(var Se in f)if(K=f[Se],f.hasOwnProperty(Se)&&K!=null&&!p.hasOwnProperty(Se))switch(Se){case"selected":o.selected=!1;break;default:zt(o,c,Se,null,p,K)}for(z in p)if(K=p[z],J=f[z],p.hasOwnProperty(z)&&K!==J&&(K!=null||J!=null))switch(z){case"selected":o.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:zt(o,c,z,K,p,J)}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 De in f)K=f[De],f.hasOwnProperty(De)&&K!=null&&!p.hasOwnProperty(De)&&zt(o,c,De,null,p,K);for(F in p)if(K=p[F],J=f[F],p.hasOwnProperty(F)&&K!==J&&(K!=null||J!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,c));break;default:zt(o,c,F,K,p,J)}return;default:if(eb(c)){for(var jt in f)K=f[jt],f.hasOwnProperty(jt)&&K!==void 0&&!p.hasOwnProperty(jt)&&I0(o,c,jt,void 0,p,K);for(te in p)K=p[te],J=f[te],!p.hasOwnProperty(te)||K===J||K===void 0&&J===void 0||I0(o,c,te,K,p,J);return}}for(var q in f)K=f[q],f.hasOwnProperty(q)&&K!=null&&!p.hasOwnProperty(q)&&zt(o,c,q,null,p,K);for(ie in p)K=p[ie],J=f[ie],!p.hasOwnProperty(ie)||K===J||K==null&&J==null||zt(o,c,ie,K,p,J)}function vE(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function aX(){if(typeof performance.getEntriesByType=="function"){for(var o=0,c=0,f=performance.getEntriesByType("resource"),p=0;p<f.length;p++){var y=f[p],b=y.transferSize,T=y.initiatorType,A=y.duration;if(b&&A&&vE(T)){for(T=0,A=y.responseEnd,p+=1;p<f.length;p++){var z=f[p],F=z.startTime;if(F>A)break;var te=z.transferSize,ie=z.initiatorType;te&&vE(ie)&&(z=z.responseEnd,T+=te*(z<A?1:(A-F)/(z-F)))}if(--p,c+=8*(b+T)/(y.duration/1e3),o++,10<o)break}}if(0<o)return c/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Z0=null,X0=null;function Jp(o){return o.nodeType===9?o:o.ownerDocument}function xE(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function SE(o,c){if(o===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&c==="foreignObject"?0:o}function B0(o,c){return o==="textarea"||o==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var U0=null;function lX(){var o=window.event;return o&&o.type==="popstate"?o===U0?!1:(U0=o,!0):(U0=null,!1)}var wE=typeof setTimeout=="function"?setTimeout:void 0,cX=typeof clearTimeout=="function"?clearTimeout:void 0,kE=typeof Promise=="function"?Promise:void 0,uX=typeof queueMicrotask=="function"?queueMicrotask:typeof kE<"u"?function(o){return kE.resolve(null).then(o).catch(fX)}:wE;function fX(o){setTimeout(function(){throw o})}function aa(o){return o==="head"}function CE(o,c){var f=c,p=0;do{var y=f.nextSibling;if(o.removeChild(f),y&&y.nodeType===8)if(f=y.data,f==="/$"||f==="/&"){if(p===0){o.removeChild(y),Pc(c);return}p--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")p++;else if(f==="html")Lf(o.ownerDocument.documentElement);else if(f==="head"){f=o.ownerDocument.head,Lf(f);for(var b=f.firstChild;b;){var T=b.nextSibling,A=b.nodeName;b[ye]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&b.rel.toLowerCase()==="stylesheet"||f.removeChild(b),b=T}}else f==="body"&&Lf(o.ownerDocument.body);f=y}while(f);Pc(c)}function TE(o,c){var f=o;o=0;do{var p=f.nextSibling;if(f.nodeType===1?c?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(c?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),p&&p.nodeType===8)if(f=p.data,f==="/$"){if(o===0)break;o--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||o++;f=p}while(f)}function V0(o){var c=o.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var f=c;switch(c=c.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":V0(f),I(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}o.removeChild(f)}}function dX(o,c,f,p){for(;o.nodeType===1;){var y=f;if(o.nodeName.toLowerCase()!==c.toLowerCase()){if(!p&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(p){if(!o[ye])switch(c){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(b=o.getAttribute("rel"),b==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(b!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(b=o.getAttribute("src"),(b!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(c==="input"&&o.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===b)return o}else return o;if(o=Ai(o.nextSibling),o===null)break}return null}function hX(o,c,f){if(c==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!f||(o=Ai(o.nextSibling),o===null))return null;return o}function QE(o,c){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!c||(o=Ai(o.nextSibling),o===null))return null;return o}function q0(o){return o.data==="$?"||o.data==="$~"}function Y0(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function pX(o,c){var f=o.ownerDocument;if(o.data==="$~")o._reactRetry=c;else if(o.data!=="$?"||f.readyState!=="loading")c();else{var p=function(){c(),f.removeEventListener("DOMContentLoaded",p)};f.addEventListener("DOMContentLoaded",p),o._reactRetry=p}}function Ai(o){for(;o!=null;o=o.nextSibling){var c=o.nodeType;if(c===1||c===3)break;if(c===8){if(c=o.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return o}var G0=null;function EE(o){o=o.nextSibling;for(var c=0;o;){if(o.nodeType===8){var f=o.data;if(f==="/$"||f==="/&"){if(c===0)return Ai(o.nextSibling);c--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||c++}o=o.nextSibling}return null}function RE(o){o=o.previousSibling;for(var c=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(c===0)return o;c--}else f!=="/$"&&f!=="/&"||c++}o=o.previousSibling}return null}function AE(o,c,f){switch(c=Jp(f),o){case"html":if(o=c.documentElement,!o)throw Error(r(452));return o;case"head":if(o=c.head,!o)throw Error(r(453));return o;case"body":if(o=c.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function Lf(o){for(var c=o.attributes;c.length;)o.removeAttributeNode(c[0]);I(o)}var Pi=new Map,PE=new Set;function eg(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var bo=V.d;V.d={f:gX,r:mX,D:OX,C:yX,L:bX,m:vX,X:SX,S:xX,M:wX};function gX(){var o=bo.f(),c=Vp();return o||c}function mX(o){var c=be(o);c!==null&&c.tag===5&&c.type==="form"?GT(c):bo.r(o)}var Ec=typeof document>"u"?null:document;function _E(o,c,f){var p=Ec;if(p&&typeof c=="string"&&c){var y=wi(c);y='link[rel="'+o+'"][href="'+y+'"]',typeof f=="string"&&(y+='[crossorigin="'+f+'"]'),PE.has(y)||(PE.add(y),o={rel:o,crossOrigin:f,href:c},p.querySelector(y)===null&&(c=p.createElement("link"),nr(c,"link",o),Ke(c),p.head.appendChild(c)))}}function OX(o){bo.D(o),_E("dns-prefetch",o,null)}function yX(o,c){bo.C(o,c),_E("preconnect",o,c)}function bX(o,c,f){bo.L(o,c,f);var p=Ec;if(p&&o&&c){var y='link[rel="preload"][as="'+wi(c)+'"]';c==="image"&&f&&f.imageSrcSet?(y+='[imagesrcset="'+wi(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(y+='[imagesizes="'+wi(f.imageSizes)+'"]')):y+='[href="'+wi(o)+'"]';var b=y;switch(c){case"style":b=Rc(o);break;case"script":b=Ac(o)}Pi.has(b)||(o=g({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:o,as:c},f),Pi.set(b,o),p.querySelector(y)!==null||c==="style"&&p.querySelector(zf(b))||c==="script"&&p.querySelector(jf(b))||(c=p.createElement("link"),nr(c,"link",o),Ke(c),p.head.appendChild(c)))}}function vX(o,c){bo.m(o,c);var f=Ec;if(f&&o){var p=c&&typeof c.as=="string"?c.as:"script",y='link[rel="modulepreload"][as="'+wi(p)+'"][href="'+wi(o)+'"]',b=y;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Ac(o)}if(!Pi.has(b)&&(o=g({rel:"modulepreload",href:o},c),Pi.set(b,o),f.querySelector(y)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(jf(b)))return}p=f.createElement("link"),nr(p,"link",o),Ke(p),f.head.appendChild(p)}}}function xX(o,c,f){bo.S(o,c,f);var p=Ec;if(p&&o){var y=an(p).hoistableStyles,b=Rc(o);c=c||"default";var T=y.get(b);if(!T){var A={loading:0,preload:null};if(T=p.querySelector(zf(b)))A.loading=5;else{o=g({rel:"stylesheet",href:o,"data-precedence":c},f),(f=Pi.get(b))&&W0(o,f);var z=T=p.createElement("link");Ke(z),nr(z,"link",o),z._p=new Promise(function(F,te){z.onload=F,z.onerror=te}),z.addEventListener("load",function(){A.loading|=1}),z.addEventListener("error",function(){A.loading|=2}),A.loading|=4,tg(T,c,p)}T={type:"stylesheet",instance:T,count:1,state:A},y.set(b,T)}}}function SX(o,c){bo.X(o,c);var f=Ec;if(f&&o){var p=an(f).hoistableScripts,y=Ac(o),b=p.get(y);b||(b=f.querySelector(jf(y)),b||(o=g({src:o,async:!0},c),(c=Pi.get(y))&&F0(o,c),b=f.createElement("script"),Ke(b),nr(b,"link",o),f.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},p.set(y,b))}}function wX(o,c){bo.M(o,c);var f=Ec;if(f&&o){var p=an(f).hoistableScripts,y=Ac(o),b=p.get(y);b||(b=f.querySelector(jf(y)),b||(o=g({src:o,async:!0,type:"module"},c),(c=Pi.get(y))&&F0(o,c),b=f.createElement("script"),Ke(b),nr(b,"link",o),f.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},p.set(y,b))}}function $E(o,c,f,p){var y=(y=Ce.current)?eg(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=Rc(f.href),f=an(y).hoistableStyles,p=f.get(c),p||(p={type:"style",instance:null,count:0,state:null},f.set(c,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){o=Rc(f.href);var b=an(y).hoistableStyles,T=b.get(o);if(T||(y=y.ownerDocument||y,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(o,T),(b=y.querySelector(zf(o)))&&!b._p&&(T.instance=b,T.state.loading=5),Pi.has(o)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Pi.set(o,f),b||kX(y,o,f,T.state))),c&&p===null)throw Error(r(528,""));return T}if(c&&p!==null)throw Error(r(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Ac(f),f=an(y).hoistableScripts,p=f.get(c),p||(p={type:"script",instance:null,count:0,state:null},f.set(c,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Rc(o){return'href="'+wi(o)+'"'}function zf(o){return'link[rel="stylesheet"]['+o+"]"}function ME(o){return g({},o,{"data-precedence":o.precedence,precedence:null})}function kX(o,c,f,p){o.querySelector('link[rel="preload"][as="style"]['+c+"]")?p.loading=1:(c=o.createElement("link"),p.preload=c,c.addEventListener("load",function(){return p.loading|=1}),c.addEventListener("error",function(){return p.loading|=2}),nr(c,"link",f),Ke(c),o.head.appendChild(c))}function Ac(o){return'[src="'+wi(o)+'"]'}function jf(o){return"script[async]"+o}function DE(o,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var p=o.querySelector('style[data-href~="'+wi(f.href)+'"]');if(p)return c.instance=p,Ke(p),p;var y=g({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return p=(o.ownerDocument||o).createElement("style"),Ke(p),nr(p,"style",y),tg(p,f.precedence,o),c.instance=p;case"stylesheet":y=Rc(f.href);var b=o.querySelector(zf(y));if(b)return c.state.loading|=4,c.instance=b,Ke(b),b;p=ME(f),(y=Pi.get(y))&&W0(p,y),b=(o.ownerDocument||o).createElement("link"),Ke(b);var T=b;return T._p=new Promise(function(A,z){T.onload=A,T.onerror=z}),nr(b,"link",p),c.state.loading|=4,tg(b,f.precedence,o),c.instance=b;case"script":return b=Ac(f.src),(y=o.querySelector(jf(b)))?(c.instance=y,Ke(y),y):(p=f,(y=Pi.get(b))&&(p=g({},f),F0(p,y)),o=o.ownerDocument||o,y=o.createElement("script"),Ke(y),nr(y,"link",p),o.head.appendChild(y),c.instance=y);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(p=c.instance,c.state.loading|=4,tg(p,f.precedence,o));return c.instance}function tg(o,c,f){for(var p=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=p.length?p[p.length-1]:null,b=y,T=0;T<p.length;T++){var A=p[T];if(A.dataset.precedence===c)b=A;else if(b!==y)break}b?b.parentNode.insertBefore(o,b.nextSibling):(c=f.nodeType===9?f.head:f,c.insertBefore(o,c.firstChild))}function W0(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.title==null&&(o.title=c.title)}function F0(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.integrity==null&&(o.integrity=c.integrity)}var ng=null;function NE(o,c,f){if(ng===null){var p=new Map,y=ng=new Map;y.set(f,p)}else y=ng,p=y.get(f),p||(p=new Map,y.set(f,p));if(p.has(o))return p;for(p.set(o,null),f=f.getElementsByTagName(o),y=0;y<f.length;y++){var b=f[y];if(!(b[ye]||b[ft]||o==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var T=b.getAttribute(c)||"";T=o+T;var A=p.get(T);A?A.push(b):p.set(T,[b])}}return p}function LE(o,c,f){o=o.ownerDocument||o,o.head.insertBefore(f,c==="title"?o.querySelector("head > title"):null)}function CX(o,c,f){if(f===1||c.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return o=c.disabled,typeof c.precedence=="string"&&o==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function zE(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function TX(o,c,f,p){if(f.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var y=Rc(p.href),b=c.querySelector(zf(y));if(b){c=b._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(o.count++,o=rg.bind(o),c.then(o,o)),f.state.loading|=4,f.instance=b,Ke(b);return}b=c.ownerDocument||c,p=ME(p),(y=Pi.get(y))&&W0(p,y),b=b.createElement("link"),Ke(b);var T=b;T._p=new Promise(function(A,z){T.onload=A,T.onerror=z}),nr(b,"link",p),f.instance=b}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(f,c),(c=f.state.preload)&&(f.state.loading&3)===0&&(o.count++,f=rg.bind(o),c.addEventListener("load",f),c.addEventListener("error",f))}}var H0=0;function QX(o,c){return o.stylesheets&&o.count===0&&sg(o,o.stylesheets),0<o.count||0<o.imgCount?function(f){var p=setTimeout(function(){if(o.stylesheets&&sg(o,o.stylesheets),o.unsuspend){var b=o.unsuspend;o.unsuspend=null,b()}},6e4+c);0<o.imgBytes&&H0===0&&(H0=62500*aX());var y=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&sg(o,o.stylesheets),o.unsuspend)){var b=o.unsuspend;o.unsuspend=null,b()}},(o.imgBytes>H0?50:800)+c);return o.unsuspend=f,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(y)}}:null}function rg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sg(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var ig=null;function sg(o,c){o.stylesheets=null,o.unsuspend!==null&&(o.count++,ig=new Map,c.forEach(EX,o),ig=null,rg.call(o))}function EX(o,c){if(!(c.state.loading&4)){var f=ig.get(o);if(f)var p=f.get(null);else{f=new Map,ig.set(o,f);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var T=y[b];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(f.set(T.dataset.precedence,T),p=T)}p&&f.set(null,p)}y=c.instance,T=y.getAttribute("data-precedence"),b=f.get(T)||p,b===p&&f.set(null,y),f.set(T,y),this.count++,p=rg.bind(this),y.addEventListener("load",p),y.addEventListener("error",p),b?b.parentNode.insertBefore(y,b.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),c.state.loading|=4}}var If={$$typeof:R,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function RX(o,c,f,p,y,b,T,A,z){this.tag=1,this.containerInfo=o,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=mn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mn(0),this.hiddenUpdates=mn(null),this.identifierPrefix=p,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function jE(o,c,f,p,y,b,T,A,z,F,te,ie){return o=new RX(o,c,f,T,z,F,te,ie,A),c=1,b===!0&&(c|=24),b=Hr(3,null,null,c),o.current=b,b.stateNode=o,c=Ab(),c.refCount++,o.pooledCache=c,c.refCount++,b.memoizedState={element:p,isDehydrated:f,cache:c},Mb(b),o}function IE(o){return o?(o=ac,o):ac}function ZE(o,c,f,p,y,b){y=IE(y),p.context===null?p.context=y:p.pendingContext=y,p=Fo(c),p.payload={element:f},b=b===void 0?null:b,b!==null&&(p.callback=b),f=Ho(o,p,c),f!==null&&(jr(f,o,c),yf(f,o,c))}function XE(o,c){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<c?f:c}}function K0(o,c){XE(o,c),(o=o.alternate)&&XE(o,c)}function BE(o){if(o.tag===13||o.tag===31){var c=Ja(o,67108864);c!==null&&jr(c,o,67108864),K0(o,67108864)}}function UE(o){if(o.tag===13||o.tag===31){var c=ni();c=Oe(c);var f=Ja(o,c);f!==null&&jr(f,o,c),K0(o,c)}}var og=!0;function AX(o,c,f,p){var y=N.T;N.T=null;var b=V.p;try{V.p=2,J0(o,c,f,p)}finally{V.p=b,N.T=y}}function PX(o,c,f,p){var y=N.T;N.T=null;var b=V.p;try{V.p=8,J0(o,c,f,p)}finally{V.p=b,N.T=y}}function J0(o,c,f,p){if(og){var y=ev(p);if(y===null)j0(o,c,p,ag,f),qE(o,p);else if($X(y,o,c,f,p))p.stopPropagation();else if(qE(o,p),c&4&&-1<_X.indexOf(o)){for(;y!==null;){var b=be(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var T=ht(b.pendingLanes);if(T!==0){var A=b;for(A.pendingLanes|=2,A.entangledLanes|=2;T;){var z=1<<31-Xt(T);A.entanglements[1]|=z,T&=~z}ws(b),(St&6)===0&&(Bp=Zt()+500,Mf(0))}}break;case 31:case 13:A=Ja(b,2),A!==null&&jr(A,b,2),Vp(),K0(b,2)}if(b=ev(p),b===null&&j0(o,c,p,ag,f),b===y)break;y=b}y!==null&&p.stopPropagation()}else j0(o,c,p,null,f)}}function ev(o){return o=nb(o),tv(o)}var ag=null;function tv(o){if(ag=null,o=ce(o),o!==null){var c=s(o);if(c===null)o=null;else{var f=c.tag;if(f===13){if(o=a(c),o!==null)return o;o=null}else if(f===31){if(o=l(c),o!==null)return o;o=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;o=null}else c!==o&&(o=null)}}return ag=o,null}function VE(o){switch(o){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(In()){case Be:return 2;case Ue:return 8;case gt:case Fn:return 32;case gr:return 268435456;default:return 32}default:return 32}}var nv=!1,la=null,ca=null,ua=null,Zf=new Map,Xf=new Map,fa=[],_X="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 qE(o,c){switch(o){case"focusin":case"focusout":la=null;break;case"dragenter":case"dragleave":ca=null;break;case"mouseover":case"mouseout":ua=null;break;case"pointerover":case"pointerout":Zf.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xf.delete(c.pointerId)}}function Bf(o,c,f,p,y,b){return o===null||o.nativeEvent!==b?(o={blockedOn:c,domEventName:f,eventSystemFlags:p,nativeEvent:b,targetContainers:[y]},c!==null&&(c=be(c),c!==null&&BE(c)),o):(o.eventSystemFlags|=p,c=o.targetContainers,y!==null&&c.indexOf(y)===-1&&c.push(y),o)}function $X(o,c,f,p,y){switch(c){case"focusin":return la=Bf(la,o,c,f,p,y),!0;case"dragenter":return ca=Bf(ca,o,c,f,p,y),!0;case"mouseover":return ua=Bf(ua,o,c,f,p,y),!0;case"pointerover":var b=y.pointerId;return Zf.set(b,Bf(Zf.get(b)||null,o,c,f,p,y)),!0;case"gotpointercapture":return b=y.pointerId,Xf.set(b,Bf(Xf.get(b)||null,o,c,f,p,y)),!0}return!1}function YE(o){var c=ce(o.target);if(c!==null){var f=s(c);if(f!==null){if(c=f.tag,c===13){if(c=a(f),c!==null){o.blockedOn=c,cn(o.priority,function(){UE(f)});return}}else if(c===31){if(c=l(f),c!==null){o.blockedOn=c,cn(o.priority,function(){UE(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function lg(o){if(o.blockedOn!==null)return!1;for(var c=o.targetContainers;0<c.length;){var f=ev(o.nativeEvent);if(f===null){f=o.nativeEvent;var p=new f.constructor(f.type,f);tb=p,f.target.dispatchEvent(p),tb=null}else return c=be(f),c!==null&&BE(c),o.blockedOn=f,!1;c.shift()}return!0}function GE(o,c,f){lg(o)&&f.delete(c)}function MX(){nv=!1,la!==null&&lg(la)&&(la=null),ca!==null&&lg(ca)&&(ca=null),ua!==null&&lg(ua)&&(ua=null),Zf.forEach(GE),Xf.forEach(GE)}function cg(o,c){o.blockedOn===c&&(o.blockedOn=null,nv||(nv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,MX)))}var ug=null;function WE(o){ug!==o&&(ug=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ug===o&&(ug=null);for(var c=0;c<o.length;c+=3){var f=o[c],p=o[c+1],y=o[c+2];if(typeof p!="function"){if(tv(p||f)===null)continue;break}var b=be(f);b!==null&&(o.splice(c,3),c-=3,e0(b,{pending:!0,data:y,method:f.method,action:p},p,y))}}))}function Pc(o){function c(z){return cg(z,o)}la!==null&&cg(la,o),ca!==null&&cg(ca,o),ua!==null&&cg(ua,o),Zf.forEach(c),Xf.forEach(c);for(var f=0;f<fa.length;f++){var p=fa[f];p.blockedOn===o&&(p.blockedOn=null)}for(;0<fa.length&&(f=fa[0],f.blockedOn===null);)YE(f),f.blockedOn===null&&fa.shift();if(f=(o.ownerDocument||o).$$reactFormReplay,f!=null)for(p=0;p<f.length;p+=3){var y=f[p],b=f[p+1],T=y[mt]||null;if(typeof b=="function")T||WE(f);else if(T){var A=null;if(b&&b.hasAttribute("formAction")){if(y=b,T=b[mt]||null)A=T.formAction;else if(tv(y)!==null)continue}else A=T.action;typeof A=="function"?f[p+1]=A:(f.splice(p,3),p-=3),WE(f)}}}function FE(){function o(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(T){return y=T})},focusReset:"manual",scroll:"manual"})}function c(){y!==null&&(y(),y=null),p||setTimeout(f,20)}function f(){if(!p&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,y=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(f,100),function(){p=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),y!==null&&(y(),y=null)}}}function rv(o){this._internalRoot=o}fg.prototype.render=rv.prototype.render=function(o){var c=this._internalRoot;if(c===null)throw Error(r(409));var f=c.current,p=ni();ZE(f,p,o,c,null,null)},fg.prototype.unmount=rv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var c=o.containerInfo;ZE(o.current,2,null,o,null,null),Vp(),c[Zn]=null}};function fg(o){this._internalRoot=o}fg.prototype.unstable_scheduleHydration=function(o){if(o){var c=vt();o={blockedOn:null,target:o,priority:c};for(var f=0;f<fa.length&&c!==0&&c<fa[f].priority;f++);fa.splice(f,0,o),f===0&&YE(o)}};var HE=e.version;if(HE!=="19.2.4")throw Error(r(527,HE,"19.2.4"));V.findDOMNode=function(o){var c=o._reactInternals;if(c===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=d(c),o=o!==null?h(o):null,o=o===null?null:o.stateNode,o};var DX={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var dg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dg.isDisabled&&dg.supportsFiber)try{Hn=dg.inject(DX),tn=dg}catch{}}return Vf.createRoot=function(o,c){if(!i(o))throw Error(r(299));var f=!1,p="",y=iQ,b=sQ,T=oQ;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(p=c.identifierPrefix),c.onUncaughtError!==void 0&&(y=c.onUncaughtError),c.onCaughtError!==void 0&&(b=c.onCaughtError),c.onRecoverableError!==void 0&&(T=c.onRecoverableError)),c=jE(o,1,!1,null,null,f,p,null,y,b,T,FE),o[Zn]=c.current,z0(o),new rv(c)},Vf.hydrateRoot=function(o,c,f){if(!i(o))throw Error(r(299));var p=!1,y="",b=iQ,T=sQ,A=oQ,z=null;return f!=null&&(f.unstable_strictMode===!0&&(p=!0),f.identifierPrefix!==void 0&&(y=f.identifierPrefix),f.onUncaughtError!==void 0&&(b=f.onUncaughtError),f.onCaughtError!==void 0&&(T=f.onCaughtError),f.onRecoverableError!==void 0&&(A=f.onRecoverableError),f.formState!==void 0&&(z=f.formState)),c=jE(o,1,!0,c,f??null,p,y,z,b,T,A,FE),c.context=IE(null),f=c.current,p=ni(),p=Oe(p),y=Fo(p),y.callback=null,Ho(f,y,p),f=p,c.current.lanes=f,ae(c,f),ws(c),o[Zn]=c.current,z0(o),new fg(c)},Vf.version="19.2.4",Vf}var sR;function VX(){if(sR)return iv.exports;sR=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(),iv.exports=UX(),iv.exports}var qX=VX();const qx=new WeakMap,YX=new WeakMap,Em={current:[]};let av=!1,kd=0;const gd=new Set,hg=new Map;function F$(t){for(const e of t){if(Em.current.includes(e))continue;Em.current.push(e),e.recompute();const n=YX.get(e);if(n)for(const r of n){const i=qx.get(r);i!=null&&i.length&&F$(i)}}}function GX(t){const e={prevVal:t.prevState,currentVal:t.state};for(const n of t.listeners)n(e)}function WX(t){const e={prevVal:t.prevState,currentVal:t.state};for(const n of t.listeners)n(e)}function H$(t){if(kd>0&&!hg.has(t)&&hg.set(t,t.prevState),gd.add(t),!(kd>0)&&!av)try{for(av=!0;gd.size>0;){const e=Array.from(gd);gd.clear();for(const n of e){const r=hg.get(n)??n.prevState;n.prevState=r,GX(n)}for(const n of e){const r=qx.get(n);r&&(Em.current.push(n),F$(r))}for(const n of e){const r=qx.get(n);if(r)for(const i of r)WX(i)}}}finally{av=!1,Em.current=[],hg.clear()}}function FX(t){kd++;try{t()}finally{if(kd--,kd===0){const e=gd.values().next().value;e&&H$(e)}}}function HX(t){return typeof t=="function"}class KX{constructor(e,n){this.listeners=new Set,this.subscribe=r=>{var i,s;this.listeners.add(r);const a=(s=(i=this.options)==null?void 0:i.onSubscribe)==null?void 0:s.call(i,r,this);return()=>{this.listeners.delete(r),a==null||a()}},this.prevState=e,this.state=e,this.options=n}setState(e){var n,r,i;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(e):HX(e)?this.state=e(this.prevState):this.state=e,(i=(r=this.options)==null?void 0:r.onUpdate)==null||i.call(r),H$(this)}}const Aa="__TSR_index",oR="popstate",aR="beforeunload";function JX(t){let e=t.getLocation();const n=new Set,r=a=>{e=t.getLocation(),n.forEach(l=>l({location:e,action:a}))},i=a=>{t.notifyOnIndexChange??!0?r(a):e=t.getLocation()},s=async({task:a,navigateOpts:l,...u})=>{var m,O;if((l==null?void 0:l.ignoreBlocker)??!1){a();return}const h=((m=t.getBlockers)==null?void 0:m.call(t))??[],g=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&h.length&&g)for(const v of h){const x=Rm(u.path,u.state);if(await v.blockerFn({currentLocation:e,nextLocation:x,action:u.type})){(O=t.onBlocked)==null||O.call(t);return}}a()};return{get location(){return e},get length(){return t.getLength()},subscribers:n,subscribe:a=>(n.add(a),()=>{n.delete(a)}),push:(a,l,u)=>{const d=e.state[Aa];l=lR(d+1,l),s({task:()=>{t.pushState(a,l),r({type:"PUSH"})},navigateOpts:u,type:"PUSH",path:a,state:l})},replace:(a,l,u)=>{const d=e.state[Aa];l=lR(d,l),s({task:()=>{t.replaceState(a,l),r({type:"REPLACE"})},navigateOpts:u,type:"REPLACE",path:a,state:l})},go:(a,l)=>{s({task:()=>{t.go(a),i({type:"GO",index:a})},navigateOpts:l,type:"GO"})},back:a=>{s({task:()=>{t.back((a==null?void 0:a.ignoreBlocker)??!1),i({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{s({task:()=>{t.forward((a==null?void 0:a.ignoreBlocker)??!1),i({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>e.state[Aa]!==0,createHref:a=>t.createHref(a),block:a=>{var u;if(!t.setBlockers)return()=>{};const l=((u=t.getBlockers)==null?void 0:u.call(t))??[];return t.setBlockers([...l,a]),()=>{var h,g;const d=((h=t.getBlockers)==null?void 0:h.call(t))??[];(g=t.setBlockers)==null||g.call(t,d.filter(m=>m!==a))}},flush:()=>{var a;return(a=t.flush)==null?void 0:a.call(t)},destroy:()=>{var a;return(a=t.destroy)==null?void 0:a.call(t)},notify:r}}function lR(t,e){e||(e={});const n=Mw();return{...e,key:n,__TSR_key:n,[Aa]:t}}function eB(t){var D,B;const e=typeof document<"u"?window:void 0,n=e.history.pushState,r=e.history.replaceState;let i=[];const s=()=>i,a=L=>i=L,l=(L=>L),u=(()=>Rm(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!((D=e.history.state)!=null&&D.__TSR_key)&&!((B=e.history.state)!=null&&B.key)){const L=Mw();e.history.replaceState({[Aa]:0,key:L,__TSR_key:L},"")}let d=u(),h,g=!1,m=!1,O=!1,v=!1;const x=()=>d;let k,C;const Q=()=>{k&&(_._ignoreSubscribers=!0,(k.isPush?e.history.pushState:e.history.replaceState)(k.state,"",k.href),_._ignoreSubscribers=!1,k=void 0,C=void 0,h=void 0)},R=(L,M,U)=>{const Y=l(M);C||(h=d),d=Rm(M,U),k={href:Y,state:U,isPush:(k==null?void 0:k.isPush)||L==="push"},C||(C=Promise.resolve().then(()=>Q()))},E=L=>{d=u(),_.notify({type:L})},P=async()=>{if(m){m=!1;return}const L=u(),M=L.state[Aa]-d.state[Aa],U=M===1,Y=M===-1,H=!U&&!Y||g;g=!1;const ee=H?"GO":Y?"BACK":"FORWARD",N=H?{type:"GO",index:M}:{type:Y?"BACK":"FORWARD"};if(O)O=!1;else{const V=s();if(typeof document<"u"&&V.length){for(const Z of V)if(await Z.blockerFn({currentLocation:d,nextLocation:L,action:ee})){m=!0,e.history.go(1),_.notify(N);return}}}d=u(),_.notify(N)},$=L=>{if(v){v=!1;return}let M=!1;const U=s();if(typeof document<"u"&&U.length)for(const Y of U){const H=Y.enableBeforeUnload??!0;if(H===!0){M=!0;break}if(typeof H=="function"&&H()===!0){M=!0;break}}if(M)return L.preventDefault(),L.returnValue=""},_=JX({getLocation:x,getLength:()=>e.history.length,pushState:(L,M)=>R("push",L,M),replaceState:(L,M)=>R("replace",L,M),back:L=>(L&&(O=!0),v=!0,e.history.back()),forward:L=>{L&&(O=!0),v=!0,e.history.forward()},go:L=>{g=!0,e.history.go(L)},createHref:L=>l(L),flush:Q,destroy:()=>{e.history.pushState=n,e.history.replaceState=r,e.removeEventListener(aR,$,{capture:!0}),e.removeEventListener(oR,P)},onBlocked:()=>{h&&d!==h&&(d=h)},getBlockers:s,setBlockers:a,notifyOnIndexChange:!1});return e.addEventListener(aR,$,{capture:!0}),e.addEventListener(oR,P),e.history.pushState=function(...L){const M=n.apply(e.history,L);return _._ignoreSubscribers||E("PUSH"),M},e.history.replaceState=function(...L){const M=r.apply(e.history,L);return _._ignoreSubscribers||E("REPLACE"),M},_}function tB(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}function Rm(t,e){const n=tB(t),r=n.indexOf("#"),i=n.indexOf("?"),s=Mw();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:e||{[Aa]:0,key:s,__TSR_key:s}}}function Mw(){return(Math.random()+1).toString(36).substring(7)}const nB=!1;function Cd(t){let e;return FX(()=>{e=t()}),e}function Zd(t){return t[t.length-1]}function rB(t){return typeof t=="function"}function Ta(t,e){return rB(t)?t(e):t}const iB=Object.prototype.hasOwnProperty,cR=Object.prototype.propertyIsEnumerable;function si(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=e,i=dR(t)&&dR(r);if(!i&&!(Am(t)&&Am(r)))return r;const s=i?t:uR(t);if(!s)return r;const a=i?r:uR(r);if(!a)return r;const l=s.length,u=a.length,d=i?new Array(u):{};let h=0;for(let g=0;g<u;g++){const m=i?g:a[g],O=t[m],v=r[m];if(O===v){d[m]=O,(i?g<l:iB.call(t,m))&&h++;continue}if(O===null||v===null||typeof O!="object"||typeof v!="object"){d[m]=v;continue}const x=si(O,v,n+1);d[m]=x,x===O&&h++}return l===u&&h===l?t:d}function uR(t){const e=Object.getOwnPropertyNames(t);for(const i of e)if(!cR.call(t,i))return!1;const n=Object.getOwnPropertySymbols(t);if(n.length===0)return e;const r=e;for(const i of n){if(!cR.call(t,i))return!1;r.push(i)}return r}function Am(t){if(!fR(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const n=e.prototype;return!(!fR(n)||!n.hasOwnProperty("isPrototypeOf"))}function fR(t){return Object.prototype.toString.call(t)==="[object Object]"}function dR(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ql(t,e,n){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0,i=t.length;r<i;r++)if(!Ql(t[r],e[r],n))return!1;return!0}if(Am(t)&&Am(e)){const r=(n==null?void 0:n.ignoreUndefined)??!0;if(n!=null&&n.partial){for(const a in e)if((!r||e[a]!==void 0)&&!Ql(t[a],e[a],n))return!1;return!0}let i=0;if(!r)i=Object.keys(t).length;else for(const a in t)t[a]!==void 0&&i++;let s=0;for(const a in e)if((!r||e[a]!==void 0)&&(s++,s>i||!Ql(t[a],e[a],n)))return!1;return i===s}return!1}function pu(t){let e,n;const r=new Promise((i,s)=>{e=i,n=s});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,e(i),t==null||t(i)},r.reject=i=>{r.status="rejected",n(i)},r}function Fc(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}function sB(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}function hR(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return sB(e)}const K$=["http:","https:","mailto:","tel:"];function Pm(t){if(!t)return!1;try{const e=new URL(t);return!K$.includes(e.protocol)}catch{return!1}}function qf(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};const e=/%25|%5C/gi;let n=0,r="",i;for(;(i=e.exec(t))!==null;)r+=hR(t.slice(n,i.index))+i[0],n=e.lastIndex;r=r+hR(n?t.slice(n):t);let s=!1;return r.startsWith("//")&&(s=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:s}}function oB(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}var aB="Invariant failed";function $o(t,e){if(!t)throw new Error(aB)}function _m(t){const e=new Map;let n,r;const i=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,n=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const a=e.get(s);if(a)return i(a),a.value},set(s,a){if(e.size>=t&&n){const u=n;e.delete(u.key),u.next&&(n=u.next,u.next.prev=void 0),u===r&&(r=void 0)}const l=e.get(s);if(l)l.value=a,i(l);else{const u={key:s,value:a,prev:r};r&&(r.next=u),r=u,n||(n=u),e.set(s,u)}},clear(){e.clear(),n=void 0,r=void 0}}}const gu=0,Pl=1,_l=2,Xd=3,xl=4,J$=5;function lB(t){const e=t.indexOf("{");if(e===-1)return null;const n=t.indexOf("}",e);return n===-1||e+1>=t.length?null:[e,n]}function Dw(t,e,n=new Uint16Array(6)){const r=t.indexOf("/",e),i=r===-1?t.length:r,s=t.substring(e,i);if(!s||!s.includes("$"))return n[0]=gu,n[1]=e,n[2]=e,n[3]=i,n[4]=i,n[5]=i,n;if(s==="$"){const l=t.length;return n[0]=_l,n[1]=e,n[2]=e,n[3]=l,n[4]=l,n[5]=l,n}if(s.charCodeAt(0)===36)return n[0]=Pl,n[1]=e,n[2]=e+1,n[3]=i,n[4]=i,n[5]=i,n;const a=lB(s);if(a){const[l,u]=a,d=s.charCodeAt(l+1);if(d===45){if(l+2<s.length&&s.charCodeAt(l+2)===36){const h=l+3,g=u;if(h<g)return n[0]=Xd,n[1]=e+l,n[2]=e+h,n[3]=e+g,n[4]=e+u+1,n[5]=i,n}}else if(d===36){const h=l+1,g=l+2;return g===u?(n[0]=_l,n[1]=e+l,n[2]=e+h,n[3]=e+g,n[4]=e+u+1,n[5]=t.length,n):(n[0]=Pl,n[1]=e+l,n[2]=e+g,n[3]=e+u,n[4]=e+u+1,n[5]=i,n)}}return n[0]=gu,n[1]=e,n[2]=e,n[3]=i,n[4]=i,n[5]=i,n}function jO(t,e,n,r,i,s,a){var u,d,h,g,m,O,v,x,k,C,Q,R,E;a==null||a(n);let l=r;{const P=n.fullPath??n.from,$=P.length,_=((u=n.options)==null?void 0:u.caseSensitive)??t,D=!!((h=(d=n.options)==null?void 0:d.params)!=null&&h.parse&&((m=(g=n.options)==null?void 0:g.skipRouteOnParseError)!=null&&m.params));for(;l<$;){const L=Dw(P,l,e);let M;const U=l,Y=L[5];switch(l=Y+1,s++,L[0]){case gu:{const ee=P.substring(L[2],L[3]);if(_){const N=(O=i.static)==null?void 0:O.get(ee);if(N)M=N;else{i.static??(i.static=new Map);const V=Sl(n.fullPath??n.from);V.parent=i,V.depth=s,M=V,i.static.set(ee,V)}}else{const N=ee.toLowerCase(),V=(v=i.staticInsensitive)==null?void 0:v.get(N);if(V)M=V;else{i.staticInsensitive??(i.staticInsensitive=new Map);const Z=Sl(n.fullPath??n.from);Z.parent=i,Z.depth=s,M=Z,i.staticInsensitive.set(N,Z)}}break}case Pl:{const ee=P.substring(U,L[1]),N=P.substring(L[4],Y),V=_&&!!(ee||N),Z=ee?V?ee:ee.toLowerCase():void 0,W=N?V?N:N.toLowerCase():void 0,fe=!D&&((x=i.dynamic)==null?void 0:x.find(se=>!se.skipOnParamError&&se.caseSensitive===V&&se.prefix===Z&&se.suffix===W));if(fe)M=fe;else{const se=cv(Pl,n.fullPath??n.from,V,Z,W);M=se,se.depth=s,se.parent=i,i.dynamic??(i.dynamic=[]),i.dynamic.push(se)}break}case Xd:{const ee=P.substring(U,L[1]),N=P.substring(L[4],Y),V=_&&!!(ee||N),Z=ee?V?ee:ee.toLowerCase():void 0,W=N?V?N:N.toLowerCase():void 0,fe=!D&&((k=i.optional)==null?void 0:k.find(se=>!se.skipOnParamError&&se.caseSensitive===V&&se.prefix===Z&&se.suffix===W));if(fe)M=fe;else{const se=cv(Xd,n.fullPath??n.from,V,Z,W);M=se,se.parent=i,se.depth=s,i.optional??(i.optional=[]),i.optional.push(se)}break}case _l:{const ee=P.substring(U,L[1]),N=P.substring(L[4],Y),V=_&&!!(ee||N),Z=ee?V?ee:ee.toLowerCase():void 0,W=N?V?N:N.toLowerCase():void 0,fe=cv(_l,n.fullPath??n.from,V,Z,W);M=fe,fe.parent=i,fe.depth=s,i.wildcard??(i.wildcard=[]),i.wildcard.push(fe)}}i=M}if(D&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const L=Sl(n.fullPath??n.from);L.kind=J$,L.parent=i,s++,L.depth=s,i.pathless??(i.pathless=[]),i.pathless.push(L),i=L}const B=(n.path||!n.children)&&!n.isRoot;if(B&&P.endsWith("/")){const L=Sl(n.fullPath??n.from);L.kind=xl,L.parent=i,s++,L.depth=s,i.index=L,i=L}i.parse=((Q=(C=n.options)==null?void 0:C.params)==null?void 0:Q.parse)??null,i.skipOnParamError=D,i.parsingPriority=((E=(R=n.options)==null?void 0:R.skipRouteOnParseError)==null?void 0:E.priority)??0,B&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const P of n.children)jO(t,e,P,l,i,s,a)}function lv(t,e){if(t.skipOnParamError&&!e.skipOnParamError)return-1;if(!t.skipOnParamError&&e.skipOnParamError)return 1;if(t.skipOnParamError&&e.skipOnParamError&&(t.parsingPriority||e.parsingPriority))return e.parsingPriority-t.parsingPriority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}function ya(t){var e,n,r;if(t.pathless)for(const i of t.pathless)ya(i);if(t.static)for(const i of t.static.values())ya(i);if(t.staticInsensitive)for(const i of t.staticInsensitive.values())ya(i);if((e=t.dynamic)!=null&&e.length){t.dynamic.sort(lv);for(const i of t.dynamic)ya(i)}if((n=t.optional)!=null&&n.length){t.optional.sort(lv);for(const i of t.optional)ya(i)}if((r=t.wildcard)!=null&&r.length){t.wildcard.sort(lv);for(const i of t.wildcard)ya(i)}}function Sl(t){return{kind:gu,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function cv(t,e,n,r,i){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function cB(t,e){const n=Sl("/"),r=new Uint16Array(6);for(const i of t)jO(!1,r,i,1,n,0);ya(n),e.masksTree=n,e.flatCache=_m(1e3)}function uB(t,e){t||(t="/");const n=e.flatCache.get(t);if(n)return n;const r=Nw(t,e.masksTree);return e.flatCache.set(t,r),r}function fB(t,e,n,r,i){t||(t="/"),r||(r="/");const s=e?`case\0${t}`:t;let a=i.singleCache.get(s);if(!a){a=Sl("/");const l=new Uint16Array(6);jO(e,l,{from:t},1,a,0),i.singleCache.set(s,a)}return Nw(r,a,n)}function dB(t,e,n=!1){const r=n?t:`nofuzz\0${t}`,i=e.matchCache.get(r);if(i!==void 0)return i;t||(t="/");let s;try{s=Nw(t,e.segmentTree,n)}catch(a){if(a instanceof URIError)s=null;else throw a}return s&&(s.branch=gB(s.route)),e.matchCache.set(r,s),s}function hB(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function pB(t,e=!1,n){const r=Sl(t.fullPath),i=new Uint16Array(6),s={},a={};let l=0;return jO(e,i,t,1,r,0,d=>{if(n==null||n(d,l),$o(!(d.id in s),`Duplicate routes found with id: ${String(d.id)}`),s[d.id]=d,l!==0&&d.path){const h=hB(d.fullPath);(!a[h]||d.fullPath.endsWith("/"))&&(a[h]=d)}l++}),ya(r),{processedTree:{segmentTree:r,singleCache:_m(1e3),matchCache:_m(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:a}}function Nw(t,e,n=!1){const r=t.split("/"),i=OB(t,r,e,n);if(!i)return null;const[s]=eM(t,r,i);return{route:i.node.route,rawParams:s,parsedParams:i.parsedParams}}function eM(t,e,n){var h,g,m,O,v,x,k,C,Q,R;const r=mB(n.node);let i=null;const s={};let a=((h=n.extract)==null?void 0:h.part)??0,l=((g=n.extract)==null?void 0:g.node)??0,u=((m=n.extract)==null?void 0:m.path)??0,d=((O=n.extract)==null?void 0:O.segment)??0;for(;l<r.length;a++,l++,u++,d++){const E=r[l];if(E.kind===xl)break;if(E.kind===J$){d--,a--,u--;continue}const P=e[a],$=u;if(P&&(u+=P.length),E.kind===Pl){i??(i=n.node.fullPath.split("/"));const _=i[d],D=((v=E.prefix)==null?void 0:v.length)??0;if(_.charCodeAt(D)===123){const L=((x=E.suffix)==null?void 0:x.length)??0,M=_.substring(D+2,_.length-L-1),U=P.substring(D,P.length-L);s[M]=decodeURIComponent(U)}else{const L=_.substring(1);s[L]=decodeURIComponent(P)}}else if(E.kind===Xd){if(n.skipped&1<<l){a--,u=$-1;continue}i??(i=n.node.fullPath.split("/"));const _=i[d],D=((k=E.prefix)==null?void 0:k.length)??0,B=((C=E.suffix)==null?void 0:C.length)??0,L=_.substring(D+3,_.length-B-1),M=E.suffix||E.prefix?P.substring(D,P.length-B):P;M&&(s[L]=decodeURIComponent(M))}else if(E.kind===_l){const _=E,D=t.substring($+(((Q=_.prefix)==null?void 0:Q.length)??0),t.length-(((R=_.suffix)==null?void 0:R.length)??0)),B=decodeURIComponent(D);s["*"]=B,s._splat=B;break}}return n.rawParams&&Object.assign(s,n.rawParams),[s,{part:a,node:l,path:u,segment:d}]}function gB(t){const e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}function mB(t){const e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}function OB(t,e,n,r){if(t==="/"&&n.index)return{node:n.index,skipped:0};const i=!Zd(e),s=i&&t!=="/",a=e.length-(i?1:0),l=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let u=null,d=null,h=null;for(;l.length;){const g=l.pop(),{node:m,index:O,skipped:v,depth:x,statics:k,dynamics:C,optionals:Q}=g;let{extract:R,rawParams:E,parsedParams:P}=g;if(m.skipOnParamError){if(!uv(t,e,g))continue;E=g.rawParams,R=g.extract,P=g.parsedParams}r&&m.route&&m.kind!==xl&&Yf(d,g)&&(d=g);const $=O===a;if($&&(m.route&&!s&&Yf(h,g)&&(h=g),!m.optional&&!m.wildcard&&!m.index&&!m.pathless))continue;const _=$?void 0:e[O];let D;if($&&m.index){const B={node:m.index,index:O,skipped:v,depth:x+1,statics:k,dynamics:C,optionals:Q,extract:R,rawParams:E,parsedParams:P};let L=!0;if(m.index.skipOnParamError&&(uv(t,e,B)||(L=!1)),L){if(k===a&&!C&&!Q&&!v)return B;Yf(h,B)&&(h=B)}}if(m.wildcard&&Yf(u,g))for(const B of m.wildcard){const{prefix:L,suffix:M}=B;if(L&&($||!(B.caseSensitive?_:D??(D=_.toLowerCase())).startsWith(L)))continue;if(M){if($)continue;const Y=e.slice(O).join("/").slice(-M.length);if((B.caseSensitive?Y:Y.toLowerCase())!==M)continue}const U={node:B,index:a,skipped:v,depth:x,statics:k,dynamics:C,optionals:Q,extract:R,rawParams:E,parsedParams:P};if(!(B.skipOnParamError&&!uv(t,e,U))){u=U;break}}if(m.optional){const B=v|1<<x,L=x+1;for(let M=m.optional.length-1;M>=0;M--){const U=m.optional[M];l.push({node:U,index:O,skipped:B,depth:L,statics:k,dynamics:C,optionals:Q,extract:R,rawParams:E,parsedParams:P})}if(!$)for(let M=m.optional.length-1;M>=0;M--){const U=m.optional[M],{prefix:Y,suffix:H}=U;if(Y||H){const ee=U.caseSensitive?_:D??(D=_.toLowerCase());if(Y&&!ee.startsWith(Y)||H&&!ee.endsWith(H))continue}l.push({node:U,index:O+1,skipped:v,depth:L,statics:k,dynamics:C,optionals:Q+1,extract:R,rawParams:E,parsedParams:P})}}if(!$&&m.dynamic&&_)for(let B=m.dynamic.length-1;B>=0;B--){const L=m.dynamic[B],{prefix:M,suffix:U}=L;if(M||U){const Y=L.caseSensitive?_:D??(D=_.toLowerCase());if(M&&!Y.startsWith(M)||U&&!Y.endsWith(U))continue}l.push({node:L,index:O+1,skipped:v,depth:x+1,statics:k,dynamics:C+1,optionals:Q,extract:R,rawParams:E,parsedParams:P})}if(!$&&m.staticInsensitive){const B=m.staticInsensitive.get(D??(D=_.toLowerCase()));B&&l.push({node:B,index:O+1,skipped:v,depth:x+1,statics:k+1,dynamics:C,optionals:Q,extract:R,rawParams:E,parsedParams:P})}if(!$&&m.static){const B=m.static.get(_);B&&l.push({node:B,index:O+1,skipped:v,depth:x+1,statics:k+1,dynamics:C,optionals:Q,extract:R,rawParams:E,parsedParams:P})}if(m.pathless){const B=x+1;for(let L=m.pathless.length-1;L>=0;L--){const M=m.pathless[L];l.push({node:M,index:O,skipped:v,depth:B,statics:k,dynamics:C,optionals:Q,extract:R,rawParams:E,parsedParams:P})}}}if(h&&u)return Yf(u,h)?h:u;if(h)return h;if(u)return u;if(r&&d){let g=d.index;for(let O=0;O<d.index;O++)g+=e[O].length;const m=g===t.length?"/":t.slice(g);return d.rawParams??(d.rawParams={}),d.rawParams["**"]=decodeURIComponent(m),d}return null}function uv(t,e,n){try{const[r,i]=eM(t,e,n);n.rawParams=r,n.extract=i;const s=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,s),!0}catch{return null}}function Yf(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===xl)>(t.node.kind===xl)||e.node.kind===xl==(t.node.kind===xl)&&e.depth>t.depth))):!0}function nm(t){return Lw(t.filter(e=>e!==void 0).join("/"))}function Lw(t){return t.replace(/\/{2,}/g,"/")}function tM(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function Co(t){const e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}function nM(t){return Co(tM(t))}function $m(t,e){return t!=null&&t.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function yB(t,e,n){return $m(t,n)===$m(e,n)}function bB({base:t,to:e,trailingSlash:n="never",cache:r}){const i=e.startsWith("/"),s=!i&&e===".";let a;if(r){a=i?e:s?t:t+"\0"+e;const g=r.get(a);if(g)return g}let l;if(s)l=t.split("/");else if(i)l=e.split("/");else{for(l=t.split("/");l.length>1&&Zd(l)==="";)l.pop();const g=e.split("/");for(let m=0,O=g.length;m<O;m++){const v=g[m];v===""?m?m===O-1&&l.push(v):l=[v]:v===".."?l.pop():v==="."||l.push(v)}}l.length>1&&(Zd(l)===""?n==="never"&&l.pop():n==="always"&&l.push(""));let u,d="";for(let g=0;g<l.length;g++){g>0&&(d+="/");const m=l[g];if(!m)continue;u=Dw(m,0,u);const O=u[0];if(O===gu){d+=m;continue}const v=u[5],x=m.substring(0,u[1]),k=m.substring(u[4],v),C=m.substring(u[2],u[3]);O===Pl?d+=x||k?`${x}{$${C}}${k}`:`$${C}`:O===_l?d+=x||k?`${x}{$}${k}`:"$":d+=`${x}{-$${C}}${k}`}d=Lw(d);const h=d||"/";return a&&r&&r.set(a,h),h}function vB(t){const e=new Map(t.map(i=>[encodeURIComponent(i),i])),n=Array.from(e.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,s=>e.get(s)??s)}function fv(t,e,n){const r=e[t];return typeof r!="string"?r:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>pR(i,n)).join("/"):pR(r,n)}function dv({path:t,params:e,decoder:n,...r}){let i=!1;const s={};if(!t||t==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:i};if(!t.includes("$"))return{interpolatedPath:t,usedParams:s,isMissingParams:i};const a=t.length;let l=0,u,d="";for(;l<a;){const g=l;u=Dw(t,g,u);const m=u[5];if(l=m+1,g===m)continue;const O=u[0];if(O===gu){d+="/"+t.substring(g,m);continue}if(O===_l){const v=e._splat;s._splat=v,s["*"]=v;const x=t.substring(g,u[1]),k=t.substring(u[4],m);if(!v){i=!0,(x||k)&&(d+="/"+x+k);continue}const C=fv("_splat",e,n);d+="/"+x+C+k;continue}if(O===Pl){const v=t.substring(u[2],u[3]);!i&&!(v in e)&&(i=!0),s[v]=e[v];const x=t.substring(g,u[1]),k=t.substring(u[4],m),C=fv(v,e,n)??"undefined";d+="/"+x+C+k;continue}if(O===Xd){const v=t.substring(u[2],u[3]),x=e[v];if(x==null)continue;s[v]=x;const k=t.substring(g,u[1]),C=t.substring(u[4],m),Q=fv(v,e,n)??"";d+="/"+k+Q+C;continue}}return t.endsWith("/")&&(d+="/"),{usedParams:s,interpolatedPath:d||"/",isMissingParams:i}}function pR(t,e){const n=encodeURIComponent(t);return(e==null?void 0:e(n))??n}function di(t){return!!(t!=null&&t.isNotFound)}function xB(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Yx="tsr-scroll-restoration-v1_3",SB=(t,e)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{t(...r),n=null},e))}};function wB(){const t=xB();if(!t)return null;const e=t.getItem(Yx);let n=e?JSON.parse(e):{};return{state:n,set:r=>{n=Ta(r,n)||n;try{t.setItem(Yx,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const pg=wB(),kB=t=>t.state.__TSR_key||t.href;function CB(t){const e=[];let n;for(;n=t.parentNode;)e.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,t)+1})`),t=n;return`${e.reverse().join(" > ")}`.toLowerCase()}let Mm=!1;function TB({storageKey:t,key:e,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:s}){var d,h;let a;try{a=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(g){console.error(g);return}const l=e||((d=window.history.state)==null?void 0:d.__TSR_key),u=a[l];Mm=!0;e:{if(r&&u&&Object.keys(u).length>0){for(const O in u){const v=u[O];if(O==="window")window.scrollTo({top:v.scrollY,left:v.scrollX,behavior:n});else if(O){const x=document.querySelector(O);x&&(x.scrollLeft=v.scrollX,x.scrollTop=v.scrollY)}}break e}const g=(s??window.location).hash.split("#",2)[1];if(g){const O=((h=window.history.state)==null?void 0:h.__hashScrollIntoViewOptions)??!0;if(O){const v=document.getElementById(g);v&&v.scrollIntoView(O)}break e}const m={top:0,left:0,behavior:n};if(window.scrollTo(m),i)for(const O of i){if(O==="window")continue;const v=typeof O=="function"?O():document.querySelector(O);v&&v.scrollTo(m)}}Mm=!1}function QB(t,e){if(!pg||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isScrollRestorationSetup||!pg))return;t.isScrollRestorationSetup=!0,Mm=!1;const r=t.options.getScrollRestorationKey||kB;window.history.scrollRestoration="manual";const i=s=>{if(Mm||!t.isScrollRestoring)return;let a="";if(s.target===document||s.target===window)a="window";else{const u=s.target.getAttribute("data-scroll-restoration-id");u?a=`[data-scroll-restoration-id="${u}"]`:a=CB(s.target)}const l=r(t.state.location);pg.set(u=>{const d=u[l]||(u[l]={}),h=d[a]||(d[a]={});if(a==="window")h.scrollX=window.scrollX||0,h.scrollY=window.scrollY||0;else if(a){const g=document.querySelector(a);g&&(h.scrollX=g.scrollLeft||0,h.scrollY=g.scrollTop||0)}return u})};typeof document<"u"&&document.addEventListener("scroll",SB(i,100),!0),t.subscribe("onRendered",s=>{const a=r(s.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(TB({storageKey:Yx,key:a,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&pg.set(l=>(l[a]||(l[a]={}),l)))})}function EB(t){if(typeof document<"u"&&document.querySelector){const e=t.state.location.state.__hashScrollIntoViewOptions??!0;if(e&&t.state.location.hash!==""){const n=document.getElementById(t.state.location.hash);n&&n.scrollIntoView(e)}}}function RB(t,e=String){const n=new URLSearchParams;for(const r in t){const i=t[r];i!==void 0&&n.set(r,e(i))}return n.toString()}function hv(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function AB(t){const e=new URLSearchParams(t),n={};for(const[r,i]of e.entries()){const s=n[r];s==null?n[r]=hv(i):Array.isArray(s)?s.push(hv(i)):n[r]=[s,hv(i)]}return n}const PB=$B(JSON.parse),_B=MB(JSON.stringify,JSON.parse);function $B(t){return e=>{e[0]==="?"&&(e=e.substring(1));const n=AB(e);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=t(i)}catch{}}return n}}function MB(t,e){const n=typeof e=="function";function r(i){if(typeof i=="object"&&i!==null)try{return t(i)}catch{}else if(n&&typeof i=="string")try{return e(i),t(i)}catch{}return i}return i=>{const s=RB(i,r);return s?`?${s}`:""}}const $i="__root__";function wh(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&typeof t.href=="string"&&Pm(t.href))throw new Error(`Redirect blocked: unsafe protocol in href "${t.href}". Only ${K$.join(", ")} protocols are allowed.`);if(!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);const n=new Response(null,{status:t.statusCode,headers:e});if(n.options=t,t.throw)throw n;return n}function zi(t){return t instanceof Response&&!!t.options}const rm=t=>{var e;if(!t.rendered)return t.rendered=!0,(e=t.onReady)==null?void 0:e.call(t)},IO=(t,e)=>!!(t.preload&&!t.router.state.matches.some(n=>n.id===e)),Hc=(t,e,n=!0)=>{const r={...t.router.options.context??{}},i=n?e:e-1;for(let s=0;s<=i;s++){const a=t.matches[s];if(!a)continue;const l=t.router.getMatch(a.id);l&&Object.assign(r,l.__routeContext,l.__beforeLoadContext)}return r},rM=(t,e)=>{var i;const n=t.router.routesById[e.routeId??""]??t.router.routeTree;!n.options.notFoundComponent&&((i=t.router.options)!=null&&i.defaultNotFoundComponent)&&(n.options.notFoundComponent=t.router.options.defaultNotFoundComponent),$o(n.options.notFoundComponent);const r=t.matches.find(s=>s.routeId===n.id);$o(r,"Could not find match for route: "+n.id),t.updateMatch(r.id,s=>({...s,status:"notFound",error:e,isFetching:!1})),e.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(e.routeId=n.parentRoute.id,rM(t,e))},Qa=(t,e,n)=>{var r,i,s;if(!(!zi(n)&&!di(n))){if(zi(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(e){(r=e._nonReactive.beforeLoadPromise)==null||r.resolve(),(i=e._nonReactive.loaderPromise)==null||i.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0;const a=zi(n)?"redirected":"notFound";e._nonReactive.error=n,t.updateMatch(e.id,l=>({...l,status:a,context:Hc(t,e.index),isFetching:!1,error:n})),di(n)&&!n.routeId&&(n.routeId=e.routeId),(s=e._nonReactive.loadPromise)==null||s.resolve()}throw zi(n)?(t.rendered=!0,n.options._fromLocation=t.location,n.redirectHandled=!0,n=t.router.resolveRedirect(n),n):(rM(t,n),n)}},iM=(t,e)=>!!t.router.getMatch(e)._nonReactive.dehydrated,Gf=(t,e,n,r)=>{var l,u;const{id:i,routeId:s}=t.matches[e],a=t.router.looseRoutesById[s];if(n instanceof Promise)throw n;n.routerCode=r,t.firstBadMatchIndex??(t.firstBadMatchIndex=e),Qa(t,t.router.getMatch(i),n);try{(u=(l=a.options).onError)==null||u.call(l,n)}catch(d){n=d,Qa(t,t.router.getMatch(i),n)}t.updateMatch(i,d=>{var h,g;return(h=d._nonReactive.beforeLoadPromise)==null||h.resolve(),d._nonReactive.beforeLoadPromise=void 0,(g=d._nonReactive.loadPromise)==null||g.resolve(),{...d,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}})},sM=(t,e,n,r)=>{var a;if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!IO(t,e)&&(n.options.loader||n.options.beforeLoad||lM(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??((a=t.router.options)==null?void 0:a.defaultPendingComponent)))){const l=setTimeout(()=>{rm(t)},i);r._nonReactive.pendingTimeout=l}},DB=(t,e,n)=>{const r=t.router.getMatch(e);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;sM(t,e,n,r);const i=()=>{const s=t.router.getMatch(e);s.preload&&(s.status==="redirected"||s.status==="notFound")&&Qa(t,s,s.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},NB=(t,e,n,r)=>{const i=t.router.getMatch(e),s=i._nonReactive.loadPromise;i._nonReactive.loadPromise=pu(()=>{s==null||s.resolve()});const{paramsError:a,searchError:l}=i;a&&Gf(t,n,a,"PARSE_PARAMS"),l&&Gf(t,n,l,"VALIDATE_SEARCH"),sM(t,e,r,i);const u=new AbortController;let d=!1;const h=()=>{d||(d=!0,t.updateMatch(e,E=>({...E,isFetching:"beforeLoad",fetchCount:E.fetchCount+1,abortController:u})))},g=()=>{var E;(E=i._nonReactive.beforeLoadPromise)==null||E.resolve(),i._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,P=>({...P,isFetching:!1}))};if(!r.options.beforeLoad){Cd(()=>{h(),g()});return}i._nonReactive.beforeLoadPromise=pu();const m={...Hc(t,n,!1),...i.__routeContext},{search:O,params:v,cause:x}=i,k=IO(t,e),C={search:O,abortController:u,params:v,preload:k,context:m,location:t.location,navigate:E=>t.router.navigate({...E,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:k?"preload":x,matches:t.matches,routeId:r.id,...t.router.options.additionalContext},Q=E=>{if(E===void 0){Cd(()=>{h(),g()});return}(zi(E)||di(E))&&(h(),Gf(t,n,E,"BEFORE_LOAD")),Cd(()=>{h(),t.updateMatch(e,P=>({...P,__beforeLoadContext:E})),g()})};let R;try{if(R=r.options.beforeLoad(C),Fc(R))return h(),R.catch(E=>{Gf(t,n,E,"BEFORE_LOAD")}).then(Q)}catch(E){h(),Gf(t,n,E,"BEFORE_LOAD")}Q(R)},LB=(t,e)=>{const{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r],s=()=>l(),a=()=>NB(t,n,e,i),l=()=>{if(iM(t,n))return;const u=DB(t,n,i);return Fc(u)?u.then(a):a()};return s()},zB=(t,e,n)=>{var s,a,l,u,d,h;const r=t.router.getMatch(e);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:t.router.options.ssr,matches:t.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([(a=(s=n.options).head)==null?void 0:a.call(s,i),(u=(l=n.options).scripts)==null?void 0:u.call(l,i),(h=(d=n.options).headers)==null?void 0:h.call(d,i)]).then(([g,m,O])=>{const v=g==null?void 0:g.meta,x=g==null?void 0:g.links,k=g==null?void 0:g.scripts,C=g==null?void 0:g.styles;return{meta:v,links:x,headScripts:k,headers:O,scripts:m,styles:C}})},oM=(t,e,n,r)=>{const i=t.matchPromises[n-1],{params:s,loaderDeps:a,abortController:l,cause:u}=t.router.getMatch(e),d=Hc(t,n),h=IO(t,e);return{params:s,deps:a,preload:!!h,parentMatchPromise:i,abortController:l,context:d,location:t.location,navigate:g=>t.router.navigate({...g,_fromLocation:t.location}),cause:h?"preload":u,route:r,...t.router.options.additionalContext}},gR=async(t,e,n,r)=>{var i,s,a,l,u,d,h;try{const g=t.router.getMatch(e);try{(!(nB??t.router.isServer)||g.ssr===!0)&&aM(r);const m=(s=(i=r.options).loader)==null?void 0:s.call(i,oM(t,e,n,r)),O=r.options.loader&&Fc(m);if(!!(O||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||g._nonReactive.minPendingPromise)&&t.updateMatch(e,k=>({...k,isFetching:"loader"})),r.options.loader){const k=O?await m:m;Qa(t,t.router.getMatch(e),k),k!==void 0&&t.updateMatch(e,C=>({...C,loaderData:k}))}r._lazyPromise&&await r._lazyPromise;const x=g._nonReactive.minPendingPromise;x&&await x,r._componentsPromise&&await r._componentsPromise,t.updateMatch(e,k=>({...k,error:void 0,context:Hc(t,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(m){let O=m;if((O==null?void 0:O.name)==="AbortError"){if(g.abortController.signal.aborted){(a=g._nonReactive.loaderPromise)==null||a.resolve(),g._nonReactive.loaderPromise=void 0;return}t.updateMatch(e,x=>({...x,status:x.status==="pending"?"success":x.status,isFetching:!1,context:Hc(t,n)}));return}const v=g._nonReactive.minPendingPromise;v&&await v,di(m)&&await((u=(l=r.options.notFoundComponent)==null?void 0:l.preload)==null?void 0:u.call(l)),Qa(t,t.router.getMatch(e),m);try{(h=(d=r.options).onError)==null||h.call(d,m)}catch(x){O=x,Qa(t,t.router.getMatch(e),x)}t.updateMatch(e,x=>({...x,error:O,context:Hc(t,n),status:"error",isFetching:!1}))}}catch(g){const m=t.router.getMatch(e);m&&(m._nonReactive.loaderPromise=void 0),Qa(t,m,g)}},jB=async(t,e)=>{var h,g;async function n(m,O,v,x){const k=Date.now()-O.updatedAt,C=m?x.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:x.options.staleTime??t.router.options.defaultStaleTime??0,Q=x.options.shouldReload,R=typeof Q=="function"?Q(oM(t,r,e,x)):Q,{status:E,invalid:P}=v;s=E==="success"&&(P||(R??k>C)),m&&x.options.preload===!1||(s&&!t.sync?(a=!0,(async()=>{var $,_;try{await gR(t,r,e,x);const D=t.router.getMatch(r);($=D._nonReactive.loaderPromise)==null||$.resolve(),(_=D._nonReactive.loadPromise)==null||_.resolve(),D._nonReactive.loaderPromise=void 0}catch(D){zi(D)&&await t.router.navigate(D.options)}})()):(E!=="success"||s&&t.sync)&&await gR(t,r,e,x))}const{id:r,routeId:i}=t.matches[e];let s=!1,a=!1;const l=t.router.looseRoutesById[i];if(!iM(t,r)){const m=t.router.getMatch(r),O=IO(t,r);if(m._nonReactive.loaderPromise){if(m.status==="success"&&!t.sync&&!m.preload)return m;await m._nonReactive.loaderPromise;const v=t.router.getMatch(r),x=v._nonReactive.error||v.error;x&&Qa(t,v,x),v.status==="pending"&&await n(O,m,v,l)}else{const v=O&&!t.router.state.matches.some(k=>k.id===r),x=t.router.getMatch(r);x._nonReactive.loaderPromise=pu(),v!==x.preload&&t.updateMatch(r,k=>({...k,preload:v})),await n(O,m,x,l)}}const u=t.router.getMatch(r);a||((h=u._nonReactive.loaderPromise)==null||h.resolve(),(g=u._nonReactive.loadPromise)==null||g.resolve()),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0,a||(u._nonReactive.loaderPromise=void 0),u._nonReactive.dehydrated=void 0;const d=a?u.isFetching:!1;return d!==u.isFetching||u.invalid!==!1?(t.updateMatch(r,m=>({...m,isFetching:d,invalid:!1})),t.router.getMatch(r)):u};async function mR(t){const e=Object.assign(t,{matchPromises:[]});e.router.state.matches.some(n=>n._forcePending)&&rm(e);try{for(let l=0;l<e.matches.length;l++){const u=LB(e,l);Fc(u)&&await u}const n=e.firstBadMatchIndex??e.matches.length;for(let l=0;l<n;l++)e.matchPromises.push(jB(e,l));const i=(await Promise.allSettled(e.matchPromises)).filter(l=>l.status==="rejected").map(l=>l.reason);let s;for(const l of i){if(zi(l))throw l;!s&&di(l)&&(s=l)}for(const l of e.matches){const{id:u,routeId:d}=l,h=e.router.looseRoutesById[d];try{const g=zB(e,u,h);if(g){const m=await g;e.updateMatch(u,O=>({...O,...m}))}}catch(g){console.error(`Error executing head for route ${d}:`,g)}}if(s)throw s;const a=rm(e);Fc(a)&&await a}catch(n){if(di(n)&&!e.preload){const r=rm(e);throw Fc(r)&&await r,n}if(zi(n))throw n}return e.matches}async function aM(t){if(!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(e=>{const{id:n,...r}=e.options;Object.assign(t.options,r),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const e=()=>{var r;const n=[];for(const i of cM){const s=(r=t.options[i])==null?void 0:r.preload;s&&n.push(s())}if(n.length)return Promise.all(n).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(e):e()}return t._componentsPromise}function lM(t){var e;for(const n of cM)if((e=t.options[n])!=null&&e.preload)return!0;return!1}const cM=["component","errorComponent","pendingComponent","notFoundComponent"];function IB(t){return{input:({url:e})=>{for(const n of t)e=Gx(n,e);return e},output:({url:e})=>{for(let n=t.length-1;n>=0;n--)e=uM(t[n],e);return e}}}function ZB(t){const e=nM(t.basepath),n=`/${e}`,r=`${n}/`,i=t.caseSensitive?n:n.toLowerCase(),s=t.caseSensitive?r:r.toLowerCase();return{input:({url:a})=>{const l=t.caseSensitive?a.pathname:a.pathname.toLowerCase();return l===i?a.pathname="/":l.startsWith(s)&&(a.pathname=a.pathname.slice(n.length)),a},output:({url:a})=>(a.pathname=nm(["/",e,a.pathname]),a)}}function Gx(t,e){var r;const n=(r=t==null?void 0:t.input)==null?void 0:r.call(t,{url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}function uM(t,e){var r;const n=(r=t==null?void 0:t.output)==null?void 0:r.call(t,{url:e});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return e}function El(t){const e=t.resolvedLocation,n=t.location,r=(e==null?void 0:e.pathname)!==n.pathname,i=(e==null?void 0:e.href)!==n.href,s=(e==null?void 0:e.hash)!==n.hash;return{fromLocation:e,toLocation:n,pathChanged:r,hrefChanged:i,hashChanged:s}}class XB{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{var m;n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,i=this.basepath??(r==null?void 0:r.basepath)??"/",s=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=vB(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=eB()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let O;this.resolvePathCache=_m(1e3),O=this.buildRouteTree(),this.setRoutes(O)}!this.__store&&this.latestLocation&&(this.__store=new KX(UB(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(O=>!["redirected"].includes(O.status))}}}),QB(this));let l=!1;const u=this.options.basepath??"/",d=this.options.rewrite;if(s||i!==u||a!==d){this.basepath=u;const O=[],v=nM(u);v&&v!=="/"&&O.push(ZB({basepath:u})),d&&O.push(d),this.rewrite=O.length===0?void 0:O.length===1?O[0]:IB(O),this.history&&this.updateLatestLocation(),l=!0}l&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof((m=window.CSS)==null?void 0:m.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=pB(this.routeTree,this.options.caseSensitive,(r,i)=>{r.init({originalIndex:i})});return this.options.routeMasks&&cB(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,r)=>{const i={eventType:n,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const i=({pathname:u,search:d,hash:h,href:g,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){const Q=this.options.parseSearch(d),R=this.options.stringifySearch(Q);return{href:u+R+h,publicHref:g,pathname:qf(u).path,external:!1,searchStr:R,search:si(r==null?void 0:r.search,Q),hash:qf(h.slice(1)).path,state:si(r==null?void 0:r.state,m)}}const O=new URL(g,this.origin),v=Gx(this.rewrite,O),x=this.options.parseSearch(v.search),k=this.options.stringifySearch(x);return v.search=k,{href:v.href.replace(v.origin,""),publicHref:g,pathname:qf(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:k,search:si(r==null?void 0:r.search,x),hash:qf(v.hash.slice(1)).path,state:si(r==null?void 0:r.state,m)}},s=i(n),{__tempLocation:a,__tempKey:l}=s.state;if(a&&(!l||l===this.tempLocationKey)){const u=i(a);return u.state.key=s.state.key,u.state.__TSR_key=s.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:s}}return s},this.resolvePathWithBase=(n,r)=>bB({base:n,to:Lw(r),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,r,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},i):this.matchRoutesInternal(n,r),this.getMatchedRoutes=n=>VB({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(s=>s.status==="pending"),r=this.state.matches.filter(s=>s.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(s=>{this.cancelMatch(s.id)})},this.buildLocation=n=>{const r=(s={})=>{var Y,H;const a=s._fromLocation||this.pendingBuiltLocation||this.latestLocation,l=this.matchRoutesLightweight(a);s.from;const u=s.unsafeRelative==="path"?a.pathname:s.from??l.fullPath,d=this.resolvePathWithBase(u,"."),h=l.search,g={...l.params},m=s.to?this.resolvePathWithBase(d,`${s.to}`):this.resolvePathWithBase(d,"."),O=s.params===!1||s.params===null?{}:(s.params??!0)===!0?g:Object.assign(g,Ta(s.params,g)),v=dv({path:m,params:O,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,x=this.getMatchedRoutes(v);let k=x.matchedRoutes;(x.foundRoute?x.foundRoute.path!=="/"&&x.routeParams["**"]:Co(v))&&this.options.notFoundRoute&&(k=[...k,this.options.notFoundRoute]);let Q=!1;if(Object.keys(O).length>0)for(const ee of k){const N=((Y=ee.options.params)==null?void 0:Y.stringify)??ee.options.stringifyParams;N&&(Q=!0,Object.assign(O,N(O)))}const R=n.leaveParams?m:qf(Q?dv({path:m,params:O,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:v).path;let E=h;if(n._includeValidateSearch&&((H=this.options.search)!=null&&H.strict)){const ee={};k.forEach(N=>{if(N.options.validateSearch)try{Object.assign(ee,im(N.options.validateSearch,{...ee,...E}))}catch{}}),E=ee}E=qB({search:E,dest:s,destRoutes:k,_includeValidateSearch:n._includeValidateSearch}),E=si(h,E);const P=this.options.stringifySearch(E),$=s.hash===!0?a.hash:s.hash?Ta(s.hash,a.hash):void 0,_=$?`#${$}`:"";let D=s.state===!0?a.state:s.state?Ta(s.state,a.state):{};D=si(a.state,D);const B=`${R}${P}${_}`;let L,M,U=!1;if(this.rewrite){const ee=new URL(B,this.origin),N=uM(this.rewrite,ee);L=ee.href.replace(ee.origin,""),N.origin!==this.origin?(M=N.href,U=!0):M=N.pathname+N.search+N.hash}else L=oB(B),M=L;return{publicHref:M,href:L,pathname:R,search:E,searchStr:P,state:D,hash:$??"",external:U,unmaskOnReload:s.unmaskOnReload}},i=(s={},a)=>{const l=r(s);let u=a?r(a):void 0;if(!u){const d={};if(this.options.routeMasks){const h=uB(l.pathname,this.processedTree);if(h){Object.assign(d,h.rawParams);const{from:g,params:m,...O}=h.route,v=m===!1||m===null?{}:(m??!0)===!0?d:Object.assign(d,Ta(m,d));a={from:n.from,...O,params:v},u=r(a)}}}return u&&(l.maskedLocation=u),l};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:r,...i})=>{const s=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(h=>{i.state[h]=this.latestLocation.state[h]});const d=Ql(i.state,this.latestLocation.state);return u.forEach(h=>{delete i.state[h]}),d},a=Co(this.latestLocation.href)===Co(i.href),l=this.commitLocationPromise;if(this.commitLocationPromise=pu(()=>{l==null||l.resolve()}),a&&s())this.load();else{let{maskedLocation:u,hashScrollIntoView:d,...h}=i;u&&(h={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:r})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:i,viewTransition:s,ignoreBlocker:a,href:l,...u}={})=>{if(l){const g=this.history.location.state.__TSR_index,m=Rm(l,{__TSR_index:n?g:g+1}),O=new URL(m.pathname,this.origin),v=Gx(this.rewrite,O);u.to=v.pathname,u.search=this.options.parseSearch(m.search),u.hash=m.hash.slice(1)}const d=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const h=this.commitLocation({...d,viewTransition:s,replace:n,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),h},this.navigate=async({to:n,reloadDocument:r,href:i,publicHref:s,...a})=>{var u;let l=!1;if(i)try{new URL(`${i}`),l=!0}catch{}if(l&&!r&&(r=!0),r){if(n!==void 0||!i){const h=this.buildLocation({to:n,...a});i=i??h.publicHref,s=s??h.publicHref}const d=!l&&s?s:i;if(Pm(d))return Promise.resolve();if(!a.ignoreBlocker){const h=this.history,g=((u=h.getBlockers)==null?void 0:u.call(h))??[];for(const m of g)if(m!=null&&m.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...a,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(i=>!n.some(s=>s.id===i.id))}))},this.load=async n=>{let r,i,s;for(s=new Promise(l=>{this.startTransition(async()=>{var u;try{this.beforeLoad();const d=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...El({resolvedLocation:h,location:d})}),this.emit({type:"onBeforeLoad",...El({resolvedLocation:h,location:d})}),await mR({router:this,sync:n==null?void 0:n.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let g=[],m=[],O=[];Cd(()=>{this.__store.setState(v=>{const x=v.matches,k=v.pendingMatches||v.matches;return g=x.filter(C=>!k.some(Q=>Q.id===C.id)),m=k.filter(C=>!x.some(Q=>Q.id===C.id)),O=k.filter(C=>x.some(Q=>Q.id===C.id)),{...v,isLoading:!1,loadedAt:Date.now(),matches:k,pendingMatches:void 0,cachedMatches:[...v.cachedMatches,...g.filter(C=>C.status!=="error"&&C.status!=="notFound")]}}),this.clearExpiredCache()}),[[g,"onLeave"],[m,"onEnter"],[O,"onStay"]].forEach(([v,x])=>{v.forEach(k=>{var C,Q;(Q=(C=this.looseRoutesById[k.routeId].options)[x])==null||Q.call(C,k)})})})})}})}catch(d){zi(d)?(r=d,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):di(d)&&(i=d),this.__store.setState(h=>({...h,statusCode:r?r.status:i?404:h.matches.some(g=>g.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===s&&((u=this.commitLocationPromise)==null||u.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),l()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.__store.state.matches.some(l=>l.status==="error")&&(a=500),a!==void 0&&this.__store.setState(l=>({...l,statusCode:a}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,a=this.state.resolvedLocation,l=typeof r.types=="function"?r.types(El({resolvedLocation:a,location:s})):r.types;if(l===!1){n();return}i={update:n,types:l}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{var s;const i=(s=this.state.pendingMatches)!=null&&s.some(a=>a.id===n)?"pendingMatches":this.state.matches.some(a=>a.id===n)?"matches":this.state.cachedMatches.some(a=>a.id===n)?"cachedMatches":"";i&&this.__store.setState(a=>{var l;return{...a,[i]:(l=a[i])==null?void 0:l.map(u=>u.id===n?r(u):u)}})})},this.getMatch=n=>{var i;const r=s=>s.id===n;return this.state.cachedMatches.find(r)??((i=this.state.pendingMatches)==null?void 0:i.find(r))??this.state.matches.find(r)},this.invalidate=n=>{const r=i=>{var s;return((s=n==null?void 0:n.filter)==null?void 0:s.call(n,i))??!0?{...i,invalid:!0,...n!=null&&n.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i};return this.__store.setState(i=>{var s;return{...i,matches:i.matches.map(r),cachedMatches:i.cachedMatches.map(r),pendingMatches:(s=i.pendingMatches)==null?void 0:s.map(r)}}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const r=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),s=this.getParsedLocationHref(i);n.options.href=s,n.headers.set("Location",s)}else if(r)try{const i=new URL(r);if(this.origin&&i.origin===this.origin){const s=i.pathname+i.search+i.hash;n.options.href=s,n.headers.set("Location",s)}}catch{}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n==null?void 0:n.filter;r!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(s=>!r(s))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const i=this.looseRoutesById[r.routeId];if(!i.options.loader)return!0;const s=(r.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=s};this.clearCache({filter:n})},this.loadRouteChunk=aM,this.preloadRoute=async n=>{const r=this.buildLocation(n);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(l=>l.id)),a=new Set([...s,...this.state.cachedMatches.map(l=>l.id)]);Cd(()=>{i.forEach(l=>{a.has(l.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,l]}))})});try{return i=await mR({router:this,matches:i,location:r,preload:!0,updateMatch:(l,u)=>{s.has(l)?i=i.map(d=>d.id===l?u(d):d):this.updateMatch(l,u)}}),i}catch(l){if(zi(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:r});di(l)||console.error(l);return}},this.matchRoute=(n,r)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},s=this.buildLocation(i);if(r!=null&&r.pending&&this.state.status!=="pending")return!1;const l=((r==null?void 0:r.pending)===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,u=fB(s.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,l.pathname,this.processedTree);return!u||n.params&&!Ql(u.rawParams,n.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?Ql(l.search,s.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??_B,parseSearch:e.parseSearch??PB}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:n,processedTree:r}){this.routesById=e,this.routesByPath=n,this.processedTree=r;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)}get looseRoutesById(){return this.routesById}getParentContext(e){return(e==null?void 0:e.id)?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,n){var m,O;const r=this.getMatchedRoutes(e.pathname),{foundRoute:i,routeParams:s,parsedParams:a}=r;let{matchedRoutes:l}=r,u=!1;(i?i.path!=="/"&&s["**"]:Co(e.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:u=!0);const d=u?GB(this.options.notFoundMode,l):void 0,h=new Array(l.length),g=new Map(this.state.matches.map(v=>[v.routeId,v]));for(let v=0;v<l.length;v++){const x=l[v],k=h[v-1];let C,Q,R;{const N=(k==null?void 0:k.search)??e.search,V=(k==null?void 0:k._strictSearch)??void 0;try{const Z=im(x.options.validateSearch,{...N})??void 0;C={...N,...Z},Q={...V,...Z},R=void 0}catch(Z){let W=Z;if(Z instanceof Dm||(W=new Dm(Z.message,{cause:Z})),n!=null&&n.throwOnError)throw W;C=N,Q={},R=W}}const E=((O=(m=x.options).loaderDeps)==null?void 0:O.call(m,{search:C}))??"",P=E?JSON.stringify(E):"",{interpolatedPath:$,usedParams:_}=dv({path:x.fullPath,params:s,decoder:this.pathParamsDecoder,server:this.isServer}),D=x.id+$+P,B=this.getMatch(D),L=g.get(x.id),M=(B==null?void 0:B._strictParams)??_;let U;if(!B)try{OR(x,_,a,M)}catch(N){if(di(N)||zi(N)?U=N:U=new BB(N.message,{cause:N}),n!=null&&n.throwOnError)throw U}Object.assign(s,M);const Y=L?"stay":"enter";let H;if(B)H={...B,cause:Y,params:(L==null?void 0:L.params)??s,_strictParams:M,search:si(L?L.search:B.search,C),_strictSearch:Q};else{const N=x.options.loader||x.options.beforeLoad||x.lazyFn||lM(x)?"pending":"success";H={id:D,ssr:x.options.ssr,index:v,routeId:x.id,params:(L==null?void 0:L.params)??s,_strictParams:M,pathname:$,updatedAt:Date.now(),search:L?si(L.search,C):C,_strictSearch:Q,searchError:void 0,status:N,isFetching:!1,error:void 0,paramsError:U,__routeContext:void 0,_nonReactive:{loadPromise:pu()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:Y,loaderDeps:L?si(L.loaderDeps,E):E,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:x.options.staticData||{},fullPath:x.fullPath}}n!=null&&n.preload||(H.globalNotFound=d===x.id),H.searchError=R;const ee=this.getParentContext(k);H.context={...ee,...H.__routeContext,...H.__beforeLoadContext},h[v]=H}for(let v=0;v<h.length;v++){const x=h[v],k=this.looseRoutesById[x.routeId],C=this.getMatch(x.id),Q=g.get(x.routeId);if(x.params=Q?si(Q.params,s):s,!C){const R=h[v-1],E=this.getParentContext(R);if(k.options.context){const P={deps:x.loaderDeps,params:x.params,context:E??{},location:e,navigate:$=>this.navigate({...$,_fromLocation:e}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:h,routeId:k.id};x.__routeContext=k.options.context(P)??void 0}x.context={...E,...x.__routeContext,...x.__beforeLoadContext}}}return h}matchRoutesLightweight(e){const{matchedRoutes:n,routeParams:r,parsedParams:i}=this.getMatchedRoutes(e.pathname),s=Zd(n),a={...e.search};for(const h of n)try{Object.assign(a,im(h.options.validateSearch,a))}catch{}const l=Zd(this.state.matches),u=l&&l.routeId===s.id&&e.pathname===this.state.location.pathname;let d;if(u)d=l.params;else{const h={...r};for(const g of n)try{OR(g,r,i??{},h)}catch{}d=h}return{matchedRoutes:n,fullPath:s.fullPath,search:a,params:d}}}class Dm extends Error{}class BB extends Error{}function UB(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function im(t,e){if(t==null)return{};if("~standard"in t){const n=t["~standard"].validate(e);if(n instanceof Promise)throw new Dm("Async validation not supported");if(n.issues)throw new Dm(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}function VB({pathname:t,routesById:e,processedTree:n}){const r={},i=Co(t);let s,a;const l=dB(i,n,!0);return l&&(s=l.route,Object.assign(r,l.rawParams),a=Object.assign({},l.parsedParams)),{matchedRoutes:(l==null?void 0:l.branch)||[e[$i]],routeParams:r,foundRoute:s,parsedParams:a}}function qB({search:t,dest:e,destRoutes:n,_includeValidateSearch:r}){return YB(n)(t,e,r??!1)}function YB(t){var i;const e={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const s of t){if("search"in s.options)(i=s.options.search)!=null&&i.middlewares&&e.middlewares.push(...s.options.search.middlewares);else if(s.options.preSearchFilters||s.options.postSearchFilters){const a=({search:l,next:u})=>{let d=l;"preSearchFilters"in s.options&&s.options.preSearchFilters&&(d=s.options.preSearchFilters.reduce((g,m)=>m(g),l));const h=u(d);return"postSearchFilters"in s.options&&s.options.postSearchFilters?s.options.postSearchFilters.reduce((g,m)=>m(g),h):h};e.middlewares.push(a)}if(s.options.validateSearch){const a=({search:l,next:u})=>{const d=u(l);if(!e._includeValidateSearch)return d;try{return{...d,...im(s.options.validateSearch,d)??void 0}}catch{return d}};e.middlewares.push(a)}}const n=({search:s})=>{const a=e.dest;return a.search?a.search===!0?s:Ta(a.search,s):{}};e.middlewares.push(n);const r=(s,a,l)=>{if(s>=l.length)return a;const u=l[s];return u({search:a,next:h=>r(s+1,h,l)})};return function(a,l,u){return e.dest=l,e._includeValidateSearch=u,r(0,a,e.middlewares)}}function GB(t,e){if(t!=="root")for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.children)return r.id}return $i}function OR(t,e,n,r){var s;const i=((s=t.options.params)==null?void 0:s.parse)??t.options.parseParams;if(i)if(t.options.skipRouteOnParseError)for(const a in e)a in n&&(r[a]=n[a]);else{const a=i(r);Object.assign(r,a)}}const WB="Error preloading route! ☝️";class fM{constructor(e){if(this.init=n=>{var d,h;this.originalIndex=n.originalIndex;const r=this.options,i=!(r!=null&&r.path)&&!(r!=null&&r.id);this.parentRoute=(h=(d=this.options).getParentRoute)==null?void 0:h.call(d),i?this._path=$i:this.parentRoute||$o(!1);let s=i?$i:r==null?void 0:r.path;s&&s!=="/"&&(s=tM(s));const a=(r==null?void 0:r.id)||s;let l=i?$i:nm([this.parentRoute.id===$i?"":this.parentRoute.id,a]);s===$i&&(s="/"),l!==$i&&(l=nm(["/",l]));const u=l===$i?"/":nm([this.parentRoute.fullPath,s]);this._path=s,this._id=l,this._fullPath=u,this._to=Co(u)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>wh({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class FB extends fM{constructor(e){super(e)}}const md=typeof window<"u"?w.useLayoutEffect:w.useEffect;function pv(t){const e=w.useRef({value:t,prev:null}),n=e.current.value;return t!==n&&(e.current={value:t,prev:n}),e.current.prev}function HB(t,e,n={},r={}){w.useEffect(()=>{if(!t.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([s])=>{e(s)},n);return i.observe(t.current),()=>{i.disconnect()}},[e,n,r.disabled,t])}function KB(t){const e=w.useRef(null);return w.useImperativeHandle(t,()=>e.current,[]),e}function zw(t){const e=t.errorComponent??jw;return S.jsx(JB,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:n,reset:r})=>n?w.createElement(e,{error:n,reset:r}):t.children})}class JB extends w.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,n){this.props.onCatch&&this.props.onCatch(e,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function jw({error:t}){const[e,n]=w.useState(!1);return S.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[S.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[S.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),S.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:e?"Hide Error":"Show Error"})]}),S.jsx("div",{style:{height:".25rem"}}),e?S.jsx("div",{children:S.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?S.jsx("code",{children:t.message}):null})}):null]})}function e4({children:t,fallback:e=null}){return dM()?S.jsx(it.Fragment,{children:t}):S.jsx(it.Fragment,{children:e})}function dM(){return it.useSyncExternalStore(t4,()=>!0,()=>!1)}function t4(){return()=>{}}var gv={exports:{}},mv={},Ov={exports:{}},yv={};/**
26
+ * @license React
27
+ * use-sync-external-store-shim.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var yR;function n4(){if(yR)return yv;yR=1;var t=_w();function e(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue;function l(g,m){var O=m(),v=r({inst:{value:O,getSnapshot:m}}),x=v[0].inst,k=v[1];return s(function(){x.value=O,x.getSnapshot=m,u(x)&&k({inst:x})},[g,O,m]),i(function(){return u(x)&&k({inst:x}),g(function(){u(x)&&k({inst:x})})},[g]),a(O),O}function u(g){var m=g.getSnapshot;g=g.value;try{var O=m();return!n(g,O)}catch{return!0}}function d(g,m){return m()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return yv.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,yv}var bR;function r4(){return bR||(bR=1,Ov.exports=n4()),Ov.exports}/**
34
+ * @license React
35
+ * use-sync-external-store-shim/with-selector.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var vR;function i4(){if(vR)return mv;vR=1;var t=_w(),e=r4();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,a=t.useEffect,l=t.useMemo,u=t.useDebugValue;return mv.useSyncExternalStoreWithSelector=function(d,h,g,m,O){var v=s(null);if(v.current===null){var x={hasValue:!1,value:null};v.current=x}else x=v.current;v=l(function(){function C($){if(!Q){if(Q=!0,R=$,$=m($),O!==void 0&&x.hasValue){var _=x.value;if(O(_,$))return E=_}return E=$}if(_=E,r(R,$))return _;var D=m($);return O!==void 0&&O(_,D)?(R=$,_):(R=$,E=D)}var Q=!1,R,E,P=g===void 0?null:g;return[function(){return C(h())},P===null?void 0:function(){return C(P())}]},[h,g,m,O]);var k=i(d,v[0],v[1]);return a(function(){x.hasValue=!0,x.value=k},[k]),u(k),k},mv}var xR;function s4(){return xR||(xR=1,gv.exports=i4()),gv.exports}var o4=s4();function a4(t,e=r=>r,n={}){const r=n.equal??l4;return o4.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,e,r)}function l4(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[r,i]of t)if(!e.has(r)||!Object.is(i,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();const n=SR(t);if(n.length!==SR(e).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(e,n[r])||!Object.is(t[n[r]],e[n[r]]))return!1;return!0}function SR(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}const bv=w.createContext(null);function hM(){return typeof document>"u"?bv:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=bv,bv)}function Oi(t){const e=w.useContext(hM());return t==null||t.warn,e}function hi(t){const e=Oi({warn:(t==null?void 0:t.router)===void 0}),n=(t==null?void 0:t.router)||e,r=w.useRef(void 0);return a4(n.__store,i=>{if(t!=null&&t.select){if(t.structuralSharing??n.options.defaultStructuralSharing){const s=si(r.current,t.select(i));return r.current=s,s}return t.select(i)}return i})}const ZO=w.createContext(void 0),c4=w.createContext(void 0);function Us(t){const e=w.useContext(t.from?c4:ZO);return hi({select:r=>{const i=r.matches.find(s=>t.from?t.from===s.routeId:s.id===e);if($o(!((t.shouldThrow??!0)&&!i),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),i!==void 0)return t.select?t.select(i):i},structuralSharing:t.structuralSharing})}function Iw(t){return Us({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function Zw(t){const{select:e,...n}=t;return Us({...n,select:r=>e?e(r.loaderDeps):r.loaderDeps})}function ju(t){return Us({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const n=t.strict===!1?e.params:e._strictParams;return t.select?t.select(n):n}})}function XO(t){return Us({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}function or(t){const e=Oi();return w.useCallback(n=>e.navigate({...n,from:n.from??(t==null?void 0:t.from)}),[t==null?void 0:t.from,e])}function Xw(t){const e=Oi(),n=or(),r=w.useRef(null);return md(()=>{r.current!==t&&(n(t),r.current=t)},[e,t,n]),null}var To=W$();const u4=jX(To);function f4(t,e){const n=Oi(),r=KB(e),{activeProps:i,inactiveProps:s,activeOptions:a,to:l,preload:u,preloadDelay:d,hashScrollIntoView:h,replace:g,startTransition:m,resetScroll:O,viewTransition:v,children:x,target:k,disabled:C,style:Q,className:R,onClick:E,onFocus:P,onMouseEnter:$,onMouseLeave:_,onTouchStart:D,ignoreBlocker:B,params:L,search:M,hash:U,state:Y,mask:H,reloadDocument:ee,unsafeRelative:N,from:V,_fromLocation:Z,...W}=t,fe=dM(),se=hi({select:Be=>Be.location.search,structuralSharing:!0}),ge=t.from,oe=w.useMemo(()=>({...t,from:ge}),[n,se,ge,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),he=w.useMemo(()=>n.buildLocation({...oe}),[n,oe]),me=he.maskedLocation?he.maskedLocation.publicHref:he.publicHref,Ce=he.maskedLocation?he.maskedLocation.external:he.external,Te=w.useMemo(()=>O4(me,Ce,n.history,C),[C,Ce,me,n.history]),Ye=w.useMemo(()=>{if(Te!=null&&Te.external)return Pm(Te.href)?void 0:Te.href;if(!y4(l)&&!(typeof l!="string"||l.indexOf(":")===-1))try{return new URL(l),Pm(l)?void 0:l}catch{}},[l,Te]),je=hi({select:Be=>{if(Ye)return!1;if(a!=null&&a.exact){if(!yB(Be.location.pathname,he.pathname,n.basepath))return!1}else{const Ue=$m(Be.location.pathname,n.basepath),gt=$m(he.pathname,n.basepath);if(!(Ue.startsWith(gt)&&(Ue.length===gt.length||Ue[gt.length]==="/")))return!1}return((a==null?void 0:a.includeSearch)??!0)&&!Ql(Be.location.search,he.search,{partial:!(a!=null&&a.exact),ignoreUndefined:!(a!=null&&a.explicitUndefined)})?!1:a!=null&&a.includeHash?fe&&Be.location.hash===he.hash:!0}}),ze=je?Ta(i,{})??d4:vv,Ct=je?vv:Ta(s,{})??vv,Fe=[R,ze.className,Ct.className].filter(Boolean).join(" "),Tt=(Q||ze.style||Ct.style)&&{...Q,...ze.style,...Ct.style},[lt,ut]=w.useState(!1),Qt=w.useRef(!1),on=t.reloadDocument||Ye?!1:u??n.options.defaultPreload,Ht=d??n.options.defaultPreloadDelay??0,Ge=w.useCallback(()=>{n.preloadRoute({...oe}).catch(Be=>{console.warn(Be),console.warn(WB)})},[n,oe]),It=w.useCallback(Be=>{Be!=null&&Be.isIntersecting&&Ge()},[Ge]);HB(r,It,m4,{disabled:!!C||on!=="viewport"}),w.useEffect(()=>{Qt.current||!C&&on==="render"&&(Ge(),Qt.current=!0)},[C,Ge,on]);const jn=Be=>{const Ue=Be.currentTarget.getAttribute("target"),gt=k!==void 0?k:Ue;if(!C&&!b4(Be)&&!Be.defaultPrevented&&(!gt||gt==="_self")&&Be.button===0){Be.preventDefault(),To.flushSync(()=>{ut(!0)});const Fn=n.subscribe("onResolved",()=>{Fn(),ut(!1)});n.navigate({...oe,replace:g,resetScroll:O,hashScrollIntoView:h,startTransition:m,viewTransition:v,ignoreBlocker:B})}};if(Ye)return{...W,ref:r,href:Ye,...x&&{children:x},...k&&{target:k},...C&&{disabled:C},...Q&&{style:Q},...R&&{className:R},...E&&{onClick:E},...P&&{onFocus:P},...$&&{onMouseEnter:$},..._&&{onMouseLeave:_},...D&&{onTouchStart:D}};const He=Be=>{C||on&&Ge()},Gr=He,Zt=Be=>{if(!(C||!on))if(!Ht)Ge();else{const Ue=Be.target;if(Wf.has(Ue))return;const gt=setTimeout(()=>{Wf.delete(Ue),Ge()},Ht);Wf.set(Ue,gt)}},In=Be=>{if(C||!on||!Ht)return;const Ue=Be.target,gt=Wf.get(Ue);gt&&(clearTimeout(gt),Wf.delete(Ue))};return{...W,...ze,...Ct,href:Te==null?void 0:Te.href,ref:r,onClick:Ff([E,jn]),onFocus:Ff([P,He]),onMouseEnter:Ff([$,Zt]),onMouseLeave:Ff([_,In]),onTouchStart:Ff([D,Gr]),disabled:!!C,target:k,...Tt&&{style:Tt},...Fe&&{className:Fe},...C&&h4,...je&&p4,...fe&&lt&&g4}}const vv={},d4={className:"active"},h4={role:"link","aria-disabled":!0},p4={"data-status":"active","aria-current":"page"},g4={"data-transitioning":"transitioning"},Wf=new WeakMap,m4={rootMargin:"100px"},Ff=t=>e=>{for(const n of t)if(n){if(e.defaultPrevented)return;n(e)}};function O4(t,e,n,r){if(!r)return e?{href:t,external:!0}:{href:n.createHref(t)||"/",external:!1}}function y4(t){if(typeof t!="string")return!1;const e=t.charCodeAt(0);return e===47?t.charCodeAt(1)!==47:e===46}const Bw=w.forwardRef((t,e)=>{const{_asChild:n,...r}=t,{type:i,...s}=f4(r,e),a=typeof r.children=="function"?r.children({isActive:s["data-status"]==="active"}):r.children;if(!n){const{disabled:l,...u}=s;return w.createElement("a",u,a)}return w.createElement(n,s,a)});function b4(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}let v4=class extends fM{constructor(e){super(e),this.useMatch=n=>Us({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Us({...n,from:this.id,select:r=>n!=null&&n.select?n.select(r.context):r.context}),this.useSearch=n=>XO({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>ju({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Zw({...n,from:this.id}),this.useLoaderData=n=>Iw({...n,from:this.id}),this.useNavigate=()=>or({from:this.fullPath}),this.Link=it.forwardRef((n,r)=>S.jsx(Bw,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function x4(t){return new v4(t)}class S4 extends FB{constructor(e){super(e),this.useMatch=n=>Us({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Us({...n,from:this.id,select:r=>n!=null&&n.select?n.select(r.context):r.context}),this.useSearch=n=>XO({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>ju({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Zw({...n,from:this.id}),this.useLoaderData=n=>Iw({...n,from:this.id}),this.useNavigate=()=>or({from:this.fullPath}),this.Link=it.forwardRef((n,r)=>S.jsx(Bw,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function w4(t){return new S4(t)}function ls(t){return typeof t=="object"?new wR(t,{silent:!0}).createRoute(t):new wR(t,{silent:!0}).createRoute}class wR{constructor(e,n){this.path=e,this.createRoute=r=>{this.silent;const i=x4(r);return i.isRoot=!1,i},this.silent=n==null?void 0:n.silent}}class kR{constructor(e){this.useMatch=n=>Us({select:n==null?void 0:n.select,from:this.options.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Us({from:this.options.id,select:r=>n!=null&&n.select?n.select(r.context):r.context}),this.useSearch=n=>XO({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.options.id}),this.useParams=n=>ju({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Zw({...n,from:this.options.id}),this.useLoaderData=n=>Iw({...n,from:this.options.id}),this.useNavigate=()=>{const n=Oi();return or({from:n.routesById[this.options.id].fullPath})},this.options=e,this.$$typeof=Symbol.for("react.memo")}}function CR(t){return typeof t=="object"?new kR(t):e=>new kR({id:t,...e})}function k4(){const t=Oi(),e=w.useRef({router:t,mounted:!1}),[n,r]=w.useState(!1),{hasPendingMatches:i,isLoading:s}=hi({select:g=>({isLoading:g.isLoading,hasPendingMatches:g.matches.some(m=>m.status==="pending")}),structuralSharing:!0}),a=pv(s),l=s||n||i,u=pv(l),d=s||i,h=pv(d);return t.startTransition=g=>{r(!0),w.startTransition(()=>{g(),r(!1)})},w.useEffect(()=>{const g=t.history.subscribe(t.load),m=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Co(t.latestLocation.publicHref)!==Co(m.publicHref)&&t.commitLocation({...m,replace:!0}),()=>{g()}},[t,t.history]),md(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(m){console.error(m)}})()},[t]),md(()=>{a&&!s&&t.emit({type:"onLoad",...El(t.state)})},[a,t,s]),md(()=>{h&&!d&&t.emit({type:"onBeforeRouteMount",...El(t.state)})},[d,h,t]),md(()=>{if(u&&!l){const g=El(t.state);t.emit({type:"onResolved",...g}),t.__store.setState(m=>({...m,status:"idle",resolvedLocation:m.location})),g.hrefChanged&&EB(t)}},[l,u,t]),null}function C4(t){const e=hi({select:n=>`not-found-${n.location.pathname}-${n.status}`});return S.jsx(zw,{getResetKey:()=>e,onCatch:(n,r)=>{var i;if(di(n))(i=t.onCatch)==null||i.call(t,n,r);else throw n},errorComponent:({error:n})=>{var r;if(di(n))return(r=t.fallback)==null?void 0:r.call(t,n);throw n},children:t.children})}function T4(){return S.jsx("p",{children:"Not Found"})}function Zc(t){return S.jsx(S.Fragment,{children:t.children})}function pM(t,e,n){return e.options.notFoundComponent?S.jsx(e.options.notFoundComponent,{...n}):t.options.defaultNotFoundComponent?S.jsx(t.options.defaultNotFoundComponent,{...n}):S.jsx(T4,{})}function Q4(){return Oi().isScrollRestoring,null}const gM=w.memo(function({matchId:e}){var x,k;const n=Oi(),r=hi({select:C=>{var E;const Q=C.matches.findIndex(P=>P.id===e),R=C.matches[Q];return $o(R),{routeId:R.routeId,ssr:R.ssr,_displayPending:R._displayPending,resetKey:C.loadedAt,parentRouteId:(E=C.matches[Q-1])==null?void 0:E.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],s=i.options.pendingComponent??n.options.defaultPendingComponent,a=s?S.jsx(s,{}):null,l=i.options.errorComponent??n.options.defaultErrorComponent,u=i.options.onCatch??n.options.defaultOnCatch,d=i.isRoot?i.options.notFoundComponent??((x=n.options.notFoundRoute)==null?void 0:x.options.component):i.options.notFoundComponent,h=r.ssr===!1||r.ssr==="data-only",g=(!i.isRoot||i.options.wrapInSuspense||h)&&(i.options.wrapInSuspense??s??(((k=i.options.errorComponent)==null?void 0:k.preload)||h))?w.Suspense:Zc,m=l?zw:Zc,O=d?C4:Zc,v=i.isRoot?i.options.shellComponent??Zc:Zc;return S.jsxs(v,{children:[S.jsx(ZO.Provider,{value:e,children:S.jsx(g,{fallback:a,children:S.jsx(m,{getResetKey:()=>r.resetKey,errorComponent:l||jw,onCatch:(C,Q)=>{if(di(C))throw C;u==null||u(C,Q)},children:S.jsx(O,{fallback:C=>{if(!d||C.routeId&&C.routeId!==r.routeId||!C.routeId&&!i.isRoot)throw C;return w.createElement(d,C)},children:h||r._displayPending?S.jsx(e4,{fallback:a,children:S.jsx(TR,{matchId:e})}):S.jsx(TR,{matchId:e})})})})}),r.parentRouteId===$i&&n.options.scrollRestoration?S.jsxs(S.Fragment,{children:[S.jsx(E4,{}),S.jsx(Q4,{})]}):null]})});function E4(){const t=Oi(),e=w.useRef(void 0);return S.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(e.current===void 0||e.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...El(t.state)}),e.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const TR=w.memo(function({matchId:e}){var u,d,h,g;const n=Oi(),{match:r,key:i,routeId:s}=hi({select:m=>{const O=m.matches.find(Q=>Q.id===e),v=O.routeId,x=n.routesById[v].options.remountDeps??n.options.defaultRemountDeps,k=x==null?void 0:x({routeId:v,loaderDeps:O.loaderDeps,params:O._strictParams,search:O._strictSearch});return{key:k?JSON.stringify(k):void 0,routeId:v,match:{id:O.id,status:O.status,error:O.error,invalid:O.invalid,_forcePending:O._forcePending,_displayPending:O._displayPending}}},structuralSharing:!0}),a=n.routesById[s],l=w.useMemo(()=>{const m=a.options.component??n.options.defaultComponent;return m?S.jsx(m,{},i):S.jsx(kh,{})},[i,a.options.component,n.options.defaultComponent]);if(r._displayPending)throw(u=n.getMatch(r.id))==null?void 0:u._nonReactive.displayPendingPromise;if(r._forcePending)throw(d=n.getMatch(r.id))==null?void 0:d._nonReactive.minPendingPromise;if(r.status==="pending"){const m=a.options.pendingMinMs??n.options.defaultPendingMinMs;if(m){const O=n.getMatch(r.id);if(O&&!O._nonReactive.minPendingPromise){const v=pu();O._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),O._nonReactive.minPendingPromise=void 0},m)}}throw(h=n.getMatch(r.id))==null?void 0:h._nonReactive.loadPromise}if(r.status==="notFound")return $o(di(r.error)),pM(n,a,r.error);if(r.status==="redirected")throw $o(zi(r.error)),(g=n.getMatch(r.id))==null?void 0:g._nonReactive.loadPromise;if(r.status==="error")throw r.error;return l}),kh=w.memo(function(){const e=Oi(),n=w.useContext(ZO),r=hi({select:d=>{var h;return(h=d.matches.find(g=>g.id===n))==null?void 0:h.routeId}}),i=e.routesById[r],s=hi({select:d=>{const g=d.matches.find(m=>m.id===n);return $o(g),g.globalNotFound}}),a=hi({select:d=>{var m;const h=d.matches,g=h.findIndex(O=>O.id===n);return(m=h[g+1])==null?void 0:m.id}}),l=e.options.defaultPendingComponent?S.jsx(e.options.defaultPendingComponent,{}):null;if(s)return pM(e,i,void 0);if(!a)return null;const u=S.jsx(gM,{matchId:a});return r===$i?S.jsx(w.Suspense,{fallback:l,children:u}):u});function R4(){const t=Oi(),n=t.routesById[$i].options.pendingComponent??t.options.defaultPendingComponent,r=n?S.jsx(n,{}):null,i=typeof document<"u"&&t.ssr?Zc:w.Suspense,s=S.jsxs(i,{fallback:r,children:[S.jsx(k4,{}),S.jsx(A4,{})]});return t.options.InnerWrap?S.jsx(t.options.InnerWrap,{children:s}):s}function A4(){const t=Oi(),e=hi({select:i=>{var s;return(s=i.matches[0])==null?void 0:s.id}}),n=hi({select:i=>i.loadedAt}),r=e?S.jsx(gM,{matchId:e}):null;return S.jsx(ZO.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?r:S.jsx(zw,{getResetKey:()=>n,errorComponent:jw,onCatch:i=>{i.message||i.toString()},children:r})})}const P4=t=>new _4(t);class _4 extends XB{constructor(e){super(e)}}typeof globalThis<"u"?(globalThis.createFileRoute=ls,globalThis.createLazyFileRoute=CR):typeof window<"u"&&(window.createFileRoute=ls,window.createLazyFileRoute=CR);function $4({router:t,children:e,...n}){Object.keys(n).length>0&&t.update({...t.options,...n,context:{...t.options.context,...n.context}});const r=hM(),i=S.jsx(r.Provider,{value:t,children:e});return t.options.Wrap?S.jsx(t.options.Wrap,{children:i}):i}function M4({router:t,...e}){return S.jsx($4,{router:t,...e,children:S.jsx(R4,{})})}function D4(t){return hi({select:e=>e.location})}const BO=w4({component:N4});function N4(){return S.jsx(kh,{})}function QR(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Va(...t){return e=>{let n=!1;const r=t.map(i=>{const s=QR(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():QR(t[i],null)}}}}function Nn(...t){return w.useCallback(Va(...t),t)}var L4=Symbol.for("react.lazy"),Nm=$w[" use ".trim().toString()];function z4(t){return typeof t=="object"&&t!==null&&"then"in t}function mM(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===L4&&"_payload"in t&&z4(t._payload)}function OM(t){const e=j4(t),n=w.forwardRef((r,i)=>{let{children:s,...a}=r;mM(s)&&typeof Nm=="function"&&(s=Nm(s._payload));const l=w.Children.toArray(s),u=l.find(Z4);if(u){const d=u.props.children,h=l.map(g=>g===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:g);return S.jsx(e,{...a,ref:i,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return S.jsx(e,{...a,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}var Uw=OM("Slot");function j4(t){const e=w.forwardRef((n,r)=>{let{children:i,...s}=n;if(mM(i)&&typeof Nm=="function"&&(i=Nm(i._payload)),w.isValidElement(i)){const a=B4(i),l=X4(s,i.props);return i.type!==w.Fragment&&(l.ref=r?Va(r,a):a),w.cloneElement(i,l)}return w.Children.count(i)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var I4=Symbol("radix.slottable");function Z4(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===I4}function X4(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...l)=>{const u=s(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function B4(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function yM(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=yM(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function bM(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=yM(t))&&(r&&(r+=" "),r+=e);return r}const ER=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,RR=bM,UO=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return RR(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(d=>{const h=n==null?void 0:n[d],g=s==null?void 0:s[d];if(h===null)return null;const m=ER(h)||ER(g);return i[d][m]}),l=n&&Object.entries(n).reduce((d,h)=>{let[g,m]=h;return m===void 0||(d[g]=m),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:g,className:m,...O}=h;return Object.entries(O).every(v=>{let[x,k]=v;return Array.isArray(k)?k.includes({...s,...l}[x]):{...s,...l}[x]===k})?[...d,g,m]:d},[]);return RR(t,a,u,n==null?void 0:n.class,n==null?void 0:n.className)},U4=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},V4=(t,e)=>({classGroupId:t,validator:e}),vM=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Lm="-",AR=[],q4="arbitrary..",Y4=t=>{const e=W4(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return G4(a);const l=a.split(Lm),u=l[0]===""&&l.length>1?1:0;return xM(l,u,e)},getConflictingClassGroupIds:(a,l)=>{if(l){const u=r[a],d=n[a];return u?d?U4(d,u):u:d||AR}return n[a]||AR}}},xM=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],s=n.nextPart.get(i);if(s){const d=xM(t,e+1,s);if(d)return d}const a=n.validators;if(a===null)return;const l=e===0?t.join(Lm):t.slice(e).join(Lm),u=a.length;for(let d=0;d<u;d++){const h=a[d];if(h.validator(l))return h.classGroupId}},G4=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?q4+r:void 0})(),W4=t=>{const{theme:e,classGroups:n}=t;return F4(n,e)},F4=(t,e)=>{const n=vM();for(const r in t){const i=t[r];Vw(i,n,r,e)}return n},Vw=(t,e,n,r)=>{const i=t.length;for(let s=0;s<i;s++){const a=t[s];H4(a,e,n,r)}},H4=(t,e,n,r)=>{if(typeof t=="string"){K4(t,e,n);return}if(typeof t=="function"){J4(t,e,n,r);return}eU(t,e,n,r)},K4=(t,e,n)=>{const r=t===""?e:SM(e,t);r.classGroupId=n},J4=(t,e,n,r)=>{if(tU(t)){Vw(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(V4(n,t))},eU=(t,e,n,r)=>{const i=Object.entries(t),s=i.length;for(let a=0;a<s;a++){const[l,u]=i[a];Vw(u,SM(e,l),n,r)}},SM=(t,e)=>{let n=t;const r=e.split(Lm),i=r.length;for(let s=0;s<i;s++){const a=r[s];let l=n.nextPart.get(a);l||(l=vM(),n.nextPart.set(a,l)),n=l}return n},tU=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,nU=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const i=(s,a)=>{n[s]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return i(s,a),a},set(s,a){s in n?n[s]=a:i(s,a)}}},Wx="!",PR=":",rU=[],_R=(t,e,n,r,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),iU=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const s=[];let a=0,l=0,u=0,d;const h=i.length;for(let x=0;x<h;x++){const k=i[x];if(a===0&&l===0){if(k===PR){s.push(i.slice(u,x)),u=x+1;continue}if(k==="/"){d=x;continue}}k==="["?a++:k==="]"?a--:k==="("?l++:k===")"&&l--}const g=s.length===0?i:i.slice(u);let m=g,O=!1;g.endsWith(Wx)?(m=g.slice(0,-1),O=!0):g.startsWith(Wx)&&(m=g.slice(1),O=!0);const v=d&&d>u?d-u:void 0;return _R(s,O,m,v)};if(e){const i=e+PR,s=r;r=a=>a.startsWith(i)?s(a.slice(i.length)):_R(rU,!1,a,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},sU=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const a=n[s],l=a[0]==="[",u=e.has(a);l||u?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(a)):i.push(a)}return i.length>0&&(i.sort(),r.push(...i)),r}},oU=t=>({cache:nU(t.cacheSize),parseClassName:iU(t),sortModifiers:sU(t),...Y4(t)}),aU=/\s+/,lU=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=e,a=[],l=t.trim().split(aU);let u="";for(let d=l.length-1;d>=0;d-=1){const h=l[d],{isExternal:g,modifiers:m,hasImportantModifier:O,baseClassName:v,maybePostfixModifierPosition:x}=n(h);if(g){u=h+(u.length>0?" "+u:u);continue}let k=!!x,C=r(k?v.substring(0,x):v);if(!C){if(!k){u=h+(u.length>0?" "+u:u);continue}if(C=r(v),!C){u=h+(u.length>0?" "+u:u);continue}k=!1}const Q=m.length===0?"":m.length===1?m[0]:s(m).join(":"),R=O?Q+Wx:Q,E=R+C;if(a.indexOf(E)>-1)continue;a.push(E);const P=i(C,k);for(let $=0;$<P.length;++$){const _=P[$];a.push(R+_)}u=h+(u.length>0?" "+u:u)}return u},cU=(...t)=>{let e=0,n,r,i="";for(;e<t.length;)(n=t[e++])&&(r=wM(n))&&(i&&(i+=" "),i+=r);return i},wM=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=wM(t[r]))&&(n&&(n+=" "),n+=e);return n},uU=(t,...e)=>{let n,r,i,s;const a=u=>{const d=e.reduce((h,g)=>g(h),t());return n=oU(d),r=n.cache.get,i=n.cache.set,s=l,l(u)},l=u=>{const d=r(u);if(d)return d;const h=lU(u,n);return i(u,h),h};return s=a,(...u)=>s(cU(...u))},fU=[],Mn=t=>{const e=n=>n[t]||fU;return e.isThemeGetter=!0,e},kM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,CM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,dU=/^\d+\/\d+$/,hU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pU=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,gU=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,mU=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OU=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_c=t=>dU.test(t),Je=t=>!!t&&!Number.isNaN(Number(t)),ha=t=>!!t&&Number.isInteger(Number(t)),xv=t=>t.endsWith("%")&&Je(t.slice(0,-1)),vo=t=>hU.test(t),yU=()=>!0,bU=t=>pU.test(t)&&!gU.test(t),TM=()=>!1,vU=t=>mU.test(t),xU=t=>OU.test(t),SU=t=>!we(t)&&!ke(t),wU=t=>Iu(t,RM,TM),we=t=>kM.test(t),dl=t=>Iu(t,AM,bU),Sv=t=>Iu(t,EU,Je),$R=t=>Iu(t,QM,TM),kU=t=>Iu(t,EM,xU),gg=t=>Iu(t,PM,vU),ke=t=>CM.test(t),Hf=t=>Zu(t,AM),CU=t=>Zu(t,RU),MR=t=>Zu(t,QM),TU=t=>Zu(t,RM),QU=t=>Zu(t,EM),mg=t=>Zu(t,PM,!0),Iu=(t,e,n)=>{const r=kM.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Zu=(t,e,n=!1)=>{const r=CM.exec(t);return r?r[1]?e(r[1]):n:!1},QM=t=>t==="position"||t==="percentage",EM=t=>t==="image"||t==="url",RM=t=>t==="length"||t==="size"||t==="bg-size",AM=t=>t==="length",EU=t=>t==="number",RU=t=>t==="family-name",PM=t=>t==="shadow",AU=()=>{const t=Mn("color"),e=Mn("font"),n=Mn("text"),r=Mn("font-weight"),i=Mn("tracking"),s=Mn("leading"),a=Mn("breakpoint"),l=Mn("container"),u=Mn("spacing"),d=Mn("radius"),h=Mn("shadow"),g=Mn("inset-shadow"),m=Mn("text-shadow"),O=Mn("drop-shadow"),v=Mn("blur"),x=Mn("perspective"),k=Mn("aspect"),C=Mn("ease"),Q=Mn("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...E(),ke,we],$=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],D=()=>[ke,we,u],B=()=>[_c,"full","auto",...D()],L=()=>[ha,"none","subgrid",ke,we],M=()=>["auto",{span:["full",ha,ke,we]},ha,ke,we],U=()=>[ha,"auto",ke,we],Y=()=>["auto","min","max","fr",ke,we],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...D()],V=()=>[_c,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],Z=()=>[t,ke,we],W=()=>[...E(),MR,$R,{position:[ke,we]}],fe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],se=()=>["auto","cover","contain",TU,wU,{size:[ke,we]}],ge=()=>[xv,Hf,dl],oe=()=>["","none","full",d,ke,we],he=()=>["",Je,Hf,dl],me=()=>["solid","dashed","dotted","double"],Ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Te=()=>[Je,xv,MR,$R],Ye=()=>["","none",v,ke,we],je=()=>["none",Je,ke,we],ze=()=>["none",Je,ke,we],Ct=()=>[Je,ke,we],Fe=()=>[_c,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vo],breakpoint:[vo],color:[yU],container:[vo],"drop-shadow":[vo],ease:["in","out","in-out"],font:[SU],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vo],shadow:[vo],spacing:["px",Je],text:[vo],"text-shadow":[vo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",_c,we,ke,k]}],container:["container"],columns:[{columns:[Je,we,ke,l]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{start:B()}],end:[{end:B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[ha,"auto",ke,we]}],basis:[{basis:[_c,"full","auto",l,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Je,_c,"auto","initial","none",we]}],grow:[{grow:["",Je,ke,we]}],shrink:[{shrink:["",Je,ke,we]}],order:[{order:[ha,"first","last","none",ke,we]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[l,"screen",...V()]}],"min-w":[{"min-w":[l,"screen","none",...V()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,Hf,dl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ke,Sv]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",xv,we]}],"font-family":[{font:[CU,we,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ke,we]}],"line-clamp":[{"line-clamp":[Je,"none",ke,Sv]}],leading:[{leading:[s,...D()]}],"list-image":[{"list-image":["none",ke,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[Je,"from-font","auto",ke,dl]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[Je,"auto",ke,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:fe()}],"bg-size":[{bg:se()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ha,ke,we],radial:["",ke,we],conic:[ha,ke,we]},QU,kU]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:ge()}],"gradient-via-pos":[{via:ge()}],"gradient-to-pos":[{to:ge()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Je,ke,we]}],"outline-w":[{outline:["",Je,Hf,dl]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",h,mg,gg]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",g,mg,gg]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[Je,dl]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",m,mg,gg]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[Je,ke,we]}],"mix-blend":[{"mix-blend":[...Ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Je]}],"mask-image-linear-from-pos":[{"mask-linear-from":Te()}],"mask-image-linear-to-pos":[{"mask-linear-to":Te()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":Te()}],"mask-image-t-to-pos":[{"mask-t-to":Te()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":Te()}],"mask-image-r-to-pos":[{"mask-r-to":Te()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":Te()}],"mask-image-b-to-pos":[{"mask-b-to":Te()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":Te()}],"mask-image-l-to-pos":[{"mask-l-to":Te()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":Te()}],"mask-image-x-to-pos":[{"mask-x-to":Te()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":Te()}],"mask-image-y-to-pos":[{"mask-y-to":Te()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[ke,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":Te()}],"mask-image-radial-to-pos":[{"mask-radial-to":Te()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[Je]}],"mask-image-conic-from-pos":[{"mask-conic-from":Te()}],"mask-image-conic-to-pos":[{"mask-conic-to":Te()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:fe()}],"mask-size":[{mask:se()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,we]}],filter:[{filter:["","none",ke,we]}],blur:[{blur:Ye()}],brightness:[{brightness:[Je,ke,we]}],contrast:[{contrast:[Je,ke,we]}],"drop-shadow":[{"drop-shadow":["","none",O,mg,gg]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",Je,ke,we]}],"hue-rotate":[{"hue-rotate":[Je,ke,we]}],invert:[{invert:["",Je,ke,we]}],saturate:[{saturate:[Je,ke,we]}],sepia:[{sepia:["",Je,ke,we]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,we]}],"backdrop-blur":[{"backdrop-blur":Ye()}],"backdrop-brightness":[{"backdrop-brightness":[Je,ke,we]}],"backdrop-contrast":[{"backdrop-contrast":[Je,ke,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Je,ke,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Je,ke,we]}],"backdrop-invert":[{"backdrop-invert":["",Je,ke,we]}],"backdrop-opacity":[{"backdrop-opacity":[Je,ke,we]}],"backdrop-saturate":[{"backdrop-saturate":[Je,ke,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Je,ke,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Je,"initial",ke,we]}],ease:[{ease:["linear","initial",C,ke,we]}],delay:[{delay:[Je,ke,we]}],animate:[{animate:["none",Q,ke,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,ke,we]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:ze()}],"scale-x":[{"scale-x":ze()}],"scale-y":[{"scale-y":ze()}],"scale-z":[{"scale-z":ze()}],"scale-3d":["scale-3d"],skew:[{skew:Ct()}],"skew-x":[{"skew-x":Ct()}],"skew-y":[{"skew-y":Ct()}],transform:[{transform:[ke,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,we]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,we]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[Je,Hf,dl,Sv]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},PU=uU(AU);function Ne(...t){return PU(bM(t))}const _U=UO("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Yn({className:t,variant:e="default",size:n="default",asChild:r=!1,...i}){const s=r?Uw:"button";return S.jsx(s,{"data-slot":"button","data-variant":e,"data-size":n,className:Ne(_U({variant:e,size:n,className:t})),...i})}class $U{constructor(){We(this,"baseUrl");We(this,"token",null);this.baseUrl=this.getBaseUrl(),this.token=localStorage.getItem("authToken")}getBaseUrl(){return""}setToken(e){this.token=e,localStorage.setItem("authToken",e)}clearToken(){this.token=null,localStorage.removeItem("authToken")}async request(e,n={}){const r=`${this.baseUrl}${e}`,i={"Content-Type":"application/json",...n.headers};this.token&&(i.Authorization=`Bearer ${this.token}`);try{const s=await fetch(r,{...n,headers:i,credentials:n.credentials??"include"}),a=await s.json().catch(()=>null);return s.ok?{data:a,status:s.status}:{error:(a==null?void 0:a.error)||`Request failed: ${s.statusText}`,status:s.status}}catch(s){return{error:s instanceof Error?s.message:"Network error",status:0}}}async signUp(e){var r,i;const n=await this.request("/api/auth/sign-up/email",{method:"POST",body:JSON.stringify(e)});return(i=(r=n.data)==null?void 0:r.session)!=null&&i.token&&this.setToken(n.data.session.token),n}async signIn(e){var r,i;const n=await this.request("/api/auth/sign-in/email",{method:"POST",body:JSON.stringify(e)});return(i=(r=n.data)==null?void 0:r.session)!=null&&i.token&&this.setToken(n.data.session.token),n}async signOut(){const e=await this.request("/api/auth/sign-out",{method:"POST",body:JSON.stringify({})});return this.clearToken(),e}async getSession(){return this.request("/api/auth/get-session")}async listWorkspaces(){return this.request("/api/workspaces")}async createWorkspace(e){return this.request("/api/workspaces",{method:"POST",body:JSON.stringify({name:e})})}async getWorkspace(e){return this.request(`/api/workspaces/${e}`)}async updateWorkspace(e,n){return this.request(`/api/workspaces/${e}`,{method:"PATCH",body:JSON.stringify({name:n})})}async deleteWorkspace(e){return this.request(`/api/workspaces/${e}`,{method:"DELETE"})}async listNotes(e){return this.request(`/api/workspaces/${e}/notes`)}async createNote(e,n,r,i){return this.request(`/api/workspaces/${e}/notes`,{method:"POST",body:JSON.stringify({title:n,name:r,folderId:i})})}async getNote(e,n){return this.request(`/api/workspaces/${e}/notes/${n}`)}async updateNote(e,n,r,i){return this.request(`/api/workspaces/${e}/notes/${n}`,{method:"PATCH",body:JSON.stringify({title:r,name:i})})}async deleteNote(e,n){return this.request(`/api/workspaces/${e}/notes/${n}`,{method:"DELETE"})}async getNoteHistory(e,n,r){const i=r?`?limit=${r}`:"";return this.request(`/api/workspaces/${e}/notes/${n}/history${i}`)}async getWorkspaceTree(e){return this.request(`/api/workspaces/${e}/tree`)}async uploadWorkspaceEntries(e,n){return this.request(`/api/workspaces/${e}/upload`,{method:"POST",body:JSON.stringify(n)})}async createFolder(e,n,r,i){return this.request(`/api/workspaces/${e}/folders`,{method:"POST",body:JSON.stringify({displayName:n,name:r,parentId:i})})}async updateFolder(e,n,r,i){return this.request(`/api/workspaces/${e}/folders/${n}`,{method:"PATCH",body:JSON.stringify({displayName:r,name:i})})}async deleteFolder(e,n){return this.request(`/api/workspaces/${e}/folders/${n}`,{method:"DELETE"})}async moveFolder(e,n,r){return this.request(`/api/workspaces/${e}/folders/${n}/move`,{method:"PATCH",body:JSON.stringify({parentId:r})})}async moveNote(e,n,r){return this.request(`/api/workspaces/${e}/notes/${n}/move`,{method:"PATCH",body:JSON.stringify({folderId:r})})}async getCollabToken(e,n){return this.request("/api/collab/token",{method:"POST",body:JSON.stringify({workspaceSlug:e,noteId:n})})}async updateNoteContent(e,n,r,i){return this.request(`/api/workspaces/${e}/notes/${n}/content`,{method:"PATCH",body:JSON.stringify({content:r,includeBlame:i})})}subscribeToWorkspaceEvents(e,n){const r=new EventSource(`/api/workspaces/${e}/events`,{withCredentials:!0}),i=["note.created","note.updated","note.deleted","note.moved","folder.created","folder.updated","folder.deleted","folder.moved","ready"],s=()=>{console.debug("SSE connection error, EventSource will auto-reconnect")};return i.forEach(l=>{r.addEventListener(l,n)}),r.addEventListener("error",s),{eventSource:r,cleanup:()=>{i.forEach(l=>{r.removeEventListener(l,n)}),r.removeEventListener("error",s),r.close()}}}getMcpUrl(){return"/mcp"}async getServerCapabilities(){return this.request("/api/config")}}let wv=null;function MU(){return wv||(wv=new $U),wv}const rn=MU(),VO={session:["auth","session"]},dn={all:["workspaces"],lists:()=>[...dn.all,"list"],list:()=>[...dn.lists()],details:()=>[...dn.all,"detail"],detail:t=>[...dn.details(),t],trees:()=>[...dn.all,"tree"],tree:t=>[...dn.trees(),t]},Zr={all:["notes"],details:()=>[...Zr.all,"detail"],detail:(t,e)=>[...Zr.details(),t,e],histories:()=>[...Zr.all,"history"],history:(t,e)=>[...Zr.histories(),t,e],collabTokens:()=>[...Zr.all,"collabToken"],collabToken:(t,e)=>[...Zr.collabTokens(),t,e]},_M={all:["server"],capabilities:()=>[..._M.all,"capabilities"]},Ch={queryKey:VO.session,queryFn:async()=>{const t=await rn.getSession();if(t.status===0)throw new Error("Network error: failed to fetch session");if(t.status===401||t.status===403)return null;if(t.status<200||t.status>=300)throw new Error(`Server error: ${t.status}`);return t.data?t.data:null}};function DU(){const t=or(),{data:e,isLoading:n}=Ur(Ch);w.useEffect(()=>{e!=null&&e.user&&t({to:"/"})},[e,t]);const r=async()=>{const i=rn.getBaseUrl();try{const a=await(await fetch(`${i}/api/auth/sign-in/oauth2`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerId:"keycloak",callbackURL:"/"})})).json();a.redirect===!0&&a.url?window.location.href=a.url:console.error("Unexpected OAuth response:",a)}catch(s){console.error("Error initiating OAuth flow:",s)}};return S.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[S.jsx("img",{src:"/logo.png",alt:"Kontexted",className:"h-8 w-auto"}),S.jsx("h1",{className:"text-xl font-bold",children:"Sign in"}),S.jsx("p",{className:"text-sm text-muted-foreground",children:"Access your workspaces and start collaborating."}),n?S.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Loading session..."}):S.jsx(Yn,{type:"button",onClick:r,className:"w-full",children:"Continue with Keycloak"})]})}function $e(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function NU(t,e){const n=w.createContext(e),r=s=>{const{children:a,...l}=s,u=w.useMemo(()=>l,Object.values(l));return S.jsx(n.Provider,{value:u,children:a})};r.displayName=t+"Provider";function i(s){const a=w.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function Zo(t,e=[]){let n=[];function r(s,a){const l=w.createContext(a),u=n.length;n=[...n,a];const d=g=>{var C;const{scope:m,children:O,...v}=g,x=((C=m==null?void 0:m[t])==null?void 0:C[u])||l,k=w.useMemo(()=>v,Object.values(v));return S.jsx(x.Provider,{value:k,children:O})};d.displayName=s+"Provider";function h(g,m){var x;const O=((x=m==null?void 0:m[t])==null?void 0:x[u])||l,v=w.useContext(O);if(v)return v;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${s}\``)}return[d,h]}const i=()=>{const s=n.map(a=>w.createContext(a));return function(l){const u=(l==null?void 0:l[t])||s;return w.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])}};return i.scopeName=t,[r,LU(i,...e)]}function LU(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=r.reduce((l,{useScope:u,scopeName:d})=>{const g=u(s)[`__scope${d}`];return{...l,...g}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function DR(t){const e=zU(t),n=w.forwardRef((r,i)=>{const{children:s,...a}=r,l=w.Children.toArray(s),u=l.find(IU);if(u){const d=u.props.children,h=l.map(g=>g===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:g);return S.jsx(e,{...a,ref:i,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return S.jsx(e,{...a,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function zU(t){const e=w.forwardRef((n,r)=>{const{children:i,...s}=n;if(w.isValidElement(i)){const a=XU(i),l=ZU(s,i.props);return i.type!==w.Fragment&&(l.ref=r?Va(r,a):a),w.cloneElement(i,l)}return w.Children.count(i)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var jU=Symbol("radix.slottable");function IU(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===jU}function ZU(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...l)=>{const u=s(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function XU(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function $M(t){const e=t+"CollectionProvider",[n,r]=Zo(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:k,children:C}=x,Q=it.useRef(null),R=it.useRef(new Map).current;return S.jsx(i,{scope:k,itemMap:R,collectionRef:Q,children:C})};a.displayName=e;const l=t+"CollectionSlot",u=DR(l),d=it.forwardRef((x,k)=>{const{scope:C,children:Q}=x,R=s(l,C),E=Nn(k,R.collectionRef);return S.jsx(u,{ref:E,children:Q})});d.displayName=l;const h=t+"CollectionItemSlot",g="data-radix-collection-item",m=DR(h),O=it.forwardRef((x,k)=>{const{scope:C,children:Q,...R}=x,E=it.useRef(null),P=Nn(k,E),$=s(h,C);return it.useEffect(()=>($.itemMap.set(E,{ref:E,...R}),()=>void $.itemMap.delete(E))),S.jsx(m,{[g]:"",ref:P,children:Q})});O.displayName=h;function v(x){const k=s(t+"CollectionConsumer",x);return it.useCallback(()=>{const Q=k.collectionRef.current;if(!Q)return[];const R=Array.from(Q.querySelectorAll(`[${g}]`));return Array.from(k.itemMap.values()).sort(($,_)=>R.indexOf($.ref.current)-R.indexOf(_.ref.current))},[k.collectionRef,k.itemMap])}return[{Provider:a,Slot:d,ItemSlot:O},v,r]}var Ma=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},BU=$w[" useId ".trim().toString()]||(()=>{}),UU=0;function Pa(t){const[e,n]=w.useState(BU());return Ma(()=>{n(r=>r??String(UU++))},[t]),t||(e?`radix-${e}`:"")}function VU(t){const e=qU(t),n=w.forwardRef((r,i)=>{const{children:s,...a}=r,l=w.Children.toArray(s),u=l.find(GU);if(u){const d=u.props.children,h=l.map(g=>g===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:g);return S.jsx(e,{...a,ref:i,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return S.jsx(e,{...a,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function qU(t){const e=w.forwardRef((n,r)=>{const{children:i,...s}=n;if(w.isValidElement(i)){const a=FU(i),l=WU(s,i.props);return i.type!==w.Fragment&&(l.ref=r?Va(r,a):a),w.cloneElement(i,l)}return w.Children.count(i)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var YU=Symbol("radix.slottable");function GU(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===YU}function WU(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...l)=>{const u=s(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function FU(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var HU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wt=HU.reduce((t,e)=>{const n=VU(`Primitive.${e}`),r=w.forwardRef((i,s)=>{const{asChild:a,...l}=i,u=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function MM(t,e){t&&To.flushSync(()=>t.dispatchEvent(e))}function Vs(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}var KU=$w[" useInsertionEffect ".trim().toString()]||Ma;function Th({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,s,a]=JU({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:i;{const h=w.useRef(t!==void 0);w.useEffect(()=>{const g=h.current;g!==l&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,r])}const d=w.useCallback(h=>{var g;if(l){const m=eV(h)?h(t):h;m!==t&&((g=a.current)==null||g.call(a,m))}else s(h)},[l,t,s,a]);return[u,d]}function JU({defaultProp:t,onChange:e}){const[n,r]=w.useState(t),i=w.useRef(n),s=w.useRef(e);return KU(()=>{s.current=e},[e]),w.useEffect(()=>{var a;i.current!==n&&((a=s.current)==null||a.call(s,n),i.current=n)},[n,i]),[n,r,s]}function eV(t){return typeof t=="function"}var tV=w.createContext(void 0);function qw(t){const e=w.useContext(tV);return t||e||"ltr"}var kv="rovingFocusGroup.onEntryFocus",nV={bubbles:!1,cancelable:!0},Qh="RovingFocusGroup",[Fx,DM,rV]=$M(Qh),[iV,qO]=Zo(Qh,[rV]),[sV,oV]=iV(Qh),NM=w.forwardRef((t,e)=>S.jsx(Fx.Provider,{scope:t.__scopeRovingFocusGroup,children:S.jsx(Fx.Slot,{scope:t.__scopeRovingFocusGroup,children:S.jsx(aV,{...t,ref:e})})}));NM.displayName=Qh;var aV=w.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...g}=t,m=w.useRef(null),O=Nn(e,m),v=qw(s),[x,k]=Th({prop:a,defaultProp:l??null,onChange:u,caller:Qh}),[C,Q]=w.useState(!1),R=Vs(d),E=DM(n),P=w.useRef(!1),[$,_]=w.useState(0);return w.useEffect(()=>{const D=m.current;if(D)return D.addEventListener(kv,R),()=>D.removeEventListener(kv,R)},[R]),S.jsx(sV,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:x,onItemFocus:w.useCallback(D=>k(D),[k]),onItemShiftTab:w.useCallback(()=>Q(!0),[]),onFocusableItemAdd:w.useCallback(()=>_(D=>D+1),[]),onFocusableItemRemove:w.useCallback(()=>_(D=>D-1),[]),children:S.jsx(Wt.div,{tabIndex:C||$===0?-1:0,"data-orientation":r,...g,ref:O,style:{outline:"none",...t.style},onMouseDown:$e(t.onMouseDown,()=>{P.current=!0}),onFocus:$e(t.onFocus,D=>{const B=!P.current;if(D.target===D.currentTarget&&B&&!C){const L=new CustomEvent(kv,nV);if(D.currentTarget.dispatchEvent(L),!L.defaultPrevented){const M=E().filter(N=>N.focusable),U=M.find(N=>N.active),Y=M.find(N=>N.id===x),ee=[U,Y,...M].filter(Boolean).map(N=>N.ref.current);jM(ee,h)}}P.current=!1}),onBlur:$e(t.onBlur,()=>Q(!1))})})}),LM="RovingFocusGroupItem",zM=w.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:a,...l}=t,u=Pa(),d=s||u,h=oV(LM,n),g=h.currentTabStopId===d,m=DM(n),{onFocusableItemAdd:O,onFocusableItemRemove:v,currentTabStopId:x}=h;return w.useEffect(()=>{if(r)return O(),()=>v()},[r,O,v]),S.jsx(Fx.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:S.jsx(Wt.span,{tabIndex:g?0:-1,"data-orientation":h.orientation,...l,ref:e,onMouseDown:$e(t.onMouseDown,k=>{r?h.onItemFocus(d):k.preventDefault()}),onFocus:$e(t.onFocus,()=>h.onItemFocus(d)),onKeyDown:$e(t.onKeyDown,k=>{if(k.key==="Tab"&&k.shiftKey){h.onItemShiftTab();return}if(k.target!==k.currentTarget)return;const C=uV(k,h.orientation,h.dir);if(C!==void 0){if(k.metaKey||k.ctrlKey||k.altKey||k.shiftKey)return;k.preventDefault();let R=m().filter(E=>E.focusable).map(E=>E.ref.current);if(C==="last")R.reverse();else if(C==="prev"||C==="next"){C==="prev"&&R.reverse();const E=R.indexOf(k.currentTarget);R=h.loop?fV(R,E+1):R.slice(E+1)}setTimeout(()=>jM(R))}}),children:typeof a=="function"?a({isCurrentTabStop:g,hasTabStop:x!=null}):a})})});zM.displayName=LM;var lV={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cV(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function uV(t,e,n){const r=cV(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return lV[r]}function jM(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function fV(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var IM=NM,ZM=zM;function dV(t,e){return w.useReducer((n,r)=>e[n][r]??n,t)}var gs=t=>{const{present:e,children:n}=t,r=hV(e),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),s=Nn(r.ref,pV(i));return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:s}):null};gs.displayName="Presence";function hV(t){const[e,n]=w.useState(),r=w.useRef(null),i=w.useRef(t),s=w.useRef("none"),a=t?"mounted":"unmounted",[l,u]=dV(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const d=Og(r.current);s.current=l==="mounted"?d:"none"},[l]),Ma(()=>{const d=r.current,h=i.current;if(h!==t){const m=s.current,O=Og(d);t?u("MOUNT"):O==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(h&&m!==O?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,u]),Ma(()=>{if(e){let d;const h=e.ownerDocument.defaultView??window,g=O=>{const x=Og(r.current).includes(CSS.escape(O.animationName));if(O.target===e&&x&&(u("ANIMATION_END"),!i.current)){const k=e.style.animationFillMode;e.style.animationFillMode="forwards",d=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=k)})}},m=O=>{O.target===e&&(s.current=Og(r.current))};return e.addEventListener("animationstart",m),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{h.clearTimeout(d),e.removeEventListener("animationstart",m),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Og(t){return(t==null?void 0:t.animationName)||"none"}function pV(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var YO="Tabs",[gV]=Zo(YO,[qO]),XM=qO(),[mV,Yw]=gV(YO),BM=w.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:l,activationMode:u="automatic",...d}=t,h=qw(l),[g,m]=Th({prop:r,onChange:i,defaultProp:s??"",caller:YO});return S.jsx(mV,{scope:n,baseId:Pa(),value:g,onValueChange:m,orientation:a,dir:h,activationMode:u,children:S.jsx(Wt.div,{dir:h,"data-orientation":a,...d,ref:e})})});BM.displayName=YO;var UM="TabsList",VM=w.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...i}=t,s=Yw(UM,n),a=XM(n);return S.jsx(IM,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:r,children:S.jsx(Wt.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:e})})});VM.displayName=UM;var qM="TabsTrigger",YM=w.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=t,a=Yw(qM,n),l=XM(n),u=FM(a.baseId,r),d=HM(a.baseId,r),h=r===a.value;return S.jsx(ZM,{asChild:!0,...l,focusable:!i,active:h,children:S.jsx(Wt.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...s,ref:e,onMouseDown:$e(t.onMouseDown,g=>{!i&&g.button===0&&g.ctrlKey===!1?a.onValueChange(r):g.preventDefault()}),onKeyDown:$e(t.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&a.onValueChange(r)}),onFocus:$e(t.onFocus,()=>{const g=a.activationMode!=="manual";!h&&!i&&g&&a.onValueChange(r)})})})});YM.displayName=qM;var GM="TabsContent",WM=w.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...a}=t,l=Yw(GM,n),u=FM(l.baseId,r),d=HM(l.baseId,r),h=r===l.value,g=w.useRef(h);return w.useEffect(()=>{const m=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(m)},[]),S.jsx(gs,{present:i||h,children:({present:m})=>S.jsx(Wt.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!m,id:d,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:g.current?"0s":void 0},children:m&&s})})});WM.displayName=GM;function FM(t,e){return`${t}-trigger-${e}`}function HM(t,e){return`${t}-content-${e}`}var OV=BM,yV=VM,bV=YM,vV=WM;function xV({className:t,...e}){return S.jsx(OV,{"data-slot":"tabs",className:Ne("flex flex-col gap-2",t),...e})}function SV({className:t,...e}){return S.jsx(yV,{"data-slot":"tabs-list",className:Ne("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",t),...e})}function NR({className:t,...e}){return S.jsx(bV,{"data-slot":"tabs-trigger",className:Ne("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e})}function LR({className:t,...e}){return S.jsx(vV,{"data-slot":"tabs-content",className:Ne("flex-1 outline-none",t),...e})}function Uc({className:t,type:e,...n}){return S.jsx("input",{type:e,"data-slot":"input",className:Ne("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}function wV({onSwitchToSignUp:t}){const e=or(),n=Yr(),[r,i]=w.useState(""),[s,a]=w.useState(""),[l,u]=w.useState(""),[d,h]=w.useState(!1),g=async m=>{m.preventDefault(),u(""),h(!0);try{const O=await rn.signIn({email:r,password:s});if(O.error)switch(O.status){case 400:u("Invalid email or password");break;case 401:u("Invalid credentials");break;case 404:u("User not found");break;default:u(O.error||"Authentication failed")}else await n.invalidateQueries({queryKey:VO.session}),e({to:"/"})}catch{u("An unexpected error occurred")}finally{h(!1)}};return S.jsxs("form",{onSubmit:g,className:"flex flex-col gap-4",children:[S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{htmlFor:"email",className:"text-sm font-medium",children:"Email"}),S.jsx(Uc,{id:"email",type:"email",value:r,onChange:m=>i(m.target.value),placeholder:"you@example.com",required:!0,"aria-invalid":!!l})]}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{htmlFor:"password",className:"text-sm font-medium",children:"Password"}),S.jsx(Uc,{id:"password",type:"password",value:s,onChange:m=>a(m.target.value),placeholder:"••••••••",required:!0,minLength:8,"aria-invalid":!!l})]}),l&&S.jsx("p",{className:"text-sm text-destructive",children:l}),S.jsx(Yn,{type:"submit",className:"w-full",disabled:d,children:d?"Signing in...":"Sign In"}),t&&S.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:["Don't have an account?"," ",S.jsx("button",{type:"button",onClick:t,className:"text-primary hover:underline",children:"Sign up"})]})]})}function kV({onSwitchToSignIn:t}){const e=or(),n=Yr(),[r,i]=w.useState(""),[s,a]=w.useState(""),[l,u]=w.useState(""),[d,h]=w.useState(""),[g,m]=w.useState({name:"",email:"",password:"",inviteCode:""}),[O,v]=w.useState(!1),x=()=>{const C={name:"",email:"",password:"",inviteCode:""};let Q=!0;return r.trim()||(C.name="Name is required",Q=!1),s.trim()||(C.email="Email is required",Q=!1),l.length<8&&(C.password="Password must be at least 8 characters",Q=!1),d.trim()||(C.inviteCode="Invite code is required",Q=!1),m(C),Q},k=async C=>{var Q;if(C.preventDefault(),m({name:"",email:"",password:"",inviteCode:""}),!!x()){v(!0);try{const R=await rn.signUp({name:r,email:s,password:l,inviteCode:d});if(R.error)switch(R.status){case 400:(Q=R.error)!=null&&Q.includes("invite code")?m({name:"",email:"",password:"",inviteCode:R.error||"Invalid invite code"}):m(E=>({...E,email:R.error||"Failed to create account"}));break;case 409:m(E=>({...E,email:"Email already exists"}));break;default:m(E=>({...E,email:R.error||"Sign up failed"}))}else await n.invalidateQueries({queryKey:VO.session}),e({to:"/"})}catch{m(R=>({...R,email:"An unexpected error occurred"}))}finally{v(!1)}}};return S.jsxs("form",{onSubmit:k,className:"flex flex-col gap-4",children:[S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{htmlFor:"name",className:"text-sm font-medium",children:"Name"}),S.jsx(Uc,{id:"name",type:"text",value:r,onChange:C=>i(C.target.value),placeholder:"John Doe",required:!0,"aria-invalid":!!g.name}),g.name&&S.jsx("p",{className:"text-sm text-destructive",children:g.name})]}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{htmlFor:"email",className:"text-sm font-medium",children:"Email"}),S.jsx(Uc,{id:"email",type:"email",value:s,onChange:C=>a(C.target.value),placeholder:"you@example.com",required:!0,"aria-invalid":!!g.email}),g.email&&S.jsx("p",{className:"text-sm text-destructive",children:g.email})]}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{htmlFor:"password",className:"text-sm font-medium",children:"Password"}),S.jsx(Uc,{id:"password",type:"password",value:l,onChange:C=>u(C.target.value),placeholder:"•••••••••",required:!0,minLength:8,"aria-invalid":!!g.password}),g.password&&S.jsx("p",{className:"text-sm text-destructive",children:g.password})]}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{htmlFor:"inviteCode",className:"text-sm font-medium",children:"Invite Code"}),S.jsx(Uc,{id:"inviteCode",type:"text",value:d,onChange:C=>h(C.target.value),placeholder:"Enter your invite code",required:!0,"aria-invalid":!!g.inviteCode}),g.inviteCode&&S.jsx("p",{className:"text-sm text-destructive",children:g.inviteCode})]}),S.jsx(Yn,{type:"submit",className:"w-full",disabled:O,children:O?"Creating account...":"Sign Up"}),t&&S.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:["Already have an account?"," ",S.jsx("button",{type:"button",onClick:t,className:"text-primary hover:underline",children:"Sign in"})]})]})}function CV({inviteCodeAvailable:t}){const[e,n]=w.useState("sign-in");return S.jsxs(xV,{defaultValue:"sign-in",value:e,onValueChange:r=>n(r),children:[S.jsxs("div",{className:"flex flex-col items-center gap-2 text-center mb-4",children:[S.jsx("img",{src:"/logo.png",alt:"Kontexted",className:"h-8 w-auto"}),S.jsx("h1",{className:"text-xl font-bold",children:e==="sign-in"?"Sign in":"Sign up"}),S.jsx("p",{className:"text-sm text-muted-foreground",children:e==="sign-in"?"Access your workspaces and start collaborating.":"Create an account to get started."})]}),t&&S.jsxs(SV,{className:"grid w-full grid-cols-2",children:[S.jsx(NR,{value:"sign-in",children:"Sign In"}),S.jsx(NR,{value:"sign-up",children:"Sign Up"})]}),S.jsx(LR,{value:"sign-in",children:S.jsx(wV,{onSwitchToSignUp:t?()=>n("sign-up"):void 0})}),t&&S.jsx(LR,{value:"sign-up",children:S.jsx(kV,{onSwitchToSignIn:()=>n("sign-in")})})]})}function TV({authMethod:t,inviteCodeAvailable:e}){return t==="keycloak"?S.jsx(DU,{}):S.jsx(CV,{inviteCodeAvailable:e})}function QV(){return{queryKey:_M.capabilities(),queryFn:async()=>{const t=await rn.getServerCapabilities();if(t.status!==200||!t.data)throw new Error(t.error||"Failed to fetch server capabilities");return t.data},staleTime:300*1e3}}function EV(){return Ur(QV())}const RV=ls("/login")({component:AV});function AV(){const t=or(),{data:e,isLoading:n}=Ur(Ch),{data:r,isLoading:i}=EV();if(w.useEffect(()=>{e&&t({to:"/workspaces",replace:!0})},[e,t]),n)return S.jsx("div",{className:"flex min-h-svh items-center justify-center",children:S.jsx("div",{className:"text-muted-foreground",children:"Checking session..."})});if(e)return null;if(i)return S.jsx("div",{className:"flex min-h-svh items-center justify-center",children:S.jsx("div",{className:"text-muted-foreground",children:"Loading configuration..."})});const s=(r==null?void 0:r.authMethod)??"email-password",a=(r==null?void 0:r.inviteCodeAvailable)??!1;return S.jsx("div",{className:"flex min-h-svh items-center justify-center p-8",children:S.jsx("div",{className:"w-full max-w-md",children:S.jsx(TV,{authMethod:s,inviteCodeAvailable:a})})})}const Cv=Symbol.for("better-auth:broadcast-channel"),PV=()=>Math.floor(Date.now()/1e3);var _V=class{constructor(t="better-auth.message"){We(this,"listeners",new Set);We(this,"name");this.name=t}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}post(t){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...t,timestamp:PV()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const t=e=>{if(e.key!==this.name)return;const n=JSON.parse(e.newValue??"{}");(n==null?void 0:n.event)!=="session"||!(n!=null&&n.data)||this.listeners.forEach(r=>r(n))};return window.addEventListener("storage",t),()=>{window.removeEventListener("storage",t)}}};function Tv(t="better-auth.message"){return globalThis[Cv]||(globalThis[Cv]=new _V(t)),globalThis[Cv]}const Qv=Symbol.for("better-auth:focus-manager");var $V=class{constructor(){We(this,"listeners",new Set)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}setFocused(t){this.listeners.forEach(e=>e(t))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const t=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",t,!1),()=>{document.removeEventListener("visibilitychange",t,!1)}}};function zR(){return globalThis[Qv]||(globalThis[Qv]=new $V),globalThis[Qv]}const Ev=Symbol.for("better-auth:online-manager");var MV=class{constructor(){We(this,"listeners",new Set);We(this,"isOnline",typeof navigator<"u"?navigator.onLine:!0)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}setOnline(t){this.isOnline=t,this.listeners.forEach(e=>e(t))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const t=()=>this.setOnline(!0),e=()=>this.setOnline(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",e,!1),()=>{window.removeEventListener("online",t,!1),window.removeEventListener("offline",e,!1)}}};function Rv(){return globalThis[Ev]||(globalThis[Ev]=new MV),globalThis[Ev]}let Ki=[],pa=0;const yg=4,KM=t=>{let e=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},lc:0,listen(r){return n.lc=e.push(r),()=>{for(let s=pa+yg;s<Ki.length;)Ki[s]===r?Ki.splice(s,yg):s+=yg;let i=e.indexOf(r);~i&&(e.splice(i,1),--n.lc||n.off())}},notify(r,i){let s=!Ki.length;for(let a of e)Ki.push(a,n.value,r,i);if(s){for(pa=0;pa<Ki.length;pa+=yg)Ki[pa](Ki[pa+1],Ki[pa+2],Ki[pa+3]);Ki.length=0}},off(){},set(r){let i=n.value;i!==r&&(n.value=r,n.notify(i))},subscribe(r){let i=n.listen(r);return r(n.value),i},value:t};return n},DV=5,bg=6,vg=10;let NV=(t,e,n,r)=>(t.events=t.events||{},t.events[n+vg]||(t.events[n+vg]=r(i=>{t.events[n].reduceRight((s,a)=>(a(s),s),{shared:{},...i})})),t.events[n]=t.events[n]||[],t.events[n].push(e),()=>{let i=t.events[n],s=i.indexOf(e);i.splice(s,1),i.length||(delete t.events[n],t.events[n+vg](),delete t.events[n+vg])}),LV=1e3,JM=(t,e)=>NV(t,r=>{let i=e(r);i&&t.events[bg].push(i)},DV,r=>{let i=t.listen;t.listen=(...a)=>(!t.lc&&!t.active&&(t.active=!0,r()),i(...a));let s=t.off;return t.events[bg]=[],t.off=()=>{s(),setTimeout(()=>{if(t.active&&!t.lc){t.active=!1;for(let a of t.events[bg])a();t.events[bg]=[]}},LV)},()=>{t.listen=i,t.off=s}});const zV=()=>typeof window>"u",jV=(t,e,n,r)=>{const i=KM({data:null,error:null,isPending:!0,isRefetching:!1,refetch:l=>s(l)}),s=async l=>new Promise(u=>{const d=typeof r=="function"?r({data:i.get().data,error:i.get().error,isPending:i.get().isPending}):r;n(e,{...d,query:{...d==null?void 0:d.query,...l==null?void 0:l.query},async onSuccess(h){var g;i.set({data:h.data,error:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await((g=d==null?void 0:d.onSuccess)==null?void 0:g.call(d,h))},async onError(h){var v,x;const{request:g}=h,m=typeof g.retry=="number"?g.retry:(v=g.retry)==null?void 0:v.attempts,O=g.retryAttempt||0;m&&O<m||(i.set({error:h.error,data:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await((x=d==null?void 0:d.onError)==null?void 0:x.call(d,h)))},async onRequest(h){var m;const g=i.get();i.set({isPending:g.data===null,data:g.data,error:null,isRefetching:!0,refetch:i.value.refetch}),await((m=d==null?void 0:d.onRequest)==null?void 0:m.call(d,h))}}).catch(h=>{i.set({error:h,data:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}).finally(()=>{u(void 0)})});t=Array.isArray(t)?t:[t];let a=!1;for(const l of t)l.subscribe(async()=>{zV()||(a?await s():JM(i,()=>{const u=setTimeout(async()=>{a||(await s(),a=!0)},0);return()=>{i.off(),l.off(),clearTimeout(u)}}))});return i},$c=()=>Math.floor(Date.now()/1e3),IV=5;function ZV(t){var Q,R,E;const{sessionAtom:e,sessionSignal:n,$fetch:r,options:i={}}=t,s=((Q=i.sessionOptions)==null?void 0:Q.refetchInterval)??0,a=((R=i.sessionOptions)==null?void 0:R.refetchOnWindowFocus)??!0,l=((E=i.sessionOptions)==null?void 0:E.refetchWhenOffline)??!1,u={lastSync:0,lastSessionRequest:0,cachedSession:void 0},d=()=>l||Rv().isOnline,h=P=>{if(!d())return;if((P==null?void 0:P.event)==="storage"){u.lastSync=$c(),n.set(!n.get());return}const $=e.get();if((P==null?void 0:P.event)==="poll"){u.lastSessionRequest=$c(),r("/get-session").then(_=>{_.error?e.set({...$,data:null,error:_.error}):e.set({...$,data:_.data,error:null}),u.lastSync=$c(),n.set(!n.get())}).catch(()=>{});return}if((P==null?void 0:P.event)==="visibilitychange"){if($c()-u.lastSessionRequest<IV)return;u.lastSessionRequest=$c()}(($==null?void 0:$.data)===null||($==null?void 0:$.data)===void 0||(P==null?void 0:P.event)==="visibilitychange")&&(u.lastSync=$c(),n.set(!n.get()))},g=P=>{Tv().post({event:"session",data:{trigger:P},clientId:Math.random().toString(36).substring(7)})},m=()=>{s&&s>0&&(u.pollInterval=setInterval(()=>{var P;(P=e.get())!=null&&P.data&&h({event:"poll"})},s*1e3))},O=()=>{u.unsubscribeBroadcast=Tv().subscribe(()=>{h({event:"storage"})})},v=()=>{a&&(u.unsubscribeFocus=zR().subscribe(()=>{h({event:"visibilitychange"})}))},x=()=>{u.unsubscribeOnline=Rv().subscribe(P=>{P&&h({event:"visibilitychange"})})};return{init:()=>{m(),O(),v(),x(),Tv().setup(),zR().setup(),Rv().setup()},cleanup:()=>{u.pollInterval&&(clearInterval(u.pollInterval),u.pollInterval=void 0),u.unsubscribeBroadcast&&(u.unsubscribeBroadcast(),u.unsubscribeBroadcast=void 0),u.unsubscribeFocus&&(u.unsubscribeFocus(),u.unsubscribeFocus=void 0),u.unsubscribeOnline&&(u.unsubscribeOnline(),u.unsubscribeOnline=void 0),u.lastSync=0,u.lastSessionRequest=0,u.cachedSession=void 0},triggerRefetch:h,broadcastSessionUpdate:g}}var XV={},jR={};const sm=Object.create(null),Kf=t=>{var e;return XV||((e=globalThis.Deno)==null?void 0:e.env.toObject())||globalThis.__env__||(t?sm:globalThis)},Mi=new Proxy(sm,{get(t,e){return Kf()[e]??sm[e]},has(t,e){return e in Kf()||e in sm},set(t,e,n){const r=Kf(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=Kf(!0);return delete n[e],!0},ownKeys(){const t=Kf(!0);return Object.keys(t)}});function En(t,e){return typeof process<"u"&&jR?jR[t]??e:typeof Deno<"u"?Deno.env.get(t)??e:typeof Bun<"u"?Bun.env[t]??e:e}const Jf=1,Bn=4,_s=8,ci=24,IR={eterm:Bn,cons25:Bn,console:Bn,cygwin:Bn,dtterm:Bn,gnome:Bn,hurd:Bn,jfbterm:Bn,konsole:Bn,kterm:Bn,mlterm:Bn,mosh:ci,putty:Bn,st:Bn,"rxvt-unicode-24bit":ci,terminator:ci,"xterm-kitty":ci},BV=new Map(Object.entries({APPVEYOR:_s,BUILDKITE:_s,CIRCLECI:ci,DRONE:_s,GITEA_ACTIONS:ci,GITHUB_ACTIONS:ci,GITLAB_CI:_s,TRAVIS:_s})),UV=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function VV(){if(En("FORCE_COLOR")!==void 0)switch(En("FORCE_COLOR")){case"":case"1":case"true":return Bn;case"2":return _s;case"3":return ci;default:return Jf}if(En("NODE_DISABLE_COLORS")!==void 0&&En("NODE_DISABLE_COLORS")!==""||En("NO_COLOR")!==void 0&&En("NO_COLOR")!==""||En("TERM")==="dumb")return Jf;if(En("TMUX"))return ci;if("TF_BUILD"in Mi&&"AGENT_NAME"in Mi)return Bn;if("CI"in Mi){for(const{0:t,1:e}of BV)if(t in Mi)return e;return En("CI_NAME")==="codeship"?_s:Jf}if("TEAMCITY_VERSION"in Mi)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(En("TEAMCITY_VERSION"))!==null?Bn:Jf;switch(En("TERM_PROGRAM")){case"iTerm.app":return!En("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(En("TERM_PROGRAM_VERSION"))!==null?_s:ci;case"HyperTerm":case"MacTerm":return ci;case"Apple_Terminal":return _s}if(En("COLORTERM")==="truecolor"||En("COLORTERM")==="24bit")return ci;if(En("TERM")){if(/truecolor/.exec(En("TERM"))!==null)return ci;if(/^xterm-256/.exec(En("TERM"))!==null)return _s;const t=En("TERM").toLowerCase();if(IR[t])return IR[t];if(UV.some(e=>e.exec(t)!==null))return Bn}return En("COLORTERM")?Bn:Jf}const $s={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",fg:{red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m"}},Hx=["debug","info","success","warn","error"];function qV(t,e){return Hx.indexOf(e)>=Hx.indexOf(t)}const YV={info:$s.fg.blue,success:$s.fg.green,warn:$s.fg.yellow,error:$s.fg.red,debug:$s.fg.magenta},GV=(t,e,n)=>{const r=new Date().toISOString();return n?`${$s.dim}${r}${$s.reset} ${YV[t]}${t.toUpperCase()}${$s.reset} ${$s.bright}[Better Auth]:${$s.reset} ${e}`:`${r} ${t.toUpperCase()} [Better Auth]: ${e}`},WV=t=>{const e="warn",n=VV()!==1,r=(i,s,a=[])=>{if(!qV(e,i))return;const l=GV(i,s,n);{i==="error"?console.error(l,...a):i==="warn"?console.warn(l,...a):console.log(l,...a);return}};return{...Object.fromEntries(Hx.map(i=>[i,(...[s,...a])=>r(i,s,a)])),get level(){return e}}},FV=WV();function HV(t){function e(n,r){if(typeof r=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(r)){const i=new Date(r);if(!isNaN(i.getTime()))return i}return r}try{return typeof t!="string"?t:JSON.parse(t,e)}catch(n){return FV.error("Error parsing JSON",{error:n}),null}}function KV(t){return t.charAt(0).toUpperCase()+t.slice(1)}var om=class extends Error{constructor(t,e){super(t,e),this.name="BetterAuthError",this.message=t,this.stack=""}};function JV(t){try{return(new URL(t).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new om(`Invalid base URL: ${t}. Please provide a valid base URL.`)}}function eq(t){try{const e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new om(`Invalid base URL: ${t}. URL must include 'http://' or 'https://'`)}catch(e){throw e instanceof om?e:new om(`Invalid base URL: ${t}. Please provide a valid base URL.`,{cause:e})}}function Av(t,e="/api/auth"){if(eq(t),JV(t))return t;const n=t.replace(/\/+$/,"");return!e||e==="/"?n:(e=e.startsWith("/")?e:`/${e}`,`${n}${e}`)}function tq(t,e,n,r,i){if(t)return Av(t,e);{const s=Mi.BETTER_AUTH_URL||Mi.NEXT_PUBLIC_BETTER_AUTH_URL||Mi.PUBLIC_BETTER_AUTH_URL||Mi.NUXT_PUBLIC_BETTER_AUTH_URL||Mi.NUXT_PUBLIC_AUTH_URL||(Mi.BASE_URL!=="/"?Mi.BASE_URL:void 0);if(s)return Av(s,e)}if(typeof window<"u"&&window.location)return Av(window.location.origin,e)}const nq={id:"redirect",name:"Redirect",hooks:{onSuccess(t){var e,n;if((e=t.data)!=null&&e.url&&((n=t.data)!=null&&n.redirect)&&typeof window<"u"&&window.location&&window.location)try{window.location.href=t.data.url}catch{}}}},rq={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},iq=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,ZR={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},sq=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function oq(t){return t instanceof Date&&!isNaN(t.getTime())}function aq(t){const e=sq.exec(t);if(!e)return null;const[,n,r,i,s,a,l,u,d,h,g]=e,m=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(s,10),parseInt(a,10),parseInt(l,10),u?parseInt(u.padEnd(3,"0"),10):0));if(d){const O=(parseInt(h,10)*60+parseInt(g,10))*(d==="+"?-1:1);m.setUTCMinutes(m.getUTCMinutes()+O)}return oq(m)?m:null}function lq(t,e={}){const{strict:n=!1,warnings:r=!1,reviver:i,parseDates:s=!0}=e;if(typeof t!="string")return t;const a=t.trim();if(a.length>0&&a[0]==='"'&&a.endsWith('"')&&!a.slice(1,-1).includes('"'))return a.slice(1,-1);const l=a.toLowerCase();if(l.length<=9&&l in ZR)return ZR[l];if(!iq.test(a)){if(n)throw new SyntaxError("[better-json] Invalid JSON");return t}if(Object.entries(rq).some(([u,d])=>{const h=d.test(a);return h&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${u} pattern`),h})&&n)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(a,(d,h)=>{if(d==="__proto__"||d==="constructor"&&h&&typeof h=="object"&&"prototype"in h){r&&console.warn(`[better-json] Dropping "${d}" key to prevent prototype pollution`);return}if(s&&typeof h=="string"){const g=aq(h);if(g)return g}return i?i(d,h):h})}catch(u){if(n)throw u;return t}}function cq(t,e={strict:!0}){return lq(t,e)}function uq(t,e){const n=KM(!1),r=jV(n,"/get-session",t,{method:"GET"});return JM(r,()=>{const i=ZV({sessionAtom:r,sessionSignal:n,$fetch:t,options:e});return i.init(),()=>{i.cleanup()}}),{session:r,$sessionSignal:n}}function Pv(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Kx(t,e,n=".",r){if(!Pv(e))return Kx(t,{},n,r);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const a=t[s];a!=null&&(r&&r(i,s,a,n)||(Array.isArray(a)&&Array.isArray(i[s])?i[s]=[...a,...i[s]]:Pv(a)&&Pv(i[s])?i[s]=Kx(a,i[s],(n?`${n}.`:"")+s.toString(),r):i[s]=a))}return i}function fq(t){return(...e)=>e.reduce((n,r)=>Kx(n,r,"",t),{})}const dq=fq();var hq=Object.defineProperty,pq=Object.defineProperties,gq=Object.getOwnPropertyDescriptors,XR=Object.getOwnPropertySymbols,mq=Object.prototype.hasOwnProperty,Oq=Object.prototype.propertyIsEnumerable,BR=(t,e,n)=>e in t?hq(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,es=(t,e)=>{for(var n in e||(e={}))mq.call(e,n)&&BR(t,n,e[n]);if(XR)for(var n of XR(e))Oq.call(e,n)&&BR(t,n,e[n]);return t},As=(t,e)=>pq(t,gq(e)),yq=class extends Error{constructor(t,e,n){super(e||t.toString(),{cause:n}),this.status=t,this.statusText=e,this.error=n,Error.captureStackTrace(this,this.constructor)}},bq=async(t,e)=>{var n,r,i,s,a,l;let u=e||{};const d={onRequest:[e==null?void 0:e.onRequest],onResponse:[e==null?void 0:e.onResponse],onSuccess:[e==null?void 0:e.onSuccess],onError:[e==null?void 0:e.onError],onRetry:[e==null?void 0:e.onRetry]};if(!e||!(e!=null&&e.plugins))return{url:t,options:u,hooks:d};for(const h of(e==null?void 0:e.plugins)||[]){if(h.init){const g=await((n=h.init)==null?void 0:n.call(h,t.toString(),e));u=g.options||u,t=g.url}d.onRequest.push((r=h.hooks)==null?void 0:r.onRequest),d.onResponse.push((i=h.hooks)==null?void 0:i.onResponse),d.onSuccess.push((s=h.hooks)==null?void 0:s.onSuccess),d.onError.push((a=h.hooks)==null?void 0:a.onError),d.onRetry.push((l=h.hooks)==null?void 0:l.onRetry)}return{url:t,options:u,hooks:d}},UR=class{constructor(t){this.options=t}shouldAttemptRetry(t,e){return this.options.shouldRetry?Promise.resolve(t<this.options.attempts&&this.options.shouldRetry(e)):Promise.resolve(t<this.options.attempts)}getDelay(){return this.options.delay}},vq=class{constructor(t){this.options=t}shouldAttemptRetry(t,e){return this.options.shouldRetry?Promise.resolve(t<this.options.attempts&&this.options.shouldRetry(e)):Promise.resolve(t<this.options.attempts)}getDelay(t){return Math.min(this.options.maxDelay,this.options.baseDelay*2**t)}};function xq(t){if(typeof t=="number")return new UR({type:"linear",attempts:t,delay:1e3});switch(t.type){case"linear":return new UR(t);case"exponential":return new vq(t);default:throw new Error("Invalid retry strategy")}}var Sq=async t=>{const e={},n=async r=>typeof r=="function"?await r():r;if(t!=null&&t.auth){if(t.auth.type==="Bearer"){const r=await n(t.auth.token);if(!r)return e;e.authorization=`Bearer ${r}`}else if(t.auth.type==="Basic"){const[r,i]=await Promise.all([n(t.auth.username),n(t.auth.password)]);if(!r||!i)return e;e.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(t.auth.type==="Custom"){const[r,i]=await Promise.all([n(t.auth.prefix),n(t.auth.value)]);if(!i)return e;e.authorization=`${r??""} ${i}`}}return e},wq=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function kq(t){const e=t.headers.get("content-type"),n=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!e)return"json";const r=e.split(";").shift()||"";return wq.test(r)?"json":n.has(r)||r.startsWith("text/")?"text":"blob"}function Cq(t){try{return JSON.parse(t),!0}catch{return!1}}function Jx(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}function VR(t){try{return JSON.parse(t)}catch{return t}}function qR(t){return typeof t=="function"}function Tq(t){if(t!=null&&t.customFetchImpl)return t.customFetchImpl;if(typeof globalThis<"u"&&qR(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&qR(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}async function Qq(t){const e=new Headers(t==null?void 0:t.headers),n=await Sq(t);for(const[r,i]of Object.entries(n||{}))e.set(r,i);if(!e.has("content-type")){const r=Eq(t==null?void 0:t.body);r&&e.set("content-type",r)}return e}function Eq(t){return Jx(t)?"application/json":null}function Rq(t){if(!(t!=null&&t.body))return null;const e=new Headers(t==null?void 0:t.headers);if(Jx(t.body)&&!e.has("content-type")){for(const[n,r]of Object.entries(t==null?void 0:t.body))r instanceof Date&&(t.body[n]=r.toISOString());return JSON.stringify(t.body)}return e.has("content-type")&&e.get("content-type")==="application/x-www-form-urlencoded"&&Jx(t.body)?new URLSearchParams(t.body).toString():t.body}function Aq(t,e){var n;if(e!=null&&e.method)return e.method.toUpperCase();if(t.startsWith("@")){const r=(n=t.split("@")[1])==null?void 0:n.split("/")[0];return t2.includes(r)?r.toUpperCase():e!=null&&e.body?"POST":"GET"}return e!=null&&e.body?"POST":"GET"}function Pq(t,e){let n;return!(t!=null&&t.signal)&&(t!=null&&t.timeout)&&(n=setTimeout(()=>e==null?void 0:e.abort(),t==null?void 0:t.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var _q=class e2 extends Error{constructor(e,n){super(n||JSON.stringify(e,null,2)),this.issues=e,Object.setPrototypeOf(this,e2.prototype)}};async function am(t,e){const n=await t["~standard"].validate(e);if(n.issues)throw new _q(n.issues);return n.value}var t2=["get","post","put","patch","delete"],$q=t=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(e,n){var r,i,s,a;const l=((i=(r=t.plugins)==null?void 0:r.find(u=>{var d;return(d=u.schema)!=null&&d.config?e.startsWith(u.schema.config.baseURL||"")||e.startsWith(u.schema.config.prefix||""):!1}))==null?void 0:i.schema)||t.schema;if(l){let u=e;(s=l.config)!=null&&s.prefix&&u.startsWith(l.config.prefix)&&(u=u.replace(l.config.prefix,""),l.config.baseURL&&(e=e.replace(l.config.prefix,l.config.baseURL))),(a=l.config)!=null&&a.baseURL&&u.startsWith(l.config.baseURL)&&(u=u.replace(l.config.baseURL,""));const d=l.schema[u];if(d){let h=As(es({},n),{method:d.method,output:d.output});return n!=null&&n.disableValidation||(h=As(es({},h),{body:d.input?await am(d.input,n==null?void 0:n.body):n==null?void 0:n.body,params:d.params?await am(d.params,n==null?void 0:n.params):n==null?void 0:n.params,query:d.query?await am(d.query,n==null?void 0:n.query):n==null?void 0:n.query})),{url:e,options:h}}}return{url:e,options:n}}}),Mq=t=>{async function e(n,r){const i=As(es(es({},t),r),{plugins:[...(t==null?void 0:t.plugins)||[],$q(t||{}),...(r==null?void 0:r.plugins)||[]]});if(t!=null&&t.catchAllError)try{return await eS(n,i)}catch(s){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:s}}}return await eS(n,i)}return e};function Dq(t,e){const{baseURL:n,params:r,query:i}=e||{query:{},params:{},baseURL:""};let s=t.startsWith("http")?t.split("/").slice(0,3).join("/"):n||"";if(t.startsWith("@")){const g=t.toString().split("@")[1].split("/")[0];t2.includes(g)&&(t=t.replace(`@${g}/`,"/"))}s.endsWith("/")||(s+="/");let[a,l]=t.replace(s,"").split("?");const u=new URLSearchParams(l);for(const[g,m]of Object.entries(i||{})){if(m==null)continue;let O;if(typeof m=="string")O=m;else if(Array.isArray(m)){for(const v of m)u.append(g,v);continue}else O=JSON.stringify(m);u.set(g,O)}if(r)if(Array.isArray(r)){const g=a.split("/").filter(m=>m.startsWith(":"));for(const[m,O]of g.entries()){const v=r[m];a=a.replace(O,v)}}else for(const[g,m]of Object.entries(r))a=a.replace(`:${g}`,String(m));a=a.split("/").map(encodeURIComponent).join("/"),a.startsWith("/")&&(a=a.slice(1));let d=u.toString();return d=d.length>0?`?${d}`.replace(/\+/g,"%20"):"",s.startsWith("http")?new URL(`${a}${d}`,s):`${s}${a}${d}`}var eS=async(t,e)=>{var n,r,i,s,a,l,u,d;const{hooks:h,url:g,options:m}=await bq(t,e),O=Tq(m),v=new AbortController,x=(n=m.signal)!=null?n:v.signal,k=Dq(g,m),C=Rq(m),Q=await Qq(m),R=Aq(g,m);let E=As(es({},m),{url:k,headers:Q,body:C,method:R,signal:x});for(const Y of h.onRequest)if(Y){const H=await Y(E);typeof H=="object"&&H!==null&&(E=H)}("pipeTo"in E&&typeof E.pipeTo=="function"||typeof((r=e==null?void 0:e.body)==null?void 0:r.pipe)=="function")&&("duplex"in E||(E.duplex="half"));const{clearTimeout:P}=Pq(m,v);let $=await O(E.url,E);P();const _={response:$,request:E};for(const Y of h.onResponse)if(Y){const H=await Y(As(es({},_),{response:(i=e==null?void 0:e.hookOptions)!=null&&i.cloneResponse?$.clone():$}));H instanceof Response?$=H:typeof H=="object"&&H!==null&&($=H.response)}if($.ok){if(!(E.method!=="HEAD"))return{data:"",error:null};const H=kq($),ee={data:null,response:$,request:E};if(H==="json"||H==="text"){const N=await $.text(),V=(s=E.jsonParser)!=null?s:VR;ee.data=await V(N)}else ee.data=await $[H]();E!=null&&E.output&&E.output&&!E.disableValidation&&(ee.data=await am(E.output,ee.data));for(const N of h.onSuccess)N&&await N(As(es({},ee),{response:(a=e==null?void 0:e.hookOptions)!=null&&a.cloneResponse?$.clone():$}));return e!=null&&e.throw?ee.data:{data:ee.data,error:null}}const D=(l=e==null?void 0:e.jsonParser)!=null?l:VR,B=await $.text(),L=Cq(B),M=L?await D(B):null,U={response:$,responseText:B,request:E,error:As(es({},M),{status:$.status,statusText:$.statusText})};for(const Y of h.onError)Y&&await Y(As(es({},U),{response:(u=e==null?void 0:e.hookOptions)!=null&&u.cloneResponse?$.clone():$}));if(e!=null&&e.retry){const Y=xq(e.retry),H=(d=e.retryAttempt)!=null?d:0;if(await Y.shouldAttemptRetry(H,$)){for(const N of h.onRetry)N&&await N(_);const ee=Y.getDelay(H);return await new Promise(N=>setTimeout(N,ee)),await eS(t,As(es({},e),{retryAttempt:H+1}))}}if(e!=null&&e.throw)throw new yq($.status,$.statusText,L?M:B);return{data:null,error:As(es({},M),{status:$.status,statusText:$.statusText})}};const Nq=(t,e)=>{var E,P,$,_,D,B,L;const n="credentials"in Request.prototype,r=tq(t==null?void 0:t.baseURL,t==null?void 0:t.basePath)??"/api/auth",i=((E=t==null?void 0:t.plugins)==null?void 0:E.flatMap(M=>M.fetchPlugins).filter(M=>M!==void 0))||[],s={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:(P=t==null?void 0:t.fetchOptions)==null?void 0:P.onSuccess,onError:($=t==null?void 0:t.fetchOptions)==null?void 0:$.onError,onRequest:(_=t==null?void 0:t.fetchOptions)==null?void 0:_.onRequest,onResponse:(D=t==null?void 0:t.fetchOptions)==null?void 0:D.onResponse}},{onSuccess:a,onError:l,onRequest:u,onResponse:d,...h}=(t==null?void 0:t.fetchOptions)||{},g=Mq({baseURL:r,...n?{credentials:"include"}:{},method:"GET",jsonParser(M){return M?cq(M,{strict:!1}):null},customFetchImpl:fetch,...h,plugins:[s,...h.plugins||[],...t!=null&&t.disableDefaultFetchPlugins?[]:[nq],...i]}),{$sessionSignal:m,session:O}=uq(g,t),v=(t==null?void 0:t.plugins)||[];let x={};const k={$sessionSignal:m,session:O},C={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},Q=[{signal:"$sessionSignal",matcher(M){return M==="/sign-out"||M==="/update-user"||M==="/sign-up/email"||M==="/sign-in/email"||M==="/delete-user"||M==="/verify-email"||M==="/revoke-sessions"||M==="/revoke-session"||M==="/change-email"}}];for(const M of v)M.getAtoms&&Object.assign(k,(B=M.getAtoms)==null?void 0:B.call(M,g)),M.pathMethods&&Object.assign(C,M.pathMethods),M.atomListeners&&Q.push(...M.atomListeners);const R={notify:M=>{k[M].set(!k[M].get())},listen:(M,U)=>{k[M].subscribe(U)},atoms:k};for(const M of v)M.getActions&&(x=dq(((L=M.getActions)==null?void 0:L.call(M,g,R,t))??{},x));return{get baseURL(){return r},pluginsActions:x,pluginsAtoms:k,pluginPathMethods:C,atomListeners:Q,$fetch:g,$store:R}};function Lq(t){return typeof t=="object"&&t!==null&&"get"in t&&typeof t.get=="function"&&"lc"in t&&typeof t.lc=="number"}function zq(t,e,n){const r=e[t],{fetchOptions:i,query:s,...a}=n||{};return r||(i!=null&&i.method?i.method:a&&Object.keys(a).length>0?"POST":"GET")}function jq(t,e,n,r,i){function s(a=[]){return new Proxy(function(){},{get(l,u){if(typeof u!="string"||u==="then"||u==="catch"||u==="finally")return;const d=[...a,u];let h=t;for(const g of d)if(h&&typeof h=="object"&&g in h)h=h[g];else{h=void 0;break}return typeof h=="function"||Lq(h)?h:s(d)},apply:async(l,u,d)=>{const h="/"+a.map(Q=>Q.replace(/[A-Z]/g,R=>`-${R.toLowerCase()}`)).join("/"),g=d[0]||{},m=d[1]||{},{query:O,fetchOptions:v,...x}=g,k={...m,...v},C=zq(h,n,g);return await e(h,{...k,body:C==="GET"?void 0:{...x,...(k==null?void 0:k.body)||{}},query:O||(k==null?void 0:k.query),method:C,async onSuccess(Q){var P;if(await((P=k==null?void 0:k.onSuccess)==null?void 0:P.call(k,Q)),!i||k.disableSignal)return;const R=i.filter($=>$.matcher(h));if(!R.length)return;const E=new Set;for(const $ of R){const _=r[$.signal];if(!_)return;if(E.has($.signal))continue;E.add($.signal);const D=_.get();setTimeout(()=>{_.set(!D)},10)}}})}})}return s()}function Iq(t){const{pluginPathMethods:e,pluginsActions:n,pluginsAtoms:r,$fetch:i,atomListeners:s,$store:a}=Nq(t),l={};for(const[u,d]of Object.entries(r))l[`use${KV(u)}`]=d;return jq({...n,...l,$fetch:i,$store:a},i,e,r,s)}function Zq(t){const e=new URLSearchParams(t);if(e.has("sig")){const n=new URLSearchParams;for(const[r,i]of e.entries())if(n.append(r,i),r==="sig")break;return n.toString()}}const Xq=()=>({id:"oauth-provider-client",fetchPlugins:[{id:"oauth-provider-signin",name:"oauth-provider-signin",description:"Adds the current page query to oauth requests",hooks:{async onRequest(t){var i;const e=t.headers,n=typeof t.body=="string"?e.get("content-type")==="application/x-www-form-urlencoded"?Object.fromEntries(new URLSearchParams(t.body)):HV(t.body??"{}"):t.body;if(n!=null&&n.oauth_query)return;const r=typeof t.url=="string"?new URL(t.url).pathname:t.url.pathname;(r.endsWith("/sign-in/email")||r.endsWith("/sign-in/social")||r.endsWith("/sign-in/oauth2")||r.endsWith("/oauth2/consent")||r.endsWith("/oauth2/continue"))&&(t.body=JSON.stringify({...n,oauth_query:typeof window<"u"?Zq((i=window==null?void 0:window.location)==null?void 0:i.search):void 0}))}}}],$InferServerPlugin:{}}),Bq=Iq({plugins:[Xq()],baseURL:void 0}),Uq=ls("/consent")({component:Vq});function Vq(){const e=new URLSearchParams(window.location.search).get("scope")||"",[n,r]=w.useState(!1),[i,s]=w.useState(null),a=async l=>{var u;r(!0),s(null);try{const d=await Bq.oauth2.consent({accept:l,scope:e});(u=d.data)!=null&&u.uri?window.location.href=d.data.uri:d.error&&(s(d.error.message||"Failed to process consent"),r(!1))}catch(d){s(d instanceof Error?d.message:"An unexpected error occurred"),r(!1)}};return S.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:S.jsxs("div",{className:"max-w-md w-full bg-white rounded-lg shadow-lg p-8",children:[S.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Authorize CLI Access"}),S.jsx("p",{className:"text-gray-600 mb-6",children:"Do you want to allow Kontexted CLI to access your account?"}),i&&S.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm",children:i}),S.jsxs("div",{className:"flex gap-4",children:[S.jsx("button",{onClick:()=>a(!1),disabled:n,className:"flex-1 px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:n?"Processing...":"Deny"}),S.jsx("button",{onClick:()=>a(!0),disabled:n,className:"flex-1 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",children:n?"Processing...":"Authorize"})]})]})})}const qq=ls("/_authed")({component:Yq});function Yq(){const t=or(),{data:e,isLoading:n,error:r}=Ur(Ch);return w.useEffect(()=>{!n&&!e&&!r&&t({to:"/login",replace:!0})},[e,n,r,t]),n?S.jsx("div",{className:"flex min-h-svh items-center justify-center",children:S.jsx("div",{className:"text-muted-foreground",children:"Checking session..."})}):r?S.jsx("div",{className:"flex min-h-svh items-center justify-center",children:S.jsx("div",{className:"text-muted-foreground",children:"Failed to load session. Please refresh the page."})}):e?S.jsx(kh,{}):null}const Gq=ls("/_authed/")({component:Wq});function Wq(){return S.jsx(Xw,{to:"/workspaces",replace:!0})}function YR({className:t,...e}){return S.jsx("div",{"data-slot":"card",className:Ne("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...e})}function n2(){const t=Yr();return ps({mutationFn:async e=>{const n=await rn.createWorkspace(e);if(n.error)throw new Error(n.error);return n.data},onSuccess:()=>{t.invalidateQueries({queryKey:dn.list()})}})}function Fq(){const t=Yr();return ps({mutationFn:async e=>{const n=await rn.uploadWorkspaceEntries(e.workspaceSlug,e.request);if(n.error)throw new Error(n.error);if(!n.data)throw new Error("Failed to upload workspace entries");return n.data},onSuccess:(e,n)=>{t.invalidateQueries({queryKey:dn.tree(n.workspaceSlug)})}})}function Hq(){const t=or(),[e,n]=w.useState(!1),[r,i]=w.useState(""),[s,a]=w.useState(null),l=n2(),u=()=>{n(!1),i(""),a(null)},d=async h=>{h.preventDefault();const g=r.trim();if(!g){a("Workspace name is required.");return}a(null);try{const m=await l.mutateAsync(g);if(!m)throw new Error("Failed to create workspace");u(),t({to:"/workspaces/$workspaceSlug",params:{workspaceSlug:m.slug},search:{labels:void 0}})}catch(m){a(m instanceof Error?m.message:"Unable to create workspace")}};return S.jsxs("div",{className:"flex min-h-svh w-full items-center justify-center p-8",children:[S.jsxs(YR,{className:"flex w-full max-w-md flex-col items-center gap-4 rounded-2xl border border-border bg-card p-6 text-center",children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Create a workspace"}),S.jsx("p",{className:"text-sm text-muted-foreground",children:"No workspace selected. Create one to start organizing your context."})]}),S.jsx(Yn,{type:"button",onClick:()=>n(!0),variant:"default",children:"New workspace"})]}),e?S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:S.jsxs(YR,{className:"w-full max-w-md rounded-2xl bg-card p-6 shadow-lg",role:"dialog","aria-modal":"true","aria-labelledby":"create-workspace-title",children:[S.jsxs("div",{className:"flex items-start justify-between gap-3",children:[S.jsxs("div",{children:[S.jsx("h3",{id:"create-workspace-title",className:"text-lg font-semibold text-foreground",children:"Create a workspace"}),S.jsx("p",{className:"text-sm text-muted-foreground",children:"Give your new workspace a memorable name."})]}),S.jsx(Yn,{type:"button",variant:"ghost",onClick:u,children:"Close"})]}),S.jsxs("form",{className:"mt-6 flex flex-col gap-4",onSubmit:d,children:[S.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-foreground",children:["Workspace name",S.jsx("input",{value:r,onChange:h=>i(h.target.value),className:"h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground outline-none transition focus:border-border",placeholder:"Product planning",autoFocus:!0})]}),s&&S.jsx("p",{className:"rounded-xl border border-destructive/40 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:s}),S.jsxs("div",{className:"flex flex-col-reverse gap-3 sm:flex-row sm:justify-end",children:[S.jsx(Yn,{type:"button",variant:"outline",onClick:u,children:"Cancel"}),S.jsx(Yn,{type:"submit",disabled:l.isPending,children:l.isPending?"Creating...":"Create workspace"})]})]})]})}):null]})}let GO=class extends Error{constructor(n="Unauthorized - session may have expired"){super(n);We(this,"name","UnauthorizedError")}};function Bd(t){return t instanceof GO}const WO={queryKey:dn.list(),queryFn:async()=>{const t=await rn.listWorkspaces();if(t.status===401)throw new GO;if(t.status!==200||!t.data)throw new Error(t.error||"Failed to load workspaces");return t.data}};function r2(t){return{queryKey:dn.detail(t),queryFn:async()=>{const e=await rn.getWorkspace(t);if(e.status===401)throw new GO;if(e.status!==200||!e.data)throw new Error(e.error||"Failed to load workspace");return e.data}}}function i2(t){return{queryKey:dn.tree(t),queryFn:async()=>{const e=await rn.getWorkspaceTree(t);if(e.status===401)throw new GO;if(e.status!==200||!e.data)throw new Error(e.error||"Failed to load workspace tree");return e.data}}}const Kq=ls("/_authed/workspaces/")({component:Jq,loader:async({context:t})=>{const{queryClient:e}=t;try{await e.ensureQueryData(WO)}catch(n){if(Bd(n))throw wh({to:"/login",replace:!0})}}});function Jq(){const t=or(),{data:e,isLoading:n,error:r}=Ur(WO);return w.useEffect(()=>{if(!n&&e&&e.length>0){const i=e[0];t({to:"/workspaces/$workspaceSlug",params:{workspaceSlug:i.slug},search:{labels:void 0},replace:!0})}},[e,n,t]),w.useEffect(()=>{r&&Bd(r)&&t({to:"/login",replace:!0})},[r,t]),n?S.jsx("div",{className:"flex min-h-svh items-center justify-center",children:S.jsx("div",{className:"text-muted-foreground",children:"Loading workspaces..."})}):r?S.jsx("div",{className:"flex min-h-svh items-center justify-center p-8",children:S.jsx("div",{className:"w-full max-w-md rounded-lg border border-destructive/50 bg-destructive/10 p-6 text-center",children:S.jsx("div",{className:"text-destructive font-medium",children:"Failed to load workspaces. Please try again."})})}):e&&e.length===0?S.jsx(Hq,{}):null}/**
42
+ * @license lucide-react v0.562.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const eY=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tY=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),GR=t=>{const e=tY(t);return e.charAt(0).toUpperCase()+e.slice(1)},s2=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),nY=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
47
+ * @license lucide-react v0.562.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */var rY={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
52
+ * @license lucide-react v0.562.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const iY=w.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...l},u)=>w.createElement("svg",{ref:u,...rY,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:s2("lucide",i),...!s&&!nY(l)&&{"aria-hidden":"true"},...l},[...a.map(([d,h])=>w.createElement(d,h)),...Array.isArray(s)?s:[s]]));/**
57
+ * @license lucide-react v0.562.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const sn=(t,e)=>{const n=w.forwardRef(({className:r,...i},s)=>w.createElement(iY,{ref:s,iconNode:e,className:s2(`lucide-${eY(GR(t))}`,`lucide-${t}`,r),...i}));return n.displayName=GR(t),n};/**
62
+ * @license lucide-react v0.562.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const sY=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],oY=sn("arrow-left",sY);/**
67
+ * @license lucide-react v0.562.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const aY=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],o2=sn("chevron-down",aY);/**
72
+ * @license lucide-react v0.562.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const lY=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],cY=sn("chevron-right",lY);/**
77
+ * @license lucide-react v0.562.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const uY=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],a2=sn("chevrons-up-down",uY);/**
82
+ * @license lucide-react v0.562.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const fY=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],dY=sn("circle-check-big",fY);/**
87
+ * @license lucide-react v0.562.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const hY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],pY=sn("circle-x",hY);/**
92
+ * @license lucide-react v0.562.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const gY=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],Gw=sn("cloud-upload",gY);/**
97
+ * @license lucide-react v0.562.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const mY=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],OY=sn("code",mY);/**
102
+ * @license lucide-react v0.562.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const yY=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],bY=sn("ellipsis",yY);/**
107
+ * @license lucide-react v0.562.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const vY=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],xY=sn("eye",vY);/**
112
+ * @license lucide-react v0.562.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const SY=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]],l2=sn("file-plus",SY);/**
117
+ * @license lucide-react v0.562.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const wY=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ww=sn("file-text",wY);/**
122
+ * @license lucide-react v0.562.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const kY=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],c2=sn("folder-plus",kY);/**
127
+ * @license lucide-react v0.562.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const CY=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Kc=sn("folder",CY);/**
132
+ * @license lucide-react v0.562.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const TY=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],QY=sn("git-commit-horizontal",TY);/**
137
+ * @license lucide-react v0.562.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const EY=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Fw=sn("grip-vertical",EY);/**
142
+ * @license lucide-react v0.562.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const RY=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],AY=sn("history",RY);/**
147
+ * @license lucide-react v0.562.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const PY=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],u2=sn("loader-circle",PY);/**
152
+ * @license lucide-react v0.562.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const _Y=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],f2=sn("pencil",_Y);/**
157
+ * @license lucide-react v0.562.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const $Y=[["path",{d:"M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3",key:"lubmu8"}],["path",{d:"M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3",key:"1ag34g"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],MY=sn("square-split-horizontal",$Y);/**
162
+ * @license lucide-react v0.562.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const DY=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],d2=sn("trash-2",DY);/**
167
+ * @license lucide-react v0.562.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const NY=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],LY=sn("wifi-off",NY);/**
172
+ * @license lucide-react v0.562.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const zY=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],jY=sn("wifi",zY);/**
177
+ * @license lucide-react v0.562.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const IY=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ZY=sn("x",IY);function XY(t,e){const n=getComputedStyle(t),r=parseFloat(n.fontSize);return e*r}function BY(t,e){const n=getComputedStyle(t.ownerDocument.body),r=parseFloat(n.fontSize);return e*r}function UY(t){return t/100*window.innerHeight}function VY(t){return t/100*window.innerWidth}function qY(t){switch(typeof t){case"number":return[t,"px"];case"string":{const e=parseFloat(t);return t.endsWith("%")?[e,"%"]:t.endsWith("px")?[e,"px"]:t.endsWith("rem")?[e,"rem"]:t.endsWith("em")?[e,"em"]:t.endsWith("vh")?[e,"vh"]:t.endsWith("vw")?[e,"vw"]:[e,"%"]}}}function xg({groupSize:t,panelElement:e,styleProp:n}){let r;const[i,s]=qY(n);switch(s){case"%":{r=i/100*t;break}case"px":{r=i;break}case"rem":{r=BY(e,i);break}case"em":{r=XY(e,i);break}case"vh":{r=UY(i);break}case"vw":{r=VY(i);break}}return r}function ss(t){return parseFloat(t.toFixed(3))}function mu({group:t}){const{orientation:e,panels:n}=t;return n.reduce((r,i)=>(r+=e==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,r),0)}function tS(t){const{panels:e}=t,n=mu({group:t});return n===0?e.map(r=>({collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):e.map(r=>{const{element:i,panelConstraints:s}=r;let a=0;if(s.collapsedSize!==void 0){const h=xg({groupSize:n,panelElement:i,styleProp:s.collapsedSize});a=ss(h/n*100)}let l;if(s.defaultSize!==void 0){const h=xg({groupSize:n,panelElement:i,styleProp:s.defaultSize});l=ss(h/n*100)}let u=0;if(s.minSize!==void 0){const h=xg({groupSize:n,panelElement:i,styleProp:s.minSize});u=ss(h/n*100)}let d=100;if(s.maxSize!==void 0){const h=xg({groupSize:n,panelElement:i,styleProp:s.maxSize});d=ss(h/n*100)}return{collapsedSize:a,collapsible:s.collapsible===!0,defaultSize:l,disabled:s.disabled,minSize:u,maxSize:d,panelId:r.id}})}function Mt(t,e="Assertion error"){if(!t)throw Error(e)}function nS(t,e){return Array.from(e).sort(t==="horizontal"?YY:GY)}function YY(t,e){const n=t.element.offsetLeft-e.element.offsetLeft;return n!==0?n:t.element.offsetWidth-e.element.offsetWidth}function GY(t,e){const n=t.element.offsetTop-e.element.offsetTop;return n!==0?n:t.element.offsetHeight-e.element.offsetHeight}function h2(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE}function p2(t,e){return{x:t.x>=e.left&&t.x<=e.right?0:Math.min(Math.abs(t.x-e.left),Math.abs(t.x-e.right)),y:t.y>=e.top&&t.y<=e.bottom?0:Math.min(Math.abs(t.y-e.top),Math.abs(t.y-e.bottom))}}function WY({orientation:t,rects:e,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let i,s=Number.MAX_VALUE;for(const a of e){const{x:l,y:u}=p2(r,a),d=t==="horizontal"?l:u;d<s&&(s=d,i=a)}return Mt(i,"No rect found"),i}let Sg;function FY(){return Sg===void 0&&(typeof matchMedia=="function"?Sg=!!matchMedia("(pointer:coarse)").matches:Sg=!1),Sg}function g2(t){const{element:e,orientation:n,panels:r,separators:i}=t,s=nS(n,Array.from(e.children).filter(h2).map(v=>({element:v}))).map(({element:v})=>v),a=[];let l=!1,u=!1,d=-1,h=-1,g=0,m,O=[];{let v=-1;for(const x of s)x.hasAttribute("data-panel")&&(v++,x.ariaDisabled===null&&(g++,d===-1&&(d=v),h=v))}if(g>1){let v=-1;for(const x of s)if(x.hasAttribute("data-panel")){v++;const k=r.find(C=>C.element===x);if(k){if(m){const C=m.element.getBoundingClientRect(),Q=x.getBoundingClientRect();let R;if(u){const E=n==="horizontal"?new DOMRect(C.right,C.top,0,C.height):new DOMRect(C.left,C.bottom,C.width,0),P=n==="horizontal"?new DOMRect(Q.left,Q.top,0,Q.height):new DOMRect(Q.left,Q.top,Q.width,0);switch(O.length){case 0:{R=[E,P];break}case 1:{const $=O[0],_=WY({orientation:n,rects:[C,Q],targetRect:$.element.getBoundingClientRect()});R=[$,_===C?P:E];break}default:{R=O;break}}}else O.length?R=O:R=[n==="horizontal"?new DOMRect(C.right,Q.top,Q.left-C.right,Q.height):new DOMRect(Q.left,C.bottom,Q.width,Q.top-C.bottom)];for(const E of R){let P="width"in E?E:E.element.getBoundingClientRect();const $=FY()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine;if(P.width<$){const D=$-P.width;P=new DOMRect(P.x-D/2,P.y,P.width+D,P.height)}if(P.height<$){const D=$-P.height;P=new DOMRect(P.x,P.y-D/2,P.width,P.height+D)}const _=v<=d||v>h;!l&&!_&&a.push({group:t,groupSize:mu({group:t}),panels:[m,k],separator:"width"in E?void 0:E,rect:P}),l=!1}}u=!1,m=k,O=[]}}else if(x.hasAttribute("data-separator")){x.ariaDisabled!==null&&(l=!0);const k=i.find(C=>C.element===x);k?O.push(k):(m=void 0,O=[])}else u=!0}return a}var Ca;class HY{constructor(){eR(this,Ca,{})}addListener(e,n){const r=Uf(this,Ca)[e];return r===void 0?Uf(this,Ca)[e]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(e,n)}}emit(e,n){const r=Uf(this,Ca)[e];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let i=!1,s=null;const a=Array.from(r);for(let l=0;l<a.length;l++){const u=a[l];try{u.call(null,n)}catch(d){s===null&&(i=!0,s=d)}}if(i)throw s}}removeAllListeners(){tR(this,Ca,{})}removeListener(e,n){const r=Uf(this,Ca)[e];if(r!==void 0){const i=r.indexOf(n);i>=0&&r.splice(i,1)}}}Ca=new WeakMap;function vr(t,e,n=0){return Math.abs(ss(t)-ss(e))<=n}let _i={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map};const Ro=new HY;function wr(){return _i}function kr(t){const e=typeof t=="function"?t(_i):t;if(_i===e)return _i;const n=_i;return _i={..._i,...e},e.cursorFlags!==void 0&&Ro.emit("cursorFlagsChange",_i.cursorFlags),e.interactionState!==void 0&&Ro.emit("interactionStateChange",_i.interactionState),e.mountedGroups!==void 0&&(_i.mountedGroups.forEach((r,i)=>{r.derivedPanelConstraints.forEach(s=>{if(s.collapsible){const{layout:a}=n.mountedGroups.get(i)??{};if(a){const l=vr(s.collapsedSize,r.layout[s.panelId]),u=vr(s.collapsedSize,a[s.panelId]);l&&!u&&(i.inMemoryLastExpandedPanelSizes[s.panelId]=a[s.panelId])}}})}),Ro.emit("mountedGroupsChange",_i.mountedGroups)),_i}function KY(t,e,n){let r,i={x:1/0,y:1/0};for(const s of e){const a=p2(n,s.rect);switch(t){case"horizontal":{a.x<=i.x&&(r=s,i=a);break}case"vertical":{a.y<=i.y&&(r=s,i=a);break}}}return r?{distance:i,hitRegion:r}:void 0}function JY(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function e8(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:HR(t),b:HR(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Mt(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:FR(WR(n.a)),b:FR(WR(n.b))};if(i.a===i.b){const s=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let l=s.length;for(;l--;){const u=s[l];if(u===a.a)return 1;if(u===a.b)return-1}}return Math.sign(i.a-i.b)}const t8=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function n8(t){const e=getComputedStyle(m2(t)??t).display;return e==="flex"||e==="inline-flex"}function r8(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||n8(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||t8.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function WR(t){let e=t.length;for(;e--;){const n=t[e];if(Mt(n,"Missing node"),r8(n))return n}return null}function FR(t){return t&&Number(getComputedStyle(t).zIndex)||0}function HR(t){const e=[];for(;t;)e.push(t),t=m2(t);return e}function m2(t){const{parentNode:e}=t;return JY(e)?e.host:e}function i8(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function s8({groupElement:t,hitRegion:e,pointerEventTarget:n}){if(!h2(n)||n.contains(t)||t.contains(n))return!0;if(e8(n,t)>0){let r=n;for(;r;){if(r.contains(t))return!0;if(i8(r.getBoundingClientRect(),e))return!1;r=r.parentElement}}return!0}function Hw(t,e){const n=[];return e.forEach((r,i)=>{if(i.disabled)return;const s=g2(i),a=KY(i.orientation,s,{x:t.clientX,y:t.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&s8({groupElement:i.element,hitRegion:a.hitRegion.rect,pointerEventTarget:t.target})&&n.push(a.hitRegion)}),n}function o8(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function Ps(t,e){return vr(t,e)?0:t>e?1:-1}function Vc({overrideDisabledPanels:t,panelConstraints:e,prevSize:n,size:r}){const{collapsedSize:i=0,collapsible:s,disabled:a,maxSize:l=100,minSize:u=0}=e;if(a&&!t)return n;if(Ps(r,u)<0)if(s){const d=(i+u)/2;Ps(r,d)<0?r=i:r=u}else r=u;return r=Math.min(l,r),r=ss(r),r}function Ud({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:s}){if(vr(t,0))return e;const a=s==="imperative-api",l=Object.values(e),u=Object.values(i),d=[...l],[h,g]=r;Mt(h!=null,"Invalid first pivot index"),Mt(g!=null,"Invalid second pivot index");let m=0;switch(s){case"keyboard":{{const x=t<0?g:h,k=n[x];Mt(k,`Panel constraints not found for index ${x}`);const{collapsedSize:C=0,collapsible:Q,minSize:R=0}=k;if(Q){const E=l[x];if(Mt(E!=null,`Previous layout not found for panel index ${x}`),vr(E,C)){const P=R-E;Ps(P,Math.abs(t))>0&&(t=t<0?0-P:P)}}}{const x=t<0?h:g,k=n[x];Mt(k,`No panel constraints found for index ${x}`);const{collapsedSize:C=0,collapsible:Q,minSize:R=0}=k;if(Q){const E=l[x];if(Mt(E!=null,`Previous layout not found for panel index ${x}`),vr(E,R)){const P=E-C;Ps(P,Math.abs(t))>0&&(t=t<0?0-P:P)}}}break}default:{const x=t<0?g:h,k=n[x];Mt(k,`Panel constraints not found for index ${x}`);const C=l[x],{collapsible:Q,collapsedSize:R,minSize:E}=k;if(Q&&Ps(C,E)<0)if(t>0){const P=E-R,$=P/2,_=C+t;Ps(_,E)<0&&(t=Ps(t,$)<=0?0:P)}else{const P=E-R,$=100-P/2,_=C-t;Ps(_,E)<0&&(t=Ps(100+t,$)>0?0:-P)}break}}{const x=t<0?1:-1;let k=t<0?g:h,C=0;for(;;){const R=l[k];Mt(R!=null,`Previous layout not found for panel index ${k}`);const E=Vc({overrideDisabledPanels:a,panelConstraints:n[k],prevSize:R,size:100})-R;if(C+=E,k+=x,k<0||k>=n.length)break}const Q=Math.min(Math.abs(t),Math.abs(C));t=t<0?0-Q:Q}{let x=t<0?h:g;for(;x>=0&&x<n.length;){const k=Math.abs(t)-Math.abs(m),C=l[x];Mt(C!=null,`Previous layout not found for panel index ${x}`);const Q=C-k,R=Vc({overrideDisabledPanels:a,panelConstraints:n[x],prevSize:C,size:Q});if(!vr(C,R)&&(m+=C-R,d[x]=R,m.toFixed(3).localeCompare(Math.abs(t).toFixed(3),void 0,{numeric:!0})>=0))break;t<0?x--:x++}}if(o8(u,d))return i;{const x=t<0?g:h,k=l[x];Mt(k!=null,`Previous layout not found for panel index ${x}`);const C=k+m,Q=Vc({overrideDisabledPanels:a,panelConstraints:n[x],prevSize:k,size:C});if(d[x]=Q,!vr(Q,C)){let R=C-Q,E=t<0?g:h;for(;E>=0&&E<n.length;){const P=d[E];Mt(P!=null,`Previous layout not found for panel index ${E}`);const $=P+R,_=Vc({overrideDisabledPanels:a,panelConstraints:n[E],prevSize:P,size:$});if(vr(P,_)||(R-=_-P,d[E]=_),vr(R,0))break;t>0?E--:E++}}}const O=Object.values(d).reduce((x,k)=>k+x,0);if(!vr(O,100,.1))return i;const v=Object.keys(i);return d.reduce((x,k,C)=>(x[v[C]]=k,x),{})}function $l(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(e[n]===void 0||Ps(t[n],e[n])!==0)return!1;return!0}function Ml({layout:t,panelConstraints:e}){const n=Object.values(t),r=[...n],i=r.reduce((l,u)=>l+u,0);if(r.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${r.map(l=>`${l}%`).join(", ")}`);if(!vr(i,100)&&r.length>0)for(let l=0;l<e.length;l++){const u=r[l];Mt(u!=null,`No layout data found for index ${l}`);const d=100/i*u;r[l]=d}let s=0;for(let l=0;l<e.length;l++){const u=n[l];Mt(u!=null,`No layout data found for index ${l}`);const d=r[l];Mt(d!=null,`No layout data found for index ${l}`);const h=Vc({overrideDisabledPanels:!0,panelConstraints:e[l],prevSize:u,size:d});d!=h&&(s+=d-h,r[l]=h)}if(!vr(s,0))for(let l=0;l<e.length;l++){const u=r[l];Mt(u!=null,`No layout data found for index ${l}`);const d=u+s,h=Vc({overrideDisabledPanels:!0,panelConstraints:e[l],prevSize:u,size:d});if(u!==h&&(s-=h-u,r[l]=h,vr(s,0)))break}const a=Object.keys(t);return r.reduce((l,u,d)=>(l[a[d]]=u,l),{})}function O2({groupId:t,panelId:e}){const n=()=>{const{mountedGroups:l}=wr();for(const[u,{defaultLayoutDeferred:d,derivedPanelConstraints:h,layout:g,separatorToPanels:m}]of l)if(u.id===t)return{defaultLayoutDeferred:d,derivedPanelConstraints:h,group:u,layout:g,separatorToPanels:m};throw Error(`Group ${t} not found`)},r=()=>{const l=n().derivedPanelConstraints.find(u=>u.panelId===e);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${e}`)},i=()=>{const l=n().group.panels.find(u=>u.id===e);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${e}`)},s=()=>{const l=n().layout[e];if(l!==void 0)return l;throw Error(`Layout not found for Panel ${e}`)},a=l=>{const u=s();if(l===u)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:h,group:g,layout:m,separatorToPanels:O}=n(),v=g.panels.findIndex(Q=>Q.id===e),x=v===g.panels.length-1,k=Ud({delta:x?u-l:l-u,initialLayout:m,panelConstraints:h,pivotIndices:x?[v-1,v]:[v,v+1],prevLayout:m,trigger:"imperative-api"}),C=Ml({layout:k,panelConstraints:h});$l(m,C)||kr(Q=>({mountedGroups:new Map(Q.mountedGroups).set(g,{defaultLayoutDeferred:d,derivedPanelConstraints:h,layout:C,separatorToPanels:O})}))};return{collapse:()=>{const{collapsible:l,collapsedSize:u}=r(),{mutableValues:d}=i(),h=s();l&&h!==u&&(d.expandToSize=h,a(u))},expand:()=>{const{collapsible:l,collapsedSize:u,minSize:d}=r(),{mutableValues:h}=i(),g=s();if(l&&g===u){let m=h.expandToSize??d;m===0&&(m=1),a(m)}},getSize:()=>{const{group:l}=n(),u=s(),{element:d}=i(),h=l.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:u,inPixels:h}},isCollapsed:()=>{const{collapsible:l,collapsedSize:u}=r(),d=s();return l&&vr(u,d)},resize:l=>{if(s()!==l){let u;switch(typeof l){case"number":{const{group:d}=n(),h=mu({group:d});u=ss(l/h*100);break}case"string":{u=parseFloat(l);break}}a(u)}}}}function KR(t){if(t.defaultPrevented)return;const{mountedGroups:e}=wr();Hw(t,e).forEach(n=>{if(n.separator){const r=n.panels.find(i=>i.panelConstraints.defaultSize!==void 0);if(r){const i=r.panelConstraints.defaultSize,s=O2({groupId:n.group.id,panelId:r.id});s&&i!==void 0&&(s.resize(i),t.preventDefault())}}})}function lm(t){const{mountedGroups:e}=wr();for(const[n]of e)if(n.separators.some(r=>r.element===t))return n;throw Error("Could not find parent Group for separator element")}function y2({groupId:t}){const e=()=>{const{mountedGroups:n}=wr();for(const[r,i]of n)if(r.id===t)return{group:r,...i};throw Error(`Could not find Group with id "${t}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=e();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:s,layout:a,separatorToPanels:l}=e(),u=Ml({layout:n,panelConstraints:i});if(r)return a;if(!$l(a,u)){kr(h=>({mountedGroups:new Map(h.mountedGroups).set(s,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:u,separatorToPanels:l})}));const d=s.panels.map(({id:h})=>h).join(",");s.inMemoryLayouts[d]=u}return u}}}function b2(t){const{mountedGroups:e}=wr(),n=e.get(t);return Mt(n,`Mounted Group ${t.id} not found`),n}function hl(t,e){const n=lm(t),r=b2(n),i=n.separators.find(h=>h.element===t);Mt(i,"Matching separator not found");const s=r.separatorToPanels.get(i);Mt(s,"Matching panels not found");const a=s.map(h=>n.panels.indexOf(h)),l=y2({groupId:n.id}).getLayout(),u=Ud({delta:e,initialLayout:l,panelConstraints:r.derivedPanelConstraints,pivotIndices:a,prevLayout:l,trigger:"keyboard"}),d=Ml({layout:u,panelConstraints:r.derivedPanelConstraints});$l(l,d)||kr(h=>({mountedGroups:new Map(h.mountedGroups).set(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,layout:d,separatorToPanels:r.separatorToPanels})}))}function JR(t){if(t.defaultPrevented)return;const e=t.currentTarget,n=lm(e);if(!n.disabled)switch(t.key){case"ArrowDown":{t.preventDefault(),n.orientation==="vertical"&&hl(e,5);break}case"ArrowLeft":{t.preventDefault(),n.orientation==="horizontal"&&hl(e,-5);break}case"ArrowRight":{t.preventDefault(),n.orientation==="horizontal"&&hl(e,5);break}case"ArrowUp":{t.preventDefault(),n.orientation==="vertical"&&hl(e,-5);break}case"End":{t.preventDefault(),hl(e,100);break}case"Enter":{t.preventDefault();const r=lm(e),{derivedPanelConstraints:i,layout:s,separatorToPanels:a}=b2(r),l=r.separators.find(g=>g.element===e);Mt(l,"Matching separator not found");const u=a.get(l);Mt(u,"Matching panels not found");const d=u[0],h=i.find(g=>g.panelId===d.id);if(Mt(h,"Panel metadata not found"),h.collapsible){const g=s[d.id],m=h.collapsedSize===g?r.inMemoryLastExpandedPanelSizes[d.id]??h.minSize:h.collapsedSize;hl(e,m-g)}break}case"F6":{t.preventDefault();const r=lm(e).separators.map(a=>a.element),i=Array.from(r).findIndex(a=>a===t.currentTarget);Mt(i!==null,"Index not found");const s=t.shiftKey?i>0?i-1:r.length-1:i+1<r.length?i+1:0;r[s].focus();break}case"Home":{t.preventDefault(),hl(e,-100);break}}}function eA(t){if(t.defaultPrevented||t.pointerType==="mouse"&&t.button>0)return;const{mountedGroups:e}=wr(),n=Hw(t,e),r=new Map;let i=!1;n.forEach(s=>{s.separator&&(i||(i=!0,s.separator.element.focus()));const a=e.get(s.group);a&&r.set(s.group,a.layout)}),kr({interactionState:{hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:t.clientX,y:t.clientY},state:"active"}}),n.length&&t.preventDefault()}const a8=t=>t,_v=()=>{},v2=1,x2=2,S2=4,w2=8,tA=3,nA=12;let wg;function rA(){return wg===void 0&&(wg=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(wg=!0)),wg}function l8({cursorFlags:t,groups:e,state:n}){let r=0,i=0;switch(n){case"active":case"hover":e.forEach(s=>{if(!s.disableCursor)switch(s.orientation){case"horizontal":{r++;break}case"vertical":{i++;break}}})}if(!(r===0&&i===0)){switch(n){case"active":{if(t&&rA()){const s=(t&v2)!==0,a=(t&x2)!==0,l=(t&S2)!==0,u=(t&w2)!==0;if(s)return l?"se-resize":u?"ne-resize":"e-resize";if(a)return l?"sw-resize":u?"nw-resize":"w-resize";if(l)return"s-resize";if(u)return"n-resize"}break}}return rA()?r>0&&i>0?"move":r>0?"ew-resize":"ns-resize":r>0&&i>0?"grab":r>0?"col-resize":"row-resize"}}const iA=new WeakMap;function Kw(t){if(t.defaultView===null||t.defaultView===void 0)return;let{prevStyle:e,styleSheet:n}=iA.get(t)??{};n===void 0&&(n=new t.defaultView.CSSStyleSheet,t.adoptedStyleSheets.push(n));const{cursorFlags:r,interactionState:i}=wr();switch(i.state){case"active":case"hover":{const s=l8({cursorFlags:r,groups:i.hitRegions.map(l=>l.group),state:i.state}),a=`*, *:hover {cursor: ${s} !important; ${i.state==="active"?"touch-action: none;":""} }`;if(e===a)return;e=a,s?n.cssRules.length===0?n.insertRule(a):n.replaceSync(a):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{e=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}iA.set(t,{prevStyle:e,styleSheet:n})}function k2({document:t,event:e,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:s,prevCursorFlags:a}){let l=0;const u=new Map(i);n.forEach(h=>{const{group:g,groupSize:m}=h,{disableCursor:O,orientation:v,panels:x}=g;let k=0;s?v==="horizontal"?k=(e.clientX-s.x)/m*100:k=(e.clientY-s.y)/m*100:v==="horizontal"?k=e.clientX<0?-100:100:k=e.clientY<0?-100:100;const C=r.get(g),{defaultLayoutDeferred:Q,derivedPanelConstraints:R,layout:E,separatorToPanels:P}=i.get(g)??{defaultLayoutDeferred:!1};if(R&&C&&E&&P){const $=Ud({delta:k,initialLayout:C,panelConstraints:R,pivotIndices:h.panels.map(_=>x.indexOf(_)),prevLayout:E,trigger:"mouse-or-touch"});if($l($,E)){if(k!==0&&!O)switch(v){case"horizontal":{l|=k<0?v2:x2;break}case"vertical":{l|=k<0?S2:w2;break}}}else{u.set(h.group,{defaultLayoutDeferred:Q,derivedPanelConstraints:R,layout:$,separatorToPanels:P});const _=h.group.panels.map(({id:D})=>D).join(",");h.group.inMemoryLayouts[_]=$}}});let d=0;e.movementX===0?d|=a&tA:d|=l&tA,e.movementY===0?d|=a&nA:d|=l&nA,kr({cursorFlags:d,mountedGroups:u}),Kw(t)}function sA(t){const{cursorFlags:e,interactionState:n,mountedGroups:r}=wr();switch(n.state){case"active":k2({document:t.currentTarget,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:r,prevCursorFlags:e})}}function oA(t){if(t.defaultPrevented)return;const{cursorFlags:e,interactionState:n,mountedGroups:r}=wr();switch(n.state){case"active":{if(t.buttons===0){kr(i=>i.interactionState.state==="inactive"?i:{cursorFlags:0,interactionState:{state:"inactive"}}),kr(i=>({mountedGroups:new Map(i.mountedGroups)}));return}k2({document:t.currentTarget,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:e});break}default:{const i=Hw(t,r);i.length===0?n.state!=="inactive"&&kr({interactionState:{state:"inactive"}}):kr({interactionState:{hitRegions:i,state:"hover"}}),Kw(t.currentTarget);break}}}function aA(t){if(t.relatedTarget instanceof HTMLIFrameElement){const{interactionState:e}=wr();switch(e.state){case"hover":kr({interactionState:{state:"inactive"}})}}}function lA(t){if(t.defaultPrevented||t.pointerType==="mouse"&&t.button>0)return;const{interactionState:e}=wr();switch(e.state){case"active":kr({cursorFlags:0,interactionState:{state:"inactive"}}),e.hitRegions.length>0&&(Kw(t.currentTarget),kr(n=>({mountedGroups:new Map(n.mountedGroups)})),t.preventDefault())}}function cA(t){let e=0,n=0;const r={};for(const s of t)if(s.defaultSize!==void 0){e++;const a=ss(s.defaultSize);n+=a,r[s.panelId]=a}else r[s.panelId]=void 0;const i=t.length-e;if(i!==0){const s=ss((100-n)/i);for(const a of t)a.defaultSize===void 0&&(r[a.panelId]=s)}return r}function c8(t,e,n){if(!n[0])return;const r=t.panels.find(u=>u.element===e);if(!r||!r.onResize)return;const i=mu({group:t}),s=t.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,a=r.mutableValues.prevSize,l={asPercentage:ss(s/i*100),inPixels:s};r.mutableValues.prevSize=l,r.onResize(l,r.id,a)}function u8(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function f8(t,e){const n=t.map(i=>i.id),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i))return!1;return!0}const Mc=new Map;function d8(t){let e=!0;Mt(t.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=t.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,s=new n(v=>{for(const x of v){const{borderBoxSize:k,target:C}=x;if(C===t.element){if(e){if(mu({group:t})===0)return;kr(Q=>{const R=Q.mountedGroups.get(t);if(R){const E=tS(t),P=R.defaultLayoutDeferred?cA(E):R.layout,$=Ml({layout:P,panelConstraints:E});return!R.defaultLayoutDeferred&&$l(P,$)&&u8(R.derivedPanelConstraints,E)?Q:{mountedGroups:new Map(Q.mountedGroups).set(t,{defaultLayoutDeferred:!1,derivedPanelConstraints:E,layout:$,separatorToPanels:R.separatorToPanels})}}return Q})}}else c8(t,C,k)}});s.observe(t.element),t.panels.forEach(v=>{Mt(!r.has(v.id),`Panel ids must be unique; id "${v.id}" was used more than once`),r.add(v.id),v.onResize&&s.observe(v.element)});const a=mu({group:t}),l=tS(t),u=t.panels.map(({id:v})=>v).join(",");let d=t.defaultLayout;d&&(f8(t.panels,d)||(d=void 0));const h=t.inMemoryLayouts[u]??d??cA(l),g=Ml({layout:h,panelConstraints:l}),m=g2(t),O=t.element.ownerDocument;return kr(v=>{const x=new Map;return Mc.set(O,(Mc.get(O)??0)+1),m.forEach(k=>{k.separator&&x.set(k.separator,k.panels)}),{mountedGroups:new Map(v.mountedGroups).set(t,{defaultLayoutDeferred:a===0,derivedPanelConstraints:l,layout:g,separatorToPanels:x})}}),t.separators.forEach(v=>{Mt(!i.has(v.id),`Separator ids must be unique; id "${v.id}" was used more than once`),i.add(v.id),v.element.addEventListener("keydown",JR)}),Mc.get(O)===1&&(O.addEventListener("dblclick",KR,!0),O.addEventListener("pointerdown",eA,!0),O.addEventListener("pointerleave",sA),O.addEventListener("pointermove",oA),O.addEventListener("pointerout",aA),O.addEventListener("pointerup",lA,!0)),function(){e=!1,Mc.set(O,Math.max(0,(Mc.get(O)??0)-1)),kr(v=>{const x=new Map(v.mountedGroups);return x.delete(t),{mountedGroups:x}}),t.separators.forEach(v=>{v.element.removeEventListener("keydown",JR)}),Mc.get(O)||(O.removeEventListener("dblclick",KR,!0),O.removeEventListener("pointerdown",eA,!0),O.removeEventListener("pointerleave",sA),O.removeEventListener("pointermove",oA),O.removeEventListener("pointerout",aA),O.removeEventListener("pointerup",lA,!0)),s.disconnect()}}function h8(){const[t,e]=w.useState({}),n=w.useCallback(()=>e({}),[]);return[t,n]}function Jw(t){const e=w.useId();return`${t??e}`}const ql=typeof window<"u"?w.useLayoutEffect:w.useEffect;function Td(t){const e=w.useRef(t);return ql(()=>{e.current=t},[t]),w.useCallback((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[e])}function e1(...t){return Td(e=>{t.forEach(n=>{if(n)switch(typeof n){case"function":{n(e);break}case"object":{n.current=e;break}}})})}function t1(t){const e=w.useRef({...t});return ql(()=>{for(const n in t)e.current[n]=t[n]},[t]),e.current}const C2=w.createContext(null);function p8(t,e){const n=w.useRef({getLayout:()=>({}),setLayout:a8});w.useImperativeHandle(e,()=>n.current,[]),ql(()=>{Object.assign(n.current,y2({groupId:t}))})}function T2({children:t,className:e,defaultLayout:n,disableCursor:r,disabled:i,elementRef:s,groupRef:a,id:l,onLayoutChange:u,onLayoutChanged:d,orientation:h="horizontal",resizeTargetMinimumSize:g={coarse:20,fine:10},style:m,...O}){const v=w.useRef({onLayoutChange:{},onLayoutChanged:{}}),x=Td(M=>{$l(v.current.onLayoutChange,M)||(v.current.onLayoutChange=M,u==null||u(M))}),k=Td(M=>{$l(v.current.onLayoutChanged,M)||(v.current.onLayoutChanged=M,d==null||d(M))}),C=Jw(l),Q=w.useRef(null),[R,E]=h8(),P=w.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:g,separators:[]}),$=e1(Q,s);p8(C,a);const _=Td((M,U)=>{const{interactionState:Y,mountedGroups:H}=wr();for(const ee of H.keys())if(ee.id===M){const N=H.get(ee);if(N){let V=!1;switch(Y.state){case"active":{V=Y.hitRegions.some(Z=>Z.group===ee);break}}return{flexGrow:N.layout[U]??1,pointerEvents:V?"none":void 0}}}return{flexGrow:(n==null?void 0:n[U])??1}}),D=t1({defaultLayout:n,disableCursor:r}),B=w.useMemo(()=>({get disableCursor(){return!!D.disableCursor},getPanelStyles:_,id:C,orientation:h,registerPanel:M=>{const U=P.current;return U.panels=nS(h,[...U.panels,M]),E(),()=>{U.panels=U.panels.filter(Y=>Y!==M),E()}},registerSeparator:M=>{const U=P.current;return U.separators=nS(h,[...U.separators,M]),E(),()=>{U.separators=U.separators.filter(Y=>Y!==M),E()}},togglePanelDisabled:(M,U)=>{const Y=P.current.panels.find(ee=>ee.id===M);Y&&(Y.panelConstraints.disabled=U);const{mountedGroups:H}=wr();for(const ee of H.keys())if(ee.id===C){const N=H.get(ee);N&&(N.derivedPanelConstraints=tS(ee))}},toggleSeparatorDisabled:(M,U)=>{const Y=P.current.separators.find(H=>H.id===M);Y&&(Y.disabled=U)}}),[_,C,E,h,D]),L=w.useRef(null);return ql(()=>{const M=Q.current;if(M===null)return;const U=P.current;let Y;if(D.defaultLayout!==void 0&&Object.keys(D.defaultLayout).length===U.panels.length){Y={};for(const W of U.panels){const fe=D.defaultLayout[W.id];fe!==void 0&&(Y[W.id]=fe)}}const H={defaultLayout:Y,disableCursor:!!D.disableCursor,disabled:!!i,element:M,id:C,inMemoryLastExpandedPanelSizes:P.current.lastExpandedPanelSizes,inMemoryLayouts:P.current.layouts,orientation:h,panels:U.panels,resizeTargetMinimumSize:U.resizeTargetMinimumSize,separators:U.separators};L.current=H;const ee=d8(H),N=wr().mountedGroups.get(H);if(N){const{defaultLayoutDeferred:W,derivedPanelConstraints:fe,layout:se}=N;!W&&fe.length>0&&(x(se),k(se))}const V=Ro.addListener("interactionStateChange",W=>{W.state}),Z=Ro.addListener("mountedGroupsChange",W=>{const fe=W.get(H);if(fe){const{defaultLayoutDeferred:se,derivedPanelConstraints:ge,layout:oe}=fe;if(se||ge.length===0)return;const{interactionState:he}=wr(),me=he.state!=="active";x(oe),me&&k(oe)}});return()=>{L.current=null,ee(),V(),Z()}},[i,C,k,x,h,R,D]),w.useEffect(()=>{const M=L.current;M&&(M.defaultLayout=n,M.disableCursor=!!r)}),S.jsx(C2.Provider,{value:B,children:S.jsx("div",{...O,className:e,"data-group":!0,"data-testid":C,id:C,ref:$,style:{height:"100%",width:"100%",overflow:"hidden",...m,display:"flex",flexDirection:h==="horizontal"?"row":"column",flexWrap:"nowrap"},children:t})})}T2.displayName="Group";function n1(){const t=w.useContext(C2);return Mt(t,"Group Context not found; did you render a Panel or Separator outside of a Group?"),t}function g8(t,e){const{id:n}=n1(),r=w.useRef({collapse:_v,expand:_v,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:_v});w.useImperativeHandle(e,()=>r.current,[]),ql(()=>{Object.assign(r.current,O2({groupId:n,panelId:t}))})}function Q2({children:t,className:e,collapsedSize:n="0%",collapsible:r=!1,defaultSize:i,disabled:s,elementRef:a,id:l,maxSize:u="100%",minSize:d="0%",onResize:h,panelRef:g,style:m,...O}){const v=!!l,x=Jw(l),k=t1({disabled:s}),C=w.useRef(null),Q=e1(C,a),{getPanelStyles:R,id:E,registerPanel:P,togglePanelDisabled:$}=n1(),_=h!==null,D=Td((L,M,U)=>{h==null||h(L,l,U)});ql(()=>{const L=C.current;if(L!==null){const M={element:L,id:x,idIsStable:v,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:_?D:void 0,panelConstraints:{collapsedSize:n,collapsible:r,defaultSize:i,disabled:k.disabled,maxSize:u,minSize:d}};return P(M)}},[n,r,i,_,x,v,u,d,D,P,k]),w.useEffect(()=>{$(x,!!s)},[s,x,$]),g8(x,g);const B=w.useSyncExternalStore(L=>(Ro.addListener("mountedGroupsChange",L),()=>{Ro.removeListener("mountedGroupsChange",L)}),()=>JSON.stringify(R(E,x)),()=>JSON.stringify(R(E,x)));return S.jsx("div",{...O,"aria-disabled":s||void 0,"data-panel":!0,"data-testid":x,id:x,ref:Q,style:{...m8,display:"flex",flexBasis:0,flexShrink:1,overflow:"hidden",...JSON.parse(B)},children:S.jsx("div",{className:e,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,...m},children:t})})}Q2.displayName="Panel";const m8={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function O8({layout:t,panelConstraints:e,panelId:n,panelIndex:r}){let i,s;const a=t[n],l=e.find(u=>u.panelId===n);if(l){const u=l.maxSize,d=l.collapsible?l.collapsedSize:l.minSize,h=[r,r+1];s=Ml({layout:Ud({delta:d-a,initialLayout:t,panelConstraints:e,pivotIndices:h,prevLayout:t}),panelConstraints:e})[n],i=Ml({layout:Ud({delta:u-a,initialLayout:t,panelConstraints:e,pivotIndices:h,prevLayout:t}),panelConstraints:e})[n]}return{valueControls:n,valueMax:i,valueMin:s,valueNow:a}}function E2({children:t,className:e,disabled:n,elementRef:r,id:i,style:s,...a}){const l=Jw(i),u=t1({disabled:n}),[d,h]=w.useState({}),[g,m]=w.useState("inactive"),O=w.useRef(null),v=e1(O,r),{disableCursor:x,id:k,orientation:C,registerSeparator:Q,toggleSeparatorDisabled:R}=n1(),E=C==="horizontal"?"vertical":"horizontal";ql(()=>{const $=O.current;if($!==null){const _={disabled:u.disabled,element:$,id:l},D=Q(_),B=Ro.addListener("interactionStateChange",M=>{m(M.state!=="inactive"&&M.hitRegions.some(U=>U.separator===_)?M.state:"inactive")}),L=Ro.addListener("mountedGroupsChange",M=>{M.forEach(({derivedPanelConstraints:U,layout:Y,separatorToPanels:H},ee)=>{if(ee.id===k){const N=H.get(_);if(N){const V=N[0],Z=ee.panels.indexOf(V);h(O8({layout:Y,panelConstraints:U,panelId:V.id,panelIndex:Z}))}}})});return()=>{B(),L(),D()}}},[k,l,Q,u]),w.useEffect(()=>{R(l,!!n)},[n,l,R]);let P;return n&&!x&&(P="not-allowed"),S.jsx("div",{...a,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":E,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:t,className:e,"data-separator":n?"disabled":g,"data-testid":l,id:l,ref:v,role:"separator",style:{flexBasis:"auto",cursor:P,...s,flexGrow:0,flexShrink:0},tabIndex:n?void 0:0})}E2.displayName="Separator";function y8({className:t,...e}){return S.jsx(T2,{"data-slot":"resizable-panel-group",className:Ne("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...e})}function uA({...t}){return S.jsx(Q2,{"data-slot":"resizable-panel",...t})}function b8({withHandle:t,className:e,...n}){return S.jsx(E2,{"data-slot":"resizable-handle",className:Ne("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90 cursor-col-resize",e),...n,children:t&&S.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:S.jsx(Fw,{className:"size-2.5"})})})}const $v=768;function v8(){const[t,e]=w.useState(void 0);return w.useEffect(()=>{const n=window.matchMedia(`(max-width: ${$v-1}px)`),r=()=>{e(window.innerWidth<$v)};return n.addEventListener("change",r),e(window.innerWidth<$v),()=>n.removeEventListener("change",r)},[]),!!t}var x8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],S8=x8.reduce((t,e)=>{const n=OM(`Primitive.${e}`),r=w.forwardRef((i,s)=>{const{asChild:a,...l}=i,u=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),w8="Separator",fA="horizontal",k8=["horizontal","vertical"],R2=w.forwardRef((t,e)=>{const{decorative:n,orientation:r=fA,...i}=t,s=C8(r)?r:fA,l=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return S.jsx(S8.div,{"data-orientation":s,...l,...i,ref:e})});R2.displayName=w8;function C8(t){return k8.includes(t)}var T8=R2;function Q8({className:t,orientation:e="horizontal",decorative:n=!0,...r}){return S.jsx(T8,{"data-slot":"separator",decorative:n,orientation:e,className:Ne("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}function E8(t,e=globalThis==null?void 0:globalThis.document){const n=Vs(t);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var R8="DismissableLayer",rS="dismissableLayer.update",A8="dismissableLayer.pointerDownOutside",P8="dismissableLayer.focusOutside",dA,A2=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),FO=w.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...u}=t,d=w.useContext(A2),[h,g]=w.useState(null),m=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,O]=w.useState({}),v=Nn(e,_=>g(_)),x=Array.from(d.layers),[k]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=x.indexOf(k),Q=h?x.indexOf(h):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,E=Q>=C,P=M8(_=>{const D=_.target,B=[...d.branches].some(L=>L.contains(D));!E||B||(i==null||i(_),a==null||a(_),_.defaultPrevented||l==null||l())},m),$=D8(_=>{const D=_.target;[...d.branches].some(L=>L.contains(D))||(s==null||s(_),a==null||a(_),_.defaultPrevented||l==null||l())},m);return E8(_=>{Q===d.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&l&&(_.preventDefault(),l()))},m),w.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(dA=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),hA(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=dA)}},[h,m,n,d]),w.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),hA())},[h,d]),w.useEffect(()=>{const _=()=>O({});return document.addEventListener(rS,_),()=>document.removeEventListener(rS,_)},[]),S.jsx(Wt.div,{...u,ref:v,style:{pointerEvents:R?E?"auto":"none":void 0,...t.style},onFocusCapture:$e(t.onFocusCapture,$.onFocusCapture),onBlurCapture:$e(t.onBlurCapture,$.onBlurCapture),onPointerDownCapture:$e(t.onPointerDownCapture,P.onPointerDownCapture)})});FO.displayName=R8;var _8="DismissableLayerBranch",$8=w.forwardRef((t,e)=>{const n=w.useContext(A2),r=w.useRef(null),i=Nn(e,r);return w.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),S.jsx(Wt.div,{...t,ref:i})});$8.displayName=_8;function M8(t,e=globalThis==null?void 0:globalThis.document){const n=Vs(t),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let u=function(){P2(A8,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=u,e.addEventListener("click",i.current,{once:!0})):u()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function D8(t,e=globalThis==null?void 0:globalThis.document){const n=Vs(t),r=w.useRef(!1);return w.useEffect(()=>{const i=s=>{s.target&&!r.current&&P2(P8,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hA(){const t=new CustomEvent(rS);document.dispatchEvent(t)}function P2(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?MM(i,s):i.dispatchEvent(s)}var Mv="focusScope.autoFocusOnMount",Dv="focusScope.autoFocusOnUnmount",pA={bubbles:!1,cancelable:!0},N8="FocusScope",r1=w.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=t,[l,u]=w.useState(null),d=Vs(i),h=Vs(s),g=w.useRef(null),m=Nn(e,x=>u(x)),O=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let x=function(R){if(O.paused||!l)return;const E=R.target;l.contains(E)?g.current=E:ma(g.current,{select:!0})},k=function(R){if(O.paused||!l)return;const E=R.relatedTarget;E!==null&&(l.contains(E)||ma(g.current,{select:!0}))},C=function(R){if(document.activeElement===document.body)for(const P of R)P.removedNodes.length>0&&ma(l)};document.addEventListener("focusin",x),document.addEventListener("focusout",k);const Q=new MutationObserver(C);return l&&Q.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",k),Q.disconnect()}}},[r,l,O.paused]),w.useEffect(()=>{if(l){mA.add(O);const x=document.activeElement;if(!l.contains(x)){const C=new CustomEvent(Mv,pA);l.addEventListener(Mv,d),l.dispatchEvent(C),C.defaultPrevented||(L8(X8(_2(l)),{select:!0}),document.activeElement===x&&ma(l))}return()=>{l.removeEventListener(Mv,d),setTimeout(()=>{const C=new CustomEvent(Dv,pA);l.addEventListener(Dv,h),l.dispatchEvent(C),C.defaultPrevented||ma(x??document.body,{select:!0}),l.removeEventListener(Dv,h),mA.remove(O)},0)}}},[l,d,h,O]);const v=w.useCallback(x=>{if(!n&&!r||O.paused)return;const k=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,C=document.activeElement;if(k&&C){const Q=x.currentTarget,[R,E]=z8(Q);R&&E?!x.shiftKey&&C===E?(x.preventDefault(),n&&ma(R,{select:!0})):x.shiftKey&&C===R&&(x.preventDefault(),n&&ma(E,{select:!0})):C===Q&&x.preventDefault()}},[n,r,O.paused]);return S.jsx(Wt.div,{tabIndex:-1,...a,ref:m,onKeyDown:v})});r1.displayName=N8;function L8(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(ma(r,{select:e}),document.activeElement!==n)return}function z8(t){const e=_2(t),n=gA(e,t),r=gA(e.reverse(),t);return[n,r]}function _2(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function gA(t,e){for(const n of t)if(!j8(n,{upTo:e}))return n}function j8(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function I8(t){return t instanceof HTMLInputElement&&"select"in t}function ma(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&I8(t)&&e&&t.select()}}var mA=Z8();function Z8(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=OA(t,e),t.unshift(e)},remove(e){var n;t=OA(t,e),(n=t[0])==null||n.resume()}}}function OA(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function X8(t){return t.filter(e=>e.tagName!=="A")}var B8="Portal",HO=w.forwardRef((t,e)=>{var l;const{container:n,...r}=t,[i,s]=w.useState(!1);Ma(()=>s(!0),[]);const a=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?u4.createPortal(S.jsx(Wt.div,{...r,ref:e}),a):null});HO.displayName=B8;var Nv=0;function $2(){w.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??yA()),document.body.insertAdjacentElement("beforeend",t[1]??yA()),Nv++,()=>{Nv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Nv--}},[])}function yA(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Ms=function(){return Ms=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ms.apply(this,arguments)};function M2(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function U8(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var cm="right-scroll-bar-position",um="width-before-scroll-bar",V8="with-scroll-bars-hidden",q8="--removed-body-scroll-bar-size";function Lv(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Y8(t,e){var n=w.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var G8=typeof window<"u"?w.useLayoutEffect:w.useEffect,bA=new WeakMap;function W8(t,e){var n=Y8(null,function(r){return t.forEach(function(i){return Lv(i,r)})});return G8(function(){var r=bA.get(n);if(r){var i=new Set(r),s=new Set(t),a=n.current;i.forEach(function(l){s.has(l)||Lv(l,null)}),s.forEach(function(l){i.has(l)||Lv(l,a)})}bA.set(n,t)},[t]),n}function F8(t){return t}function H8(t,e){e===void 0&&(e=F8);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var a=e(s,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(s),a=n}var u=function(){var h=a;a=[],h.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(h){a.push(h),d()},filter:function(h){return a=a.filter(h),n}}}};return i}function K8(t){t===void 0&&(t={});var e=H8(null);return e.options=Ms({async:!0,ssr:!1},t),e}var D2=function(t){var e=t.sideCar,n=M2(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Ms({},n))};D2.isSideCarExport=!0;function J8(t,e){return t.useMedium(e),D2}var N2=K8(),zv=function(){},KO=w.forwardRef(function(t,e){var n=w.useRef(null),r=w.useState({onScrollCapture:zv,onWheelCapture:zv,onTouchMoveCapture:zv}),i=r[0],s=r[1],a=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,h=t.enabled,g=t.shards,m=t.sideCar,O=t.noRelative,v=t.noIsolation,x=t.inert,k=t.allowPinchZoom,C=t.as,Q=C===void 0?"div":C,R=t.gapMode,E=M2(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=m,$=W8([n,e]),_=Ms(Ms({},E),i);return w.createElement(w.Fragment,null,h&&w.createElement(P,{sideCar:N2,removeScrollBar:d,shards:g,noRelative:O,noIsolation:v,inert:x,setCallbacks:s,allowPinchZoom:!!k,lockRef:n,gapMode:R}),a?w.cloneElement(w.Children.only(l),Ms(Ms({},_),{ref:$})):w.createElement(Q,Ms({},_,{className:u,ref:$}),l))});KO.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};KO.classNames={fullWidth:um,zeroRight:cm};var e6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function t6(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=e6();return e&&t.setAttribute("nonce",e),t}function n6(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function r6(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var i6=function(){var t=0,e=null;return{add:function(n){t==0&&(e=t6())&&(n6(e,n),r6(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},s6=function(){var t=i6();return function(e,n){w.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},L2=function(){var t=s6(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},o6={left:0,top:0,right:0,gap:0},jv=function(t){return parseInt(t||"",10)||0},a6=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[jv(n),jv(r),jv(i)]},l6=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return o6;var e=a6(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},c6=L2(),Jc="data-scroll-locked",u6=function(t,e,n,r){var i=t.left,s=t.top,a=t.right,l=t.gap;return n===void 0&&(n="margin"),`
182
+ .`.concat(V8,` {
183
+ overflow: hidden `).concat(r,`;
184
+ padding-right: `).concat(l,"px ").concat(r,`;
185
+ }
186
+ body[`).concat(Jc,`] {
187
+ overflow: hidden `).concat(r,`;
188
+ overscroll-behavior: contain;
189
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
190
+ padding-left: `.concat(i,`px;
191
+ padding-top: `).concat(s,`px;
192
+ padding-right: `).concat(a,`px;
193
+ margin-left:0;
194
+ margin-top:0;
195
+ margin-right: `).concat(l,"px ").concat(r,`;
196
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
197
+ }
198
+
199
+ .`).concat(cm,` {
200
+ right: `).concat(l,"px ").concat(r,`;
201
+ }
202
+
203
+ .`).concat(um,` {
204
+ margin-right: `).concat(l,"px ").concat(r,`;
205
+ }
206
+
207
+ .`).concat(cm," .").concat(cm,` {
208
+ right: 0 `).concat(r,`;
209
+ }
210
+
211
+ .`).concat(um," .").concat(um,` {
212
+ margin-right: 0 `).concat(r,`;
213
+ }
214
+
215
+ body[`).concat(Jc,`] {
216
+ `).concat(q8,": ").concat(l,`px;
217
+ }
218
+ `)},vA=function(){var t=parseInt(document.body.getAttribute(Jc)||"0",10);return isFinite(t)?t:0},f6=function(){w.useEffect(function(){return document.body.setAttribute(Jc,(vA()+1).toString()),function(){var t=vA()-1;t<=0?document.body.removeAttribute(Jc):document.body.setAttribute(Jc,t.toString())}},[])},d6=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;f6();var s=w.useMemo(function(){return l6(i)},[i]);return w.createElement(c6,{styles:u6(s,!e,i,n?"":"!important")})},iS=!1;if(typeof window<"u")try{var kg=Object.defineProperty({},"passive",{get:function(){return iS=!0,!0}});window.addEventListener("test",kg,kg),window.removeEventListener("test",kg,kg)}catch{iS=!1}var Dc=iS?{passive:!1}:!1,h6=function(t){return t.tagName==="TEXTAREA"},z2=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!h6(t)&&n[e]==="visible")},p6=function(t){return z2(t,"overflowY")},g6=function(t){return z2(t,"overflowX")},xA=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=j2(t,r);if(i){var s=I2(t,r),a=s[1],l=s[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},m6=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},O6=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},j2=function(t,e){return t==="v"?p6(e):g6(e)},I2=function(t,e){return t==="v"?m6(e):O6(e)},y6=function(t,e){return t==="h"&&e==="rtl"?-1:1},b6=function(t,e,n,r,i){var s=y6(t,window.getComputedStyle(e).direction),a=s*r,l=n.target,u=e.contains(l),d=!1,h=a>0,g=0,m=0;do{if(!l)break;var O=I2(t,l),v=O[0],x=O[1],k=O[2],C=x-k-s*v;(v||C)&&j2(t,l)&&(g+=C,m+=v);var Q=l.parentNode;l=Q&&Q.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Q.host:Q}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(h&&Math.abs(g)<1||!h&&Math.abs(m)<1)&&(d=!0),d},Cg=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},SA=function(t){return[t.deltaX,t.deltaY]},wA=function(t){return t&&"current"in t?t.current:t},v6=function(t,e){return t[0]===e[0]&&t[1]===e[1]},x6=function(t){return`
219
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
220
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
221
+ `)},S6=0,Nc=[];function w6(t){var e=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(S6++)[0],s=w.useState(L2)[0],a=w.useRef(t);w.useEffect(function(){a.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var x=U8([t.lockRef.current],(t.shards||[]).map(wA),!0).filter(Boolean);return x.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var l=w.useCallback(function(x,k){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var C=Cg(x),Q=n.current,R="deltaX"in x?x.deltaX:Q[0]-C[0],E="deltaY"in x?x.deltaY:Q[1]-C[1],P,$=x.target,_=Math.abs(R)>Math.abs(E)?"h":"v";if("touches"in x&&_==="h"&&$.type==="range")return!1;var D=window.getSelection(),B=D&&D.anchorNode,L=B?B===$||B.contains($):!1;if(L)return!1;var M=xA(_,$);if(!M)return!0;if(M?P=_:(P=_==="v"?"h":"v",M=xA(_,$)),!M)return!1;if(!r.current&&"changedTouches"in x&&(R||E)&&(r.current=P),!P)return!0;var U=r.current||P;return b6(U,k,x,U==="h"?R:E)},[]),u=w.useCallback(function(x){var k=x;if(!(!Nc.length||Nc[Nc.length-1]!==s)){var C="deltaY"in k?SA(k):Cg(k),Q=e.current.filter(function(P){return P.name===k.type&&(P.target===k.target||k.target===P.shadowParent)&&v6(P.delta,C)})[0];if(Q&&Q.should){k.cancelable&&k.preventDefault();return}if(!Q){var R=(a.current.shards||[]).map(wA).filter(Boolean).filter(function(P){return P.contains(k.target)}),E=R.length>0?l(k,R[0]):!a.current.noIsolation;E&&k.cancelable&&k.preventDefault()}}},[]),d=w.useCallback(function(x,k,C,Q){var R={name:x,delta:k,target:C,should:Q,shadowParent:k6(C)};e.current.push(R),setTimeout(function(){e.current=e.current.filter(function(E){return E!==R})},1)},[]),h=w.useCallback(function(x){n.current=Cg(x),r.current=void 0},[]),g=w.useCallback(function(x){d(x.type,SA(x),x.target,l(x,t.lockRef.current))},[]),m=w.useCallback(function(x){d(x.type,Cg(x),x.target,l(x,t.lockRef.current))},[]);w.useEffect(function(){return Nc.push(s),t.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",u,Dc),document.addEventListener("touchmove",u,Dc),document.addEventListener("touchstart",h,Dc),function(){Nc=Nc.filter(function(x){return x!==s}),document.removeEventListener("wheel",u,Dc),document.removeEventListener("touchmove",u,Dc),document.removeEventListener("touchstart",h,Dc)}},[]);var O=t.removeScrollBar,v=t.inert;return w.createElement(w.Fragment,null,v?w.createElement(s,{styles:x6(i)}):null,O?w.createElement(d6,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function k6(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const C6=J8(N2,w6);var i1=w.forwardRef(function(t,e){return w.createElement(KO,Ms({},t,{ref:e,sideCar:C6}))});i1.classNames=KO.classNames;var T6=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Lc=new WeakMap,Tg=new WeakMap,Qg={},Iv=0,Z2=function(t){return t&&(t.host||Z2(t.parentNode))},Q6=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Z2(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},E6=function(t,e,n,r){var i=Q6(e,Array.isArray(t)?t:[t]);Qg[n]||(Qg[n]=new WeakMap);var s=Qg[n],a=[],l=new Set,u=new Set(i),d=function(g){!g||l.has(g)||(l.add(g),d(g.parentNode))};i.forEach(d);var h=function(g){!g||u.has(g)||Array.prototype.forEach.call(g.children,function(m){if(l.has(m))h(m);else try{var O=m.getAttribute(r),v=O!==null&&O!=="false",x=(Lc.get(m)||0)+1,k=(s.get(m)||0)+1;Lc.set(m,x),s.set(m,k),a.push(m),x===1&&v&&Tg.set(m,!0),k===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",m,C)}})};return h(e),l.clear(),Iv++,function(){a.forEach(function(g){var m=Lc.get(g)-1,O=s.get(g)-1;Lc.set(g,m),s.set(g,O),m||(Tg.has(g)||g.removeAttribute(r),Tg.delete(g)),O||g.removeAttribute(n)}),Iv--,Iv||(Lc=new WeakMap,Lc=new WeakMap,Tg=new WeakMap,Qg={})}},X2=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=T6(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),E6(r,i,n,"aria-hidden")):function(){return null}};function R6(t){const e=A6(t),n=w.forwardRef((r,i)=>{const{children:s,...a}=r,l=w.Children.toArray(s),u=l.find(_6);if(u){const d=u.props.children,h=l.map(g=>g===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:g);return S.jsx(e,{...a,ref:i,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return S.jsx(e,{...a,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function A6(t){const e=w.forwardRef((n,r)=>{const{children:i,...s}=n;if(w.isValidElement(i)){const a=M6(i),l=$6(s,i.props);return i.type!==w.Fragment&&(l.ref=r?Va(r,a):a),w.cloneElement(i,l)}return w.Children.count(i)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var P6=Symbol("radix.slottable");function _6(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===P6}function $6(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...l)=>{const u=s(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function M6(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var JO="Dialog",[B2]=Zo(JO),[D6,ms]=B2(JO),U2=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=t,l=w.useRef(null),u=w.useRef(null),[d,h]=Th({prop:r,defaultProp:i??!1,onChange:s,caller:JO});return S.jsx(D6,{scope:e,triggerRef:l,contentRef:u,contentId:Pa(),titleId:Pa(),descriptionId:Pa(),open:d,onOpenChange:h,onOpenToggle:w.useCallback(()=>h(g=>!g),[h]),modal:a,children:n})};U2.displayName=JO;var V2="DialogTrigger",N6=w.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ms(V2,n),s=Nn(e,i.triggerRef);return S.jsx(Wt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":a1(i.open),...r,ref:s,onClick:$e(t.onClick,i.onOpenToggle)})});N6.displayName=V2;var s1="DialogPortal",[L6,q2]=B2(s1,{forceMount:void 0}),Y2=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,s=ms(s1,e);return S.jsx(L6,{scope:e,forceMount:n,children:w.Children.map(r,a=>S.jsx(gs,{present:n||s.open,children:S.jsx(HO,{asChild:!0,container:i,children:a})}))})};Y2.displayName=s1;var zm="DialogOverlay",G2=w.forwardRef((t,e)=>{const n=q2(zm,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=ms(zm,t.__scopeDialog);return s.modal?S.jsx(gs,{present:r||s.open,children:S.jsx(j6,{...i,ref:e})}):null});G2.displayName=zm;var z6=R6("DialogOverlay.RemoveScroll"),j6=w.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ms(zm,n);return S.jsx(i1,{as:z6,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(Wt.div,{"data-state":a1(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Dl="DialogContent",W2=w.forwardRef((t,e)=>{const n=q2(Dl,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,s=ms(Dl,t.__scopeDialog);return S.jsx(gs,{present:r||s.open,children:s.modal?S.jsx(I6,{...i,ref:e}):S.jsx(Z6,{...i,ref:e})})});W2.displayName=Dl;var I6=w.forwardRef((t,e)=>{const n=ms(Dl,t.__scopeDialog),r=w.useRef(null),i=Nn(e,n.contentRef,r);return w.useEffect(()=>{const s=r.current;if(s)return X2(s)},[]),S.jsx(F2,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$e(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:$e(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&s.preventDefault()}),onFocusOutside:$e(t.onFocusOutside,s=>s.preventDefault())})}),Z6=w.forwardRef((t,e)=>{const n=ms(Dl,t.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return S.jsx(F2,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,l;(a=t.onCloseAutoFocus)==null||a.call(t,s),s.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((d=n.triggerRef.current)==null?void 0:d.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),F2=w.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=t,l=ms(Dl,n),u=w.useRef(null),d=Nn(e,u);return $2(),S.jsxs(S.Fragment,{children:[S.jsx(r1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:S.jsx(FO,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":a1(l.open),...a,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(X6,{titleId:l.titleId}),S.jsx(U6,{contentRef:u,descriptionId:l.descriptionId})]})]})}),o1="DialogTitle",H2=w.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ms(o1,n);return S.jsx(Wt.h2,{id:i.titleId,...r,ref:e})});H2.displayName=o1;var K2="DialogDescription",J2=w.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ms(K2,n);return S.jsx(Wt.p,{id:i.descriptionId,...r,ref:e})});J2.displayName=K2;var eD="DialogClose",tD=w.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=ms(eD,n);return S.jsx(Wt.button,{type:"button",...r,ref:e,onClick:$e(t.onClick,()=>i.onOpenChange(!1))})});tD.displayName=eD;function a1(t){return t?"open":"closed"}var nD="DialogTitleWarning",[sde,rD]=NU(nD,{contentName:Dl,titleName:o1,docsSlug:"dialog"}),X6=({titleId:t})=>{const e=rD(nD),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
222
+
223
+ If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
224
+
225
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return w.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},B6="DialogDescriptionWarning",U6=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rD(B6).contentName}}.`;return w.useEffect(()=>{var s;const i=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},V6=U2,q6=Y2,Y6=G2,G6=W2,W6=H2,F6=J2,H6=tD;function iD({...t}){return S.jsx(V6,{"data-slot":"sheet",...t})}function K6({...t}){return S.jsx(q6,{"data-slot":"sheet-portal",...t})}function J6({className:t,...e}){return S.jsx(Y6,{"data-slot":"sheet-overlay",className:Ne("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function sD({className:t,children:e,side:n="right",...r}){return S.jsxs(K6,{children:[S.jsx(J6,{}),S.jsxs(G6,{"data-slot":"sheet-content",className:Ne("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...r,children:[e,S.jsxs(H6,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[S.jsx(ZY,{className:"size-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function oD({className:t,...e}){return S.jsx("div",{"data-slot":"sheet-header",className:Ne("flex flex-col gap-1.5 p-4",t),...e})}function aD({className:t,...e}){return S.jsx(W6,{"data-slot":"sheet-title",className:Ne("text-foreground font-semibold",t),...e})}function lD({className:t,...e}){return S.jsx(F6,{"data-slot":"sheet-description",className:Ne("text-muted-foreground text-sm",t),...e})}function Zs({className:t,...e}){return S.jsx("div",{"data-slot":"skeleton",className:Ne("bg-accent animate-pulse rounded-md",t),...e})}const e7=["top","right","bottom","left"],Da=Math.min,ui=Math.max,jm=Math.round,Eg=Math.floor,Xs=t=>({x:t,y:t}),t7={left:"right",right:"left",bottom:"top",top:"bottom"},n7={start:"end",end:"start"};function sS(t,e,n){return ui(t,Da(e,n))}function Mo(t,e){return typeof t=="function"?t(e):t}function Do(t){return t.split("-")[0]}function Xu(t){return t.split("-")[1]}function l1(t){return t==="x"?"y":"x"}function c1(t){return t==="y"?"height":"width"}const r7=new Set(["top","bottom"]);function zs(t){return r7.has(Do(t))?"y":"x"}function u1(t){return l1(zs(t))}function i7(t,e,n){n===void 0&&(n=!1);const r=Xu(t),i=u1(t),s=c1(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Im(a)),[a,Im(a)]}function s7(t){const e=Im(t);return[oS(t),e,oS(e)]}function oS(t){return t.replace(/start|end/g,e=>n7[e])}const kA=["left","right"],CA=["right","left"],o7=["top","bottom"],a7=["bottom","top"];function l7(t,e,n){switch(t){case"top":case"bottom":return n?e?CA:kA:e?kA:CA;case"left":case"right":return e?o7:a7;default:return[]}}function c7(t,e,n,r){const i=Xu(t);let s=l7(Do(t),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(oS)))),s}function Im(t){return t.replace(/left|right|bottom|top/g,e=>t7[e])}function u7(t){return{top:0,right:0,bottom:0,left:0,...t}}function cD(t){return typeof t!="number"?u7(t):{top:t,right:t,bottom:t,left:t}}function Zm(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function TA(t,e,n){let{reference:r,floating:i}=t;const s=zs(e),a=u1(e),l=c1(a),u=Do(e),d=s==="y",h=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,m=r[l]/2-i[l]/2;let O;switch(u){case"top":O={x:h,y:r.y-i.height};break;case"bottom":O={x:h,y:r.y+r.height};break;case"right":O={x:r.x+r.width,y:g};break;case"left":O={x:r.x-i.width,y:g};break;default:O={x:r.x,y:r.y}}switch(Xu(e)){case"start":O[a]-=m*(n&&d?-1:1);break;case"end":O[a]+=m*(n&&d?-1:1);break}return O}async function f7(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:a,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:g="floating",altBoundary:m=!1,padding:O=0}=Mo(e,t),v=cD(O),k=l[m?g==="floating"?"reference":"floating":g],C=Zm(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(k)))==null||n?k:k.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:u})),Q=g==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),E=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},P=Zm(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:Q,offsetParent:R,strategy:u}):Q);return{top:(C.top-P.top+v.top)/E.y,bottom:(P.bottom-C.bottom+v.bottom)/E.y,left:(C.left-P.left+v.left)/E.x,right:(P.right-C.right+v.right)/E.x}}const d7=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,l=s.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:g}=TA(d,r,u),m=r,O={},v=0;for(let k=0;k<l.length;k++){var x;const{name:C,fn:Q}=l[k],{x:R,y:E,data:P,reset:$}=await Q({x:h,y:g,initialPlacement:r,placement:m,strategy:i,middlewareData:O,rects:d,platform:{...a,detectOverflow:(x=a.detectOverflow)!=null?x:f7},elements:{reference:t,floating:e}});h=R??h,g=E??g,O={...O,[C]:{...O[C],...P}},$&&v<=50&&(v++,typeof $=="object"&&($.placement&&(m=$.placement),$.rects&&(d=$.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):$.rects),{x:h,y:g}=TA(d,m,u)),k=-1)}return{x:h,y:g,placement:m,strategy:i,middlewareData:O}},h7=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:a,elements:l,middlewareData:u}=e,{element:d,padding:h=0}=Mo(t,e)||{};if(d==null)return{};const g=cD(h),m={x:n,y:r},O=u1(i),v=c1(O),x=await a.getDimensions(d),k=O==="y",C=k?"top":"left",Q=k?"bottom":"right",R=k?"clientHeight":"clientWidth",E=s.reference[v]+s.reference[O]-m[O]-s.floating[v],P=m[O]-s.reference[O],$=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let _=$?$[R]:0;(!_||!await(a.isElement==null?void 0:a.isElement($)))&&(_=l.floating[R]||s.floating[v]);const D=E/2-P/2,B=_/2-x[v]/2-1,L=Da(g[C],B),M=Da(g[Q],B),U=L,Y=_-x[v]-M,H=_/2-x[v]/2+D,ee=sS(U,H,Y),N=!u.arrow&&Xu(i)!=null&&H!==ee&&s.reference[v]/2-(H<U?L:M)-x[v]/2<0,V=N?H<U?H-U:H-Y:0;return{[O]:m[O]+V,data:{[O]:ee,centerOffset:H-ee-V,...N&&{alignmentOffset:V}},reset:N}}}),p7=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:h=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:O="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:x=!0,...k}=Mo(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const C=Do(i),Q=zs(l),R=Do(l)===l,E=await(u.isRTL==null?void 0:u.isRTL(d.floating)),P=m||(R||!x?[Im(l)]:s7(l)),$=v!=="none";!m&&$&&P.push(...c7(l,x,v,E));const _=[l,...P],D=await u.detectOverflow(e,k),B=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&B.push(D[C]),g){const H=i7(i,a,E);B.push(D[H[0]],D[H[1]])}if(L=[...L,{placement:i,overflows:B}],!B.every(H=>H<=0)){var M,U;const H=(((M=s.flip)==null?void 0:M.index)||0)+1,ee=_[H];if(ee&&(!(g==="alignment"?Q!==zs(ee):!1)||L.every(Z=>zs(Z.placement)===Q?Z.overflows[0]>0:!0)))return{data:{index:H,overflows:L},reset:{placement:ee}};let N=(U=L.filter(V=>V.overflows[0]<=0).sort((V,Z)=>V.overflows[1]-Z.overflows[1])[0])==null?void 0:U.placement;if(!N)switch(O){case"bestFit":{var Y;const V=(Y=L.filter(Z=>{if($){const W=zs(Z.placement);return W===Q||W==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(W=>W>0).reduce((W,fe)=>W+fe,0)]).sort((Z,W)=>Z[1]-W[1])[0])==null?void 0:Y[0];V&&(N=V);break}case"initialPlacement":N=l;break}if(i!==N)return{reset:{placement:N}}}return{}}}};function QA(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function EA(t){return e7.some(e=>t[e]>=0)}const g7=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:i="referenceHidden",...s}=Mo(t,e);switch(i){case"referenceHidden":{const a=await r.detectOverflow(e,{...s,elementContext:"reference"}),l=QA(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:EA(l)}}}case"escaped":{const a=await r.detectOverflow(e,{...s,altBoundary:!0}),l=QA(a,n.floating);return{data:{escapedOffsets:l,escaped:EA(l)}}}default:return{}}}}},uD=new Set(["left","top"]);async function m7(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Do(n),l=Xu(n),u=zs(n)==="y",d=uD.has(a)?-1:1,h=s&&u?-1:1,g=Mo(e,t);let{mainAxis:m,crossAxis:O,alignmentAxis:v}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof v=="number"&&(O=l==="end"?v*-1:v),u?{x:O*h,y:m*d}:{x:m*d,y:O*h}}const O7=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:a,middlewareData:l}=e,u=await m7(e,t);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:s+u.y,data:{...u,placement:a}}}}},y7=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:C=>{let{x:Q,y:R}=C;return{x:Q,y:R}}},...d}=Mo(t,e),h={x:n,y:r},g=await s.detectOverflow(e,d),m=zs(Do(i)),O=l1(m);let v=h[O],x=h[m];if(a){const C=O==="y"?"top":"left",Q=O==="y"?"bottom":"right",R=v+g[C],E=v-g[Q];v=sS(R,v,E)}if(l){const C=m==="y"?"top":"left",Q=m==="y"?"bottom":"right",R=x+g[C],E=x-g[Q];x=sS(R,x,E)}const k=u.fn({...e,[O]:v,[m]:x});return{...k,data:{x:k.x-n,y:k.y-r,enabled:{[O]:a,[m]:l}}}}}},b7=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=e,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Mo(t,e),h={x:n,y:r},g=zs(i),m=l1(g);let O=h[m],v=h[g];const x=Mo(l,e),k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const R=m==="y"?"height":"width",E=s.reference[m]-s.floating[R]+k.mainAxis,P=s.reference[m]+s.reference[R]-k.mainAxis;O<E?O=E:O>P&&(O=P)}if(d){var C,Q;const R=m==="y"?"width":"height",E=uD.has(Do(i)),P=s.reference[g]-s.floating[R]+(E&&((C=a.offset)==null?void 0:C[g])||0)+(E?0:k.crossAxis),$=s.reference[g]+s.reference[R]+(E?0:((Q=a.offset)==null?void 0:Q[g])||0)-(E?k.crossAxis:0);v<P?v=P:v>$&&(v=$)}return{[m]:O,[g]:v}}}},v7=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:a,elements:l}=e,{apply:u=()=>{},...d}=Mo(t,e),h=await a.detectOverflow(e,d),g=Do(i),m=Xu(i),O=zs(i)==="y",{width:v,height:x}=s.floating;let k,C;g==="top"||g==="bottom"?(k=g,C=m===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(C=g,k=m==="end"?"top":"bottom");const Q=x-h.top-h.bottom,R=v-h.left-h.right,E=Da(x-h[k],Q),P=Da(v-h[C],R),$=!e.middlewareData.shift;let _=E,D=P;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(D=R),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(_=Q),$&&!m){const L=ui(h.left,0),M=ui(h.right,0),U=ui(h.top,0),Y=ui(h.bottom,0);O?D=v-2*(L!==0||M!==0?L+M:ui(h.left,h.right)):_=x-2*(U!==0||Y!==0?U+Y:ui(h.top,h.bottom))}await u({...e,availableWidth:D,availableHeight:_});const B=await a.getDimensions(l.floating);return v!==B.width||x!==B.height?{reset:{rects:!0}}:{}}}};function ey(){return typeof window<"u"}function Bu(t){return fD(t)?(t.nodeName||"").toLowerCase():"#document"}function pi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Fs(t){var e;return(e=(fD(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function fD(t){return ey()?t instanceof Node||t instanceof pi(t).Node:!1}function cs(t){return ey()?t instanceof Element||t instanceof pi(t).Element:!1}function qs(t){return ey()?t instanceof HTMLElement||t instanceof pi(t).HTMLElement:!1}function RA(t){return!ey()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof pi(t).ShadowRoot}const x7=new Set(["inline","contents"]);function Eh(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=us(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!x7.has(i)}const S7=new Set(["table","td","th"]);function w7(t){return S7.has(Bu(t))}const k7=[":popover-open",":modal"];function ty(t){return k7.some(e=>{try{return t.matches(e)}catch{return!1}})}const C7=["transform","translate","scale","rotate","perspective"],T7=["transform","translate","scale","rotate","perspective","filter"],Q7=["paint","layout","strict","content"];function f1(t){const e=d1(),n=cs(t)?us(t):t;return C7.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||T7.some(r=>(n.willChange||"").includes(r))||Q7.some(r=>(n.contain||"").includes(r))}function E7(t){let e=Na(t);for(;qs(e)&&!Ou(e);){if(f1(e))return e;if(ty(e))return null;e=Na(e)}return null}function d1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const R7=new Set(["html","body","#document"]);function Ou(t){return R7.has(Bu(t))}function us(t){return pi(t).getComputedStyle(t)}function ny(t){return cs(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Na(t){if(Bu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||RA(t)&&t.host||Fs(t);return RA(e)?e.host:e}function dD(t){const e=Na(t);return Ou(e)?t.ownerDocument?t.ownerDocument.body:t.body:qs(e)&&Eh(e)?e:dD(e)}function Vd(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=dD(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),a=pi(i);if(s){const l=aS(a);return e.concat(a,a.visualViewport||[],Eh(i)?i:[],l&&n?Vd(l):[])}return e.concat(i,Vd(i,[],n))}function aS(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function hD(t){const e=us(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=qs(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:r,l=jm(n)!==s||jm(r)!==a;return l&&(n=s,r=a),{width:n,height:r,$:l}}function h1(t){return cs(t)?t:t.contextElement}function eu(t){const e=h1(t);if(!qs(e))return Xs(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=hD(e);let a=(s?jm(n.width):n.width)/r,l=(s?jm(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const A7=Xs(0);function pD(t){const e=pi(t);return!d1()||!e.visualViewport?A7:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function P7(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==pi(t)?!1:e}function Nl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=h1(t);let a=Xs(1);e&&(r?cs(r)&&(a=eu(r)):a=eu(t));const l=P7(s,n,r)?pD(s):Xs(0);let u=(i.left+l.x)/a.x,d=(i.top+l.y)/a.y,h=i.width/a.x,g=i.height/a.y;if(s){const m=pi(s),O=r&&cs(r)?pi(r):r;let v=m,x=aS(v);for(;x&&r&&O!==v;){const k=eu(x),C=x.getBoundingClientRect(),Q=us(x),R=C.left+(x.clientLeft+parseFloat(Q.paddingLeft))*k.x,E=C.top+(x.clientTop+parseFloat(Q.paddingTop))*k.y;u*=k.x,d*=k.y,h*=k.x,g*=k.y,u+=R,d+=E,v=pi(x),x=aS(v)}}return Zm({width:h,height:g,x:u,y:d})}function ry(t,e){const n=ny(t).scrollLeft;return e?e.left+n:Nl(Fs(t)).left+n}function gD(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-ry(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function _7(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",a=Fs(r),l=e?ty(e.floating):!1;if(r===a||l&&s)return n;let u={scrollLeft:0,scrollTop:0},d=Xs(1);const h=Xs(0),g=qs(r);if((g||!g&&!s)&&((Bu(r)!=="body"||Eh(a))&&(u=ny(r)),qs(r))){const O=Nl(r);d=eu(r),h.x=O.x+r.clientLeft,h.y=O.y+r.clientTop}const m=a&&!g&&!s?gD(a,u):Xs(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+m.x,y:n.y*d.y-u.scrollTop*d.y+h.y+m.y}}function $7(t){return Array.from(t.getClientRects())}function M7(t){const e=Fs(t),n=ny(t),r=t.ownerDocument.body,i=ui(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=ui(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+ry(t);const l=-n.scrollTop;return us(r).direction==="rtl"&&(a+=ui(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:l}}const AA=25;function D7(t,e){const n=pi(t),r=Fs(t),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,l=0,u=0;if(i){s=i.width,a=i.height;const h=d1();(!h||h&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}const d=ry(r);if(d<=0){const h=r.ownerDocument,g=h.body,m=getComputedStyle(g),O=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,v=Math.abs(r.clientWidth-g.clientWidth-O);v<=AA&&(s-=v)}else d<=AA&&(s+=d);return{width:s,height:a,x:l,y:u}}const N7=new Set(["absolute","fixed"]);function L7(t,e){const n=Nl(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=qs(t)?eu(t):Xs(1),a=t.clientWidth*s.x,l=t.clientHeight*s.y,u=i*s.x,d=r*s.y;return{width:a,height:l,x:u,y:d}}function PA(t,e,n){let r;if(e==="viewport")r=D7(t,n);else if(e==="document")r=M7(Fs(t));else if(cs(e))r=L7(e,n);else{const i=pD(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Zm(r)}function mD(t,e){const n=Na(t);return n===e||!cs(n)||Ou(n)?!1:us(n).position==="fixed"||mD(n,e)}function z7(t,e){const n=e.get(t);if(n)return n;let r=Vd(t,[],!1).filter(l=>cs(l)&&Bu(l)!=="body"),i=null;const s=us(t).position==="fixed";let a=s?Na(t):t;for(;cs(a)&&!Ou(a);){const l=us(a),u=f1(a);!u&&l.position==="fixed"&&(i=null),(s?!u&&!i:!u&&l.position==="static"&&!!i&&N7.has(i.position)||Eh(a)&&!u&&mD(t,a))?r=r.filter(h=>h!==a):i=l,a=Na(a)}return e.set(t,r),r}function j7(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?ty(e)?[]:z7(e,this._c):[].concat(n),r],l=a[0],u=a.reduce((d,h)=>{const g=PA(e,h,i);return d.top=ui(g.top,d.top),d.right=Da(g.right,d.right),d.bottom=Da(g.bottom,d.bottom),d.left=ui(g.left,d.left),d},PA(e,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function I7(t){const{width:e,height:n}=hD(t);return{width:e,height:n}}function Z7(t,e,n){const r=qs(e),i=Fs(e),s=n==="fixed",a=Nl(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const u=Xs(0);function d(){u.x=ry(i)}if(r||!r&&!s)if((Bu(e)!=="body"||Eh(i))&&(l=ny(e)),r){const O=Nl(e,!0,s,e);u.x=O.x+e.clientLeft,u.y=O.y+e.clientTop}else i&&d();s&&!r&&i&&d();const h=i&&!r&&!s?gD(i,l):Xs(0),g=a.left+l.scrollLeft-u.x-h.x,m=a.top+l.scrollTop-u.y-h.y;return{x:g,y:m,width:a.width,height:a.height}}function Zv(t){return us(t).position==="static"}function _A(t,e){if(!qs(t)||us(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Fs(t)===n&&(n=n.ownerDocument.body),n}function OD(t,e){const n=pi(t);if(ty(t))return n;if(!qs(t)){let i=Na(t);for(;i&&!Ou(i);){if(cs(i)&&!Zv(i))return i;i=Na(i)}return n}let r=_A(t,e);for(;r&&w7(r)&&Zv(r);)r=_A(r,e);return r&&Ou(r)&&Zv(r)&&!f1(r)?n:r||E7(t)||n}const X7=async function(t){const e=this.getOffsetParent||OD,n=this.getDimensions,r=await n(t.floating);return{reference:Z7(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function B7(t){return us(t).direction==="rtl"}const U7={convertOffsetParentRelativeRectToViewportRelativeRect:_7,getDocumentElement:Fs,getClippingRect:j7,getOffsetParent:OD,getElementRects:X7,getClientRects:$7,getDimensions:I7,getScale:eu,isElement:cs,isRTL:B7};function yD(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function V7(t,e){let n=null,r;const i=Fs(t);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const d=t.getBoundingClientRect(),{left:h,top:g,width:m,height:O}=d;if(l||e(),!m||!O)return;const v=Eg(g),x=Eg(i.clientWidth-(h+m)),k=Eg(i.clientHeight-(g+O)),C=Eg(h),R={rootMargin:-v+"px "+-x+"px "+-k+"px "+-C+"px",threshold:ui(0,Da(1,u))||1};let E=!0;function P($){const _=$[0].intersectionRatio;if(_!==u){if(!E)return a();_?a(!1,_):r=setTimeout(()=>{a(!1,1e-7)},1e3)}_===1&&!yD(d,t.getBoundingClientRect())&&a(),E=!1}try{n=new IntersectionObserver(P,{...R,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,R)}n.observe(t)}return a(!0),s}function q7(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=h1(t),h=i||s?[...d?Vd(d):[],...Vd(e)]:[];h.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),s&&C.addEventListener("resize",n)});const g=d&&l?V7(d,n):null;let m=-1,O=null;a&&(O=new ResizeObserver(C=>{let[Q]=C;Q&&Q.target===d&&O&&(O.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var R;(R=O)==null||R.observe(e)})),n()}),d&&!u&&O.observe(d),O.observe(e));let v,x=u?Nl(t):null;u&&k();function k(){const C=Nl(t);x&&!yD(x,C)&&n(),x=C,v=requestAnimationFrame(k)}return n(),()=>{var C;h.forEach(Q=>{i&&Q.removeEventListener("scroll",n),s&&Q.removeEventListener("resize",n)}),g==null||g(),(C=O)==null||C.disconnect(),O=null,u&&cancelAnimationFrame(v)}}const Y7=O7,G7=y7,W7=p7,F7=v7,H7=g7,$A=h7,K7=b7,J7=(t,e,n)=>{const r=new Map,i={platform:U7,...n},s={...i.platform,_c:r};return d7(t,e,{...i,platform:s})};var e9=typeof document<"u",t9=function(){},fm=e9?w.useLayoutEffect:t9;function Xm(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Xm(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!Xm(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function bD(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function MA(t,e){const n=bD(t);return Math.round(e*n)/n}function Xv(t){const e=w.useRef(t);return fm(()=>{e.current=t}),e}function n9(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[h,g]=w.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,O]=w.useState(r);Xm(m,r)||O(r);const[v,x]=w.useState(null),[k,C]=w.useState(null),Q=w.useCallback(Z=>{Z!==$.current&&($.current=Z,x(Z))},[]),R=w.useCallback(Z=>{Z!==_.current&&(_.current=Z,C(Z))},[]),E=s||v,P=a||k,$=w.useRef(null),_=w.useRef(null),D=w.useRef(h),B=u!=null,L=Xv(u),M=Xv(i),U=Xv(d),Y=w.useCallback(()=>{if(!$.current||!_.current)return;const Z={placement:e,strategy:n,middleware:m};M.current&&(Z.platform=M.current),J7($.current,_.current,Z).then(W=>{const fe={...W,isPositioned:U.current!==!1};H.current&&!Xm(D.current,fe)&&(D.current=fe,To.flushSync(()=>{g(fe)}))})},[m,e,n,M,U]);fm(()=>{d===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,g(Z=>({...Z,isPositioned:!1})))},[d]);const H=w.useRef(!1);fm(()=>(H.current=!0,()=>{H.current=!1}),[]),fm(()=>{if(E&&($.current=E),P&&(_.current=P),E&&P){if(L.current)return L.current(E,P,Y);Y()}},[E,P,Y,L,B]);const ee=w.useMemo(()=>({reference:$,floating:_,setReference:Q,setFloating:R}),[Q,R]),N=w.useMemo(()=>({reference:E,floating:P}),[E,P]),V=w.useMemo(()=>{const Z={position:n,left:0,top:0};if(!N.floating)return Z;const W=MA(N.floating,h.x),fe=MA(N.floating,h.y);return l?{...Z,transform:"translate("+W+"px, "+fe+"px)",...bD(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:fe}},[n,l,N.floating,h.x,h.y]);return w.useMemo(()=>({...h,update:Y,refs:ee,elements:N,floatingStyles:V}),[h,Y,ee,N,V])}const r9=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?$A({element:r.current,padding:i}).fn(n):{}:r?$A({element:r,padding:i}).fn(n):{}}}},i9=(t,e)=>({...Y7(t),options:[t,e]}),s9=(t,e)=>({...G7(t),options:[t,e]}),o9=(t,e)=>({...K7(t),options:[t,e]}),a9=(t,e)=>({...W7(t),options:[t,e]}),l9=(t,e)=>({...F7(t),options:[t,e]}),c9=(t,e)=>({...H7(t),options:[t,e]}),u9=(t,e)=>({...r9(t),options:[t,e]});var f9="Arrow",vD=w.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return S.jsx(Wt.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});vD.displayName=f9;var d9=vD;function h9(t){const[e,n]=w.useState(void 0);return Ma(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,l;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;a=d.inlineSize,l=d.blockSize}else a=t.offsetWidth,l=t.offsetHeight;n({width:a,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var p1="Popper",[xD,iy]=Zo(p1),[p9,SD]=xD(p1),wD=t=>{const{__scopePopper:e,children:n}=t,[r,i]=w.useState(null);return S.jsx(p9,{scope:e,anchor:r,onAnchorChange:i,children:n})};wD.displayName=p1;var kD="PopperAnchor",CD=w.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=SD(kD,n),a=w.useRef(null),l=Nn(e,a),u=w.useRef(null);return w.useEffect(()=>{const d=u.current;u.current=(r==null?void 0:r.current)||a.current,d!==u.current&&s.onAnchorChange(u.current)}),r?null:S.jsx(Wt.div,{...i,ref:l})});CD.displayName=kD;var g1="PopperContent",[g9,m9]=xD(g1),TD=w.forwardRef((t,e)=>{var Te,Ye,je,ze,Ct,Fe;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:h=0,sticky:g="partial",hideWhenDetached:m=!1,updatePositionStrategy:O="optimized",onPlaced:v,...x}=t,k=SD(g1,n),[C,Q]=w.useState(null),R=Nn(e,Tt=>Q(Tt)),[E,P]=w.useState(null),$=h9(E),_=($==null?void 0:$.width)??0,D=($==null?void 0:$.height)??0,B=r+(s!=="center"?"-"+s:""),L=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(d)?d:[d],U=M.length>0,Y={padding:L,boundary:M.filter(y9),altBoundary:U},{refs:H,floatingStyles:ee,placement:N,isPositioned:V,middlewareData:Z}=n9({strategy:"fixed",placement:B,whileElementsMounted:(...Tt)=>q7(...Tt,{animationFrame:O==="always"}),elements:{reference:k.anchor},middleware:[i9({mainAxis:i+D,alignmentAxis:a}),u&&s9({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?o9():void 0,...Y}),u&&a9({...Y}),l9({...Y,apply:({elements:Tt,rects:lt,availableWidth:ut,availableHeight:Qt})=>{const{width:on,height:Ht}=lt.reference,Ge=Tt.floating.style;Ge.setProperty("--radix-popper-available-width",`${ut}px`),Ge.setProperty("--radix-popper-available-height",`${Qt}px`),Ge.setProperty("--radix-popper-anchor-width",`${on}px`),Ge.setProperty("--radix-popper-anchor-height",`${Ht}px`)}}),E&&u9({element:E,padding:l}),b9({arrowWidth:_,arrowHeight:D}),m&&c9({strategy:"referenceHidden",...Y})]}),[W,fe]=RD(N),se=Vs(v);Ma(()=>{V&&(se==null||se())},[V,se]);const ge=(Te=Z.arrow)==null?void 0:Te.x,oe=(Ye=Z.arrow)==null?void 0:Ye.y,he=((je=Z.arrow)==null?void 0:je.centerOffset)!==0,[me,Ce]=w.useState();return Ma(()=>{C&&Ce(window.getComputedStyle(C).zIndex)},[C]),S.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...ee,transform:V?ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(ze=Z.transformOrigin)==null?void 0:ze.x,(Ct=Z.transformOrigin)==null?void 0:Ct.y].join(" "),...((Fe=Z.hide)==null?void 0:Fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:S.jsx(g9,{scope:n,placedSide:W,onArrowChange:P,arrowX:ge,arrowY:oe,shouldHideArrow:he,children:S.jsx(Wt.div,{"data-side":W,"data-align":fe,...x,ref:R,style:{...x.style,animation:V?void 0:"none"}})})})});TD.displayName=g1;var QD="PopperArrow",O9={top:"bottom",right:"left",bottom:"top",left:"right"},ED=w.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=m9(QD,r),a=O9[s.placedSide];return S.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:S.jsx(d9,{...i,ref:n,style:{...i.style,display:"block"}})})});ED.displayName=QD;function y9(t){return t!==null}var b9=t=>({name:"transformOrigin",options:t,fn(e){var k,C,Q;const{placement:n,rects:r,middlewareData:i}=e,a=((k=i.arrow)==null?void 0:k.centerOffset)!==0,l=a?0:t.arrowWidth,u=a?0:t.arrowHeight,[d,h]=RD(n),g={start:"0%",center:"50%",end:"100%"}[h],m=(((C=i.arrow)==null?void 0:C.x)??0)+l/2,O=(((Q=i.arrow)==null?void 0:Q.y)??0)+u/2;let v="",x="";return d==="bottom"?(v=a?g:`${m}px`,x=`${-u}px`):d==="top"?(v=a?g:`${m}px`,x=`${r.floating.height+u}px`):d==="right"?(v=`${-u}px`,x=a?g:`${O}px`):d==="left"&&(v=`${r.floating.width+u}px`,x=a?g:`${O}px`),{data:{x:v,y:x}}}});function RD(t){const[e,n="center"]=t.split("-");return[e,n]}var AD=wD,PD=CD,_D=TD,$D=ED,v9=Symbol("radix.slottable");function x9(t){const e=({children:n})=>S.jsx(S.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=v9,e}var S9=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),w9="VisuallyHidden",MD=w.forwardRef((t,e)=>S.jsx(Wt.span,{...t,ref:e,style:{...S9,...t.style}}));MD.displayName=w9;var k9=MD,[sy]=Zo("Tooltip",[iy]),oy=iy(),DD="TooltipProvider",C9=700,lS="tooltip.open",[T9,m1]=sy(DD),ND=t=>{const{__scopeTooltip:e,delayDuration:n=C9,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,a=w.useRef(!0),l=w.useRef(!1),u=w.useRef(0);return w.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),S.jsx(T9,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(u.current),a.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(d=>{l.current=d},[]),disableHoverableContent:i,children:s})};ND.displayName=DD;var qd="Tooltip",[Q9,Rh]=sy(qd),LD=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:a,delayDuration:l}=t,u=m1(qd,t.__scopeTooltip),d=oy(e),[h,g]=w.useState(null),m=Pa(),O=w.useRef(0),v=a??u.disableHoverableContent,x=l??u.delayDuration,k=w.useRef(!1),[C,Q]=Th({prop:r,defaultProp:i??!1,onChange:_=>{_?(u.onOpen(),document.dispatchEvent(new CustomEvent(lS))):u.onClose(),s==null||s(_)},caller:qd}),R=w.useMemo(()=>C?k.current?"delayed-open":"instant-open":"closed",[C]),E=w.useCallback(()=>{window.clearTimeout(O.current),O.current=0,k.current=!1,Q(!0)},[Q]),P=w.useCallback(()=>{window.clearTimeout(O.current),O.current=0,Q(!1)},[Q]),$=w.useCallback(()=>{window.clearTimeout(O.current),O.current=window.setTimeout(()=>{k.current=!0,Q(!0),O.current=0},x)},[x,Q]);return w.useEffect(()=>()=>{O.current&&(window.clearTimeout(O.current),O.current=0)},[]),S.jsx(AD,{...d,children:S.jsx(Q9,{scope:e,contentId:m,open:C,stateAttribute:R,trigger:h,onTriggerChange:g,onTriggerEnter:w.useCallback(()=>{u.isOpenDelayedRef.current?$():E()},[u.isOpenDelayedRef,$,E]),onTriggerLeave:w.useCallback(()=>{v?P():(window.clearTimeout(O.current),O.current=0)},[P,v]),onOpen:E,onClose:P,disableHoverableContent:v,children:n})})};LD.displayName=qd;var cS="TooltipTrigger",zD=w.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=Rh(cS,n),s=m1(cS,n),a=oy(n),l=w.useRef(null),u=Nn(e,l,i.onTriggerChange),d=w.useRef(!1),h=w.useRef(!1),g=w.useCallback(()=>d.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),S.jsx(PD,{asChild:!0,...a,children:S.jsx(Wt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:u,onPointerMove:$e(t.onPointerMove,m=>{m.pointerType!=="touch"&&!h.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:$e(t.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:$e(t.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:$e(t.onFocus,()=>{d.current||i.onOpen()}),onBlur:$e(t.onBlur,i.onClose),onClick:$e(t.onClick,i.onClose)})})});zD.displayName=cS;var O1="TooltipPortal",[E9,R9]=sy(O1,{forceMount:void 0}),jD=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:i}=t,s=Rh(O1,e);return S.jsx(E9,{scope:e,forceMount:n,children:S.jsx(gs,{present:n||s.open,children:S.jsx(HO,{asChild:!0,container:i,children:r})})})};jD.displayName=O1;var yu="TooltipContent",ID=w.forwardRef((t,e)=>{const n=R9(yu,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,a=Rh(yu,t.__scopeTooltip);return S.jsx(gs,{present:r||a.open,children:a.disableHoverableContent?S.jsx(ZD,{side:i,...s,ref:e}):S.jsx(A9,{side:i,...s,ref:e})})}),A9=w.forwardRef((t,e)=>{const n=Rh(yu,t.__scopeTooltip),r=m1(yu,t.__scopeTooltip),i=w.useRef(null),s=Nn(e,i),[a,l]=w.useState(null),{trigger:u,onClose:d}=n,h=i.current,{onPointerInTransitChange:g}=r,m=w.useCallback(()=>{l(null),g(!1)},[g]),O=w.useCallback((v,x)=>{const k=v.currentTarget,C={x:v.clientX,y:v.clientY},Q=M9(C,k.getBoundingClientRect()),R=D9(C,Q),E=N9(x.getBoundingClientRect()),P=z9([...R,...E]);l(P),g(!0)},[g]);return w.useEffect(()=>()=>m(),[m]),w.useEffect(()=>{if(u&&h){const v=k=>O(k,h),x=k=>O(k,u);return u.addEventListener("pointerleave",v),h.addEventListener("pointerleave",x),()=>{u.removeEventListener("pointerleave",v),h.removeEventListener("pointerleave",x)}}},[u,h,O,m]),w.useEffect(()=>{if(a){const v=x=>{const k=x.target,C={x:x.clientX,y:x.clientY},Q=(u==null?void 0:u.contains(k))||(h==null?void 0:h.contains(k)),R=!L9(C,a);Q?m():R&&(m(),d())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[u,h,a,d,m]),S.jsx(ZD,{...t,ref:s})}),[P9,_9]=sy(qd,{isInside:!1}),$9=x9("TooltipContent"),ZD=w.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...l}=t,u=Rh(yu,n),d=oy(n),{onClose:h}=u;return w.useEffect(()=>(document.addEventListener(lS,h),()=>document.removeEventListener(lS,h)),[h]),w.useEffect(()=>{if(u.trigger){const g=m=>{const O=m.target;O!=null&&O.contains(u.trigger)&&h()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[u.trigger,h]),S.jsx(FO,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:S.jsxs(_D,{"data-state":u.stateAttribute,...d,...l,ref:e,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx($9,{children:r}),S.jsx(P9,{scope:n,isInside:!0,children:S.jsx(k9,{id:u.contentId,role:"tooltip",children:i||r})})]})})});ID.displayName=yu;var XD="TooltipArrow",BD=w.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=oy(n);return _9(XD,n).isInside?null:S.jsx($D,{...i,...r,ref:e})});BD.displayName=XD;function M9(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function D9(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function N9(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function L9(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const l=e[s],u=e[a],d=l.x,h=l.y,g=u.x,m=u.y;h>r!=m>r&&n<(g-d)*(r-h)/(m-h)+d&&(i=!i)}return i}function z9(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),j9(e)}function j9(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],a=e[e.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var I9=ND,Z9=LD,X9=zD,B9=jD,U9=ID,V9=BD;function UD({delayDuration:t=0,...e}){return S.jsx(I9,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function gl({...t}){return S.jsx(UD,{children:S.jsx(Z9,{"data-slot":"tooltip",...t})})}function ml({...t}){return S.jsx(X9,{"data-slot":"tooltip-trigger",...t})}function Ol({className:t,sideOffset:e=0,children:n,...r}){return S.jsx(B9,{children:S.jsxs(U9,{"data-slot":"tooltip-content",sideOffset:e,className:Ne("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...r,children:[n,S.jsx(V9,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const q9="sidebar_state",Y9=3600*24*7,G9="16rem",W9="18rem",F9="3rem",H9="b",VD=w.createContext(null);function y1(){const t=w.useContext(VD);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function K9({defaultOpen:t=!0,open:e,onOpenChange:n,className:r,style:i,children:s,...a}){const l=v8(),[u,d]=w.useState(!1),[h,g]=w.useState(t),m=e??h,O=w.useCallback(C=>{const Q=typeof C=="function"?C(m):C;n?n(Q):g(Q),document.cookie=`${q9}=${Q}; path=/; max-age=${Y9}`},[n,m]),v=w.useCallback(()=>l?d(C=>!C):O(C=>!C),[l,O,d]);w.useEffect(()=>{const C=Q=>{Q.key===H9&&(Q.metaKey||Q.ctrlKey)&&(Q.preventDefault(),v())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[v]);const x=m?"expanded":"collapsed",k=w.useMemo(()=>({state:x,open:m,setOpen:O,isMobile:l,openMobile:u,setOpenMobile:d,toggleSidebar:v}),[x,m,O,l,u,d,v]);return S.jsx(VD.Provider,{value:k,children:S.jsx(UD,{delayDuration:0,children:S.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":G9,"--sidebar-width-icon":F9,...i},className:Ne("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...a,children:s})})})}function J9({side:t="left",variant:e="sidebar",collapsible:n="offcanvas",className:r,children:i,...s}){const{isMobile:a,state:l,openMobile:u,setOpenMobile:d}=y1();return n==="none"?S.jsx("div",{"data-slot":"sidebar",className:Ne("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...s,children:i}):a?S.jsx(iD,{open:u,onOpenChange:d,...s,children:S.jsxs(sD,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":W9},side:t,children:[S.jsxs(oD,{className:"sr-only",children:[S.jsx(aD,{children:"Sidebar"}),S.jsx(lD,{children:"Displays the mobile sidebar."})]}),S.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):S.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[S.jsx("div",{"data-slot":"sidebar-gap",className:Ne("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),S.jsx("div",{"data-slot":"sidebar-container",className:Ne("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...s,children:S.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:i})})]})}function eG({className:t,...e}){return S.jsx("main",{"data-slot":"sidebar-inset",className:Ne("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...e})}function tG({className:t,...e}){return S.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Ne("flex flex-col gap-2 p-2",t),...e})}function nG({className:t,...e}){return S.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Ne("flex flex-col gap-2 p-2",t),...e})}function DA({className:t,...e}){return S.jsx(Q8,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:Ne("bg-sidebar-border mx-2 w-auto",t),...e})}function rG({className:t,...e}){return S.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Ne("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e})}function qD({className:t,...e}){return S.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Ne("flex w-full min-w-0 flex-col gap-1",t),...e})}function YD({className:t,...e}){return S.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Ne("group/menu-item relative",t),...e})}const iG=UO("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function GD({asChild:t=!1,isActive:e=!1,variant:n="default",size:r="default",tooltip:i,className:s,...a}){const l=t?Uw:"button",{isMobile:u,state:d}=y1(),h=S.jsx(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":e,className:Ne(iG({variant:n,size:r}),s),...a});return i?(typeof i=="string"&&(i={children:i}),S.jsxs(gl,{children:[S.jsx(ml,{asChild:!0,children:h}),S.jsx(Ol,{side:"right",align:"center",hidden:d!=="collapsed"||u,...i})]})):h}function sG(){const t=Yr();return ps({mutationFn:async e=>{const n=await rn.createFolder(e.workspaceSlug,e.displayName,e.name,e.parentId??void 0);if(n.error)throw new Error(n.error);return n.data},onSuccess:(e,n)=>{t.invalidateQueries({queryKey:dn.tree(n.workspaceSlug)})}})}function oG(){const t=Yr();return ps({mutationFn:async e=>{const n=await rn.createNote(e.workspaceSlug,e.title,e.name,e.folderId??void 0);if(n.error)throw new Error(n.error);return n.data},onSuccess:(e,n)=>{t.invalidateQueries({queryKey:dn.tree(n.workspaceSlug)})}})}function aG(){const t=Yr();return ps({mutationFn:async e=>{const n=await rn.updateFolder(e.workspaceSlug,e.folderPublicId,e.displayName,e.name);if(n.error)throw new Error(n.error);return n.data},onSuccess:(e,n)=>{t.invalidateQueries({queryKey:dn.tree(n.workspaceSlug)})}})}function lG(){const t=Yr();return ps({mutationFn:async e=>{const n=await rn.updateNote(e.workspaceSlug,e.notePublicId,e.title,e.name);if(n.error)throw new Error(n.error);return n.data},onSuccess:(e,n)=>{t.invalidateQueries({queryKey:dn.tree(n.workspaceSlug)}),t.invalidateQueries({queryKey:Zr.detail(n.workspaceSlug,n.notePublicId)})}})}function cG(){const t=Yr();return ps({mutationFn:async e=>{const n=await rn.deleteFolder(e.workspaceSlug,e.folderPublicId);if(n.error)throw new Error(n.error);return n.data},onSuccess:(e,n)=>{t.invalidateQueries({queryKey:dn.tree(n.workspaceSlug)})}})}function uG(){const t=Yr();return ps({mutationFn:async e=>{const n=await rn.deleteNote(e.workspaceSlug,e.notePublicId);if(n.error)throw new Error(n.error);return n.data},onSuccess:(e,n)=>{t.invalidateQueries({queryKey:dn.tree(n.workspaceSlug)}),t.invalidateQueries({queryKey:Zr.detail(n.workspaceSlug,n.notePublicId)})}})}function fG(){const t=Yr();return ps({mutationFn:async e=>{const n=await rn.moveFolder(e.workspaceSlug,e.folderPublicId,e.parentId);if(n.error)throw new Error(n.error);return n.data},onSuccess:(e,n)=>{t.invalidateQueries({queryKey:dn.tree(n.workspaceSlug)})}})}function dG(){const t=Yr();return ps({mutationFn:async e=>{const n=await rn.moveNote(e.workspaceSlug,e.notePublicId,e.folderId);if(n.error)throw new Error(n.error);return n.data},onSuccess:(e,n)=>{t.invalidateQueries({queryKey:dn.tree(n.workspaceSlug)})}})}function hG(){const t=Yr();return ps({mutationFn:async e=>{const n=await rn.updateNoteContent(e.workspaceSlug,e.notePublicId,e.content,e.includeBlame);if(n.error)throw new Error(n.error);if(!n.data)throw new Error("Failed to update note content");return n.data},onSuccess:(e,n)=>{t.invalidateQueries({queryKey:Zr.detail(n.workspaceSlug,n.notePublicId)})}})}const NA=t=>{let e;const n=new Set,r=(d,h)=>{const g=typeof d=="function"?d(e):d;if(!Object.is(g,e)){const m=e;e=h??(typeof g!="object"||g===null)?g:Object.assign({},e,g),n.forEach(O=>O(e,m))}},i=()=>e,l={setState:r,getState:i,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=e=t(r,i,l);return l},pG=(t=>t?NA(t):NA),gG=t=>t;function mG(t,e=gG){const n=it.useSyncExternalStore(t.subscribe,it.useCallback(()=>e(t.getState()),[t,e]),it.useCallback(()=>e(t.getInitialState()),[t,e]));return it.useDebugValue(n),n}const LA=t=>{const e=pG(t),n=r=>mG(e,r);return Object.assign(n,e),n},OG=(t=>t?LA(t):LA),WD=(t,e=[])=>(t.forEach(n=>{e.push(n.publicId),WD(n.children,e)}),e),FD=new Set,zc=OG(t=>({labelMode:"display",expandedFolderIdsByWorkspace:{},createWorkspaceModalOpen:!1,activeDialog:null,dialogDraft:{},setLabelMode:e=>t({labelMode:e}),toggleExpandedFolder:(e,n)=>{t(r=>{const i=r.expandedFolderIdsByWorkspace[e]??FD,s=new Set(i);return s.has(n)?s.delete(n):s.add(n),{expandedFolderIdsByWorkspace:{...r.expandedFolderIdsByWorkspace,[e]:s}}})},setExpandedFolders:(e,n)=>{t(r=>({expandedFolderIdsByWorkspace:{...r.expandedFolderIdsByWorkspace,[e]:new Set(n)}}))},resetExpandedFolders:(e,n)=>{if(!n){t(i=>{const{[e]:s,...a}=i.expandedFolderIdsByWorkspace;return{expandedFolderIdsByWorkspace:a}});return}const r=WD(n.folders);t(i=>({expandedFolderIdsByWorkspace:{...i.expandedFolderIdsByWorkspace,[e]:new Set(r)}}))},clearExpandedFoldersForWorkspace:e=>{t(n=>{const{[e]:r,...i}=n.expandedFolderIdsByWorkspace;return{expandedFolderIdsByWorkspace:i}})},openCreateWorkspaceModal:()=>t({createWorkspaceModalOpen:!0}),closeCreateWorkspaceModal:()=>t({createWorkspaceModalOpen:!1}),openDialog:e=>{t({activeDialog:e,dialogDraft:{}})},closeDialog:()=>{t({activeDialog:null,dialogDraft:{}})},setDialogDraft:e=>{t(n=>({dialogDraft:{...n.dialogDraft,...e}}))},clearDialogDraft:()=>{t({dialogDraft:{}})}})),yG={getExpandedFolders:t=>e=>e.expandedFolderIdsByWorkspace[t]??FD,isFolderExpanded:(t,e)=>n=>{const r=n.expandedFolderIdsByWorkspace[t];return(r==null?void 0:r.has(e))??!1},hasActiveDialog:t=>t.activeDialog!==null,getDialogMode:t=>{var e;return((e=t.activeDialog)==null?void 0:e.mode)??null}},Sa=new IX({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:1e3*60*5},mutations:{retry:1}}}),ay=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Uu(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function b1(t){return"nodeType"in t}function Rr(t){var e,n;return t?Uu(t)?t:b1(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function v1(t){const{Document:e}=Rr(t);return t instanceof e}function Ah(t){return Uu(t)?!1:t instanceof Rr(t).HTMLElement}function HD(t){return t instanceof Rr(t).SVGElement}function Vu(t){return t?Uu(t)?t.document:b1(t)?v1(t)?t:Ah(t)||HD(t)?t.ownerDocument:document:document:document}const No=ay?w.useLayoutEffect:w.useEffect;function ly(t){const e=w.useRef(t);return No(()=>{e.current=t}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}function bG(){const t=w.useRef(null),e=w.useCallback((r,i)=>{t.current=setInterval(r,i)},[]),n=w.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Yd(t,e){e===void 0&&(e=[t]);const n=w.useRef(t);return No(()=>{n.current!==t&&(n.current=t)},e),n}function Ph(t,e){const n=w.useRef();return w.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function Bm(t){const e=ly(t),n=w.useRef(null),r=w.useCallback(i=>{i!==n.current&&(e==null||e(i,n.current)),n.current=i},[]);return[n,r]}function Um(t){const e=w.useRef();return w.useEffect(()=>{e.current=t},[t]),e.current}let Bv={};function cy(t,e){return w.useMemo(()=>{if(e)return e;const n=Bv[t]==null?0:Bv[t]+1;return Bv[t]=n,t+"-"+n},[t,e])}function KD(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((s,a)=>{const l=Object.entries(a);for(const[u,d]of l){const h=s[u];h!=null&&(s[u]=h+t*d)}return s},{...e})}}const tu=KD(1),Vm=KD(-1);function vG(t){return"clientX"in t&&"clientY"in t}function x1(t){if(!t)return!1;const{KeyboardEvent:e}=Rr(t.target);return e&&t instanceof e}function xG(t){if(!t)return!1;const{TouchEvent:e}=Rr(t.target);return e&&t instanceof e}function qm(t){if(xG(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return vG(t)?{x:t.clientX,y:t.clientY}:null}const Ll=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[Ll.Translate.toString(t),Ll.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),zA="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function SG(t){return t.matches(zA)?t:t.querySelector(zA)}const wG={display:"none"};function kG(t){let{id:e,value:n}=t;return it.createElement("div",{id:e,style:wG},n)}function CG(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return it.createElement("div",{id:e,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function TG(){const[t,e]=w.useState("");return{announce:w.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const JD=w.createContext(null);function QG(t){const e=w.useContext(JD);w.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function EG(){const[t]=w.useState(()=>new Set),e=w.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[w.useCallback(r=>{let{type:i,event:s}=r;t.forEach(a=>{var l;return(l=a[i])==null?void 0:l.call(a,s)})},[t]),e]}const RG={draggable:`
226
+ To pick up a draggable item, press the space bar.
227
+ While dragging, use the arrow keys to move the item.
228
+ Press space again to drop the item in its new position, or press escape to cancel.
229
+ `},AG={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function PG(t){let{announcements:e=AG,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=RG}=t;const{announce:s,announcement:a}=TG(),l=cy("DndLiveRegion"),[u,d]=w.useState(!1);if(w.useEffect(()=>{d(!0)},[]),QG(w.useMemo(()=>({onDragStart(g){let{active:m}=g;s(e.onDragStart({active:m}))},onDragMove(g){let{active:m,over:O}=g;e.onDragMove&&s(e.onDragMove({active:m,over:O}))},onDragOver(g){let{active:m,over:O}=g;s(e.onDragOver({active:m,over:O}))},onDragEnd(g){let{active:m,over:O}=g;s(e.onDragEnd({active:m,over:O}))},onDragCancel(g){let{active:m,over:O}=g;s(e.onDragCancel({active:m,over:O}))}}),[s,e])),!u)return null;const h=it.createElement(it.Fragment,null,it.createElement(kG,{id:r,value:i.draggable}),it.createElement(CG,{id:l,announcement:a}));return n?To.createPortal(h,n):h}var Dn;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Dn||(Dn={}));function Ym(){}function _G(t,e){return w.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function $G(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return w.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const fs=Object.freeze({x:0,y:0});function MG(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function DG(t,e){const n=qm(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function NG(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function LG(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function zG(t){let{left:e,top:n,height:r,width:i}=t;return[{x:e,y:n},{x:e+i,y:n},{x:e,y:n+r},{x:e+i,y:n+r}]}function jG(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function IG(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),a=i-r,l=s-n;if(r<i&&n<s){const u=e.width*e.height,d=t.width*t.height,h=a*l,g=h/(u+d-h);return Number(g.toFixed(4))}return 0}const eN=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const u=IG(l,e);u>0&&i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(LG)};function ZG(t,e){const{top:n,left:r,bottom:i,right:s}=e;return n<=t.y&&t.y<=i&&r<=t.x&&t.x<=s}const XG=t=>{let{droppableContainers:e,droppableRects:n,pointerCoordinates:r}=t;if(!r)return[];const i=[];for(const s of e){const{id:a}=s,l=n.get(a);if(l&&ZG(r,l)){const d=zG(l).reduce((g,m)=>g+MG(r,m),0),h=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:h}})}}return i.sort(NG)};function BG(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function tN(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:fs}function UG(t){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];return i.reduce((a,l)=>({...a,top:a.top+t*l.y,bottom:a.bottom+t*l.y,left:a.left+t*l.x,right:a.right+t*l.x}),{...n})}}const VG=UG(1);function nN(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function qG(t,e,n){const r=nN(e);if(!r)return t;const{scaleX:i,scaleY:s,x:a,y:l}=r,u=t.left-a-(1-i)*parseFloat(n),d=t.top-l-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),h=i?t.width/i:t.width,g=s?t.height/s:t.height;return{width:h,height:g,top:d,right:u+h,bottom:d+g,left:u}}const YG={ignoreTransform:!1};function _h(t,e){e===void 0&&(e=YG);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:h}=Rr(t).getComputedStyle(t);d&&(n=qG(n,d,h))}const{top:r,left:i,width:s,height:a,bottom:l,right:u}=n;return{top:r,left:i,width:s,height:a,bottom:l,right:u}}function jA(t){return _h(t,{ignoreTransform:!0})}function GG(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function WG(t,e){return e===void 0&&(e=Rr(t).getComputedStyle(t)),e.position==="fixed"}function FG(t,e){e===void 0&&(e=Rr(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=e[i];return typeof s=="string"?n.test(s):!1})}function S1(t,e){const n=[];function r(i){if(e!=null&&n.length>=e||!i)return n;if(v1(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Ah(i)||HD(i)||n.includes(i))return n;const s=Rr(t).getComputedStyle(i);return i!==t&&FG(i,s)&&n.push(i),WG(i,s)?n:r(i.parentNode)}return t?r(t):n}function rN(t){const[e]=S1(t,1);return e??null}function Uv(t){return!ay||!t?null:Uu(t)?t:b1(t)?v1(t)||t===Vu(t).scrollingElement?window:Ah(t)?t:null:null}function iN(t){return Uu(t)?t.scrollX:t.scrollLeft}function sN(t){return Uu(t)?t.scrollY:t.scrollTop}function uS(t){return{x:iN(t),y:sN(t)}}var Vn;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Vn||(Vn={}));function oN(t){return!ay||!t?!1:t===document.scrollingElement}function aN(t){const e={x:0,y:0},n=oN(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},i=t.scrollTop<=e.y,s=t.scrollLeft<=e.x,a=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:i,isLeft:s,isBottom:a,isRight:l,maxScroll:r,minScroll:e}}const HG={x:.2,y:.2};function KG(t,e,n,r,i){let{top:s,left:a,right:l,bottom:u}=n;r===void 0&&(r=10),i===void 0&&(i=HG);const{isTop:d,isBottom:h,isLeft:g,isRight:m}=aN(t),O={x:0,y:0},v={x:0,y:0},x={height:e.height*i.y,width:e.width*i.x};return!d&&s<=e.top+x.height?(O.y=Vn.Backward,v.y=r*Math.abs((e.top+x.height-s)/x.height)):!h&&u>=e.bottom-x.height&&(O.y=Vn.Forward,v.y=r*Math.abs((e.bottom-x.height-u)/x.height)),!m&&l>=e.right-x.width?(O.x=Vn.Forward,v.x=r*Math.abs((e.right-x.width-l)/x.width)):!g&&a<=e.left+x.width&&(O.x=Vn.Backward,v.x=r*Math.abs((e.left+x.width-a)/x.width)),{direction:O,speed:v}}function JG(t){if(t===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:e,left:n,right:r,bottom:i}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:i,width:t.clientWidth,height:t.clientHeight}}function lN(t){return t.reduce((e,n)=>tu(e,uS(n)),fs)}function eW(t){return t.reduce((e,n)=>e+iN(n),0)}function tW(t){return t.reduce((e,n)=>e+sN(n),0)}function cN(t,e){if(e===void 0&&(e=_h),!t)return;const{top:n,left:r,bottom:i,right:s}=e(t);rN(t)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const nW=[["x",["left","right"],eW],["y",["top","bottom"],tW]];class w1{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=S1(n),i=lN(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[s,a,l]of nW)for(const u of a)Object.defineProperty(this,u,{get:()=>{const d=l(r),h=i[s]-d;return this.rect[u]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Qd{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var i;(i=this.target)==null||i.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function rW(t){const{EventTarget:e}=Rr(t);return t instanceof e?t:Vu(t)}function Vv(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var Di;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Di||(Di={}));function IA(t){t.preventDefault()}function iW(t){t.stopPropagation()}var Vt;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Vt||(Vt={}));const uN={start:[Vt.Space,Vt.Enter],cancel:[Vt.Esc],end:[Vt.Space,Vt.Enter,Vt.Tab]},sW=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case Vt.Right:return{...n,x:n.x+25};case Vt.Left:return{...n,x:n.x-25};case Vt.Down:return{...n,y:n.y+25};case Vt.Up:return{...n,y:n.y-25}}};class fN{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Qd(Vu(n)),this.windowListeners=new Qd(Rr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Di.Resize,this.handleCancel),this.windowListeners.add(Di.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Di.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&cN(r),n(fs)}handleKeyDown(e){if(x1(e)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=uN,coordinateGetter:a=sW,scrollBehavior:l="smooth"}=i,{code:u}=e;if(s.end.includes(u)){this.handleEnd(e);return}if(s.cancel.includes(u)){this.handleCancel(e);return}const{collisionRect:d}=r.current,h=d?{x:d.left,y:d.top}:fs;this.referenceCoordinates||(this.referenceCoordinates=h);const g=a(e,{active:n,context:r.current,currentCoordinates:h});if(g){const m=Vm(g,h),O={x:0,y:0},{scrollableAncestors:v}=r.current;for(const x of v){const k=e.code,{isTop:C,isRight:Q,isLeft:R,isBottom:E,maxScroll:P,minScroll:$}=aN(x),_=JG(x),D={x:Math.min(k===Vt.Right?_.right-_.width/2:_.right,Math.max(k===Vt.Right?_.left:_.left+_.width/2,g.x)),y:Math.min(k===Vt.Down?_.bottom-_.height/2:_.bottom,Math.max(k===Vt.Down?_.top:_.top+_.height/2,g.y))},B=k===Vt.Right&&!Q||k===Vt.Left&&!R,L=k===Vt.Down&&!E||k===Vt.Up&&!C;if(B&&D.x!==g.x){const M=x.scrollLeft+m.x,U=k===Vt.Right&&M<=P.x||k===Vt.Left&&M>=$.x;if(U&&!m.y){x.scrollTo({left:M,behavior:l});return}U?O.x=x.scrollLeft-M:O.x=k===Vt.Right?x.scrollLeft-P.x:x.scrollLeft-$.x,O.x&&x.scrollBy({left:-O.x,behavior:l});break}else if(L&&D.y!==g.y){const M=x.scrollTop+m.y,U=k===Vt.Down&&M<=P.y||k===Vt.Up&&M>=$.y;if(U&&!m.x){x.scrollTo({top:M,behavior:l});return}U?O.y=x.scrollTop-M:O.y=k===Vt.Down?x.scrollTop-P.y:x.scrollTop-$.y,O.y&&x.scrollBy({top:-O.y,behavior:l});break}}this.handleMove(e,tu(Vm(g,this.referenceCoordinates),O))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}fN.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=uN,onActivation:i}=e,{active:s}=n;const{code:a}=t.nativeEvent;if(r.start.includes(a)){const l=s.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),i==null||i({event:t.nativeEvent}),!0)}return!1}}];function ZA(t){return!!(t&&"distance"in t)}function XA(t){return!!(t&&"delay"in t)}class k1{constructor(e,n,r){var i;r===void 0&&(r=rW(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:s}=e,{target:a}=s;this.props=e,this.events=n,this.document=Vu(a),this.documentListeners=new Qd(this.document),this.listeners=new Qd(r),this.windowListeners=new Qd(Rr(a)),this.initialCoordinates=(i=qm(s))!=null?i:fs,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Di.Resize,this.handleCancel),this.windowListeners.add(Di.DragStart,IA),this.windowListeners.add(Di.VisibilityChange,this.handleCancel),this.windowListeners.add(Di.ContextMenu,IA),this.documentListeners.add(Di.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(XA(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(ZA(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:i}=this.props;i(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Di.Click,iW,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Di.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:i,props:s}=this,{onMove:a,options:{activationConstraint:l}}=s;if(!i)return;const u=(n=qm(e))!=null?n:fs,d=Vm(i,u);if(!r&&l){if(ZA(l)){if(l.tolerance!=null&&Vv(d,l.tolerance))return this.handleCancel();if(Vv(d,l.distance))return this.handleStart()}if(XA(l)&&Vv(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}e.cancelable&&e.preventDefault(),a(u)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Vt.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const oW={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class C1 extends k1{constructor(e){const{event:n}=e,r=Vu(n.target);super(e,oW,r)}}C1.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const aW={move:{name:"mousemove"},end:{name:"mouseup"}};var fS;(function(t){t[t.RightClick=2]="RightClick"})(fS||(fS={}));class lW extends k1{constructor(e){super(e,aW,Vu(e.event.target))}}lW.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===fS.RightClick?!1:(r==null||r({event:n}),!0)}}];const qv={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class cW extends k1{constructor(e){super(e,qv)}static setup(){return window.addEventListener(qv.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(qv.move.name,e)};function e(){}}}cW.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Ed;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Ed||(Ed={}));var Gm;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Gm||(Gm={}));function uW(t){let{acceleration:e,activator:n=Ed.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:a=5,order:l=Gm.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:h,delta:g,threshold:m}=t;const O=dW({delta:g,disabled:!s}),[v,x]=bG(),k=w.useRef({x:0,y:0}),C=w.useRef({x:0,y:0}),Q=w.useMemo(()=>{switch(n){case Ed.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Ed.DraggableRect:return i}},[n,i,u]),R=w.useRef(null),E=w.useCallback(()=>{const $=R.current;if(!$)return;const _=k.current.x*C.current.x,D=k.current.y*C.current.y;$.scrollBy(_,D)},[]),P=w.useMemo(()=>l===Gm.TreeOrder?[...d].reverse():d,[l,d]);w.useEffect(()=>{if(!s||!d.length||!Q){x();return}for(const $ of P){if((r==null?void 0:r($))===!1)continue;const _=d.indexOf($),D=h[_];if(!D)continue;const{direction:B,speed:L}=KG($,D,Q,e,m);for(const M of["x","y"])O[M][B[M]]||(L[M]=0,B[M]=0);if(L.x>0||L.y>0){x(),R.current=$,v(E,a),k.current=L,C.current=B;return}}k.current={x:0,y:0},C.current={x:0,y:0},x()},[e,E,r,x,s,a,JSON.stringify(Q),JSON.stringify(O),v,d,P,h,JSON.stringify(m)])}const fW={x:{[Vn.Backward]:!1,[Vn.Forward]:!1},y:{[Vn.Backward]:!1,[Vn.Forward]:!1}};function dW(t){let{delta:e,disabled:n}=t;const r=Um(e);return Ph(i=>{if(n||!r||!i)return fW;const s={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Vn.Backward]:i.x[Vn.Backward]||s.x===-1,[Vn.Forward]:i.x[Vn.Forward]||s.x===1},y:{[Vn.Backward]:i.y[Vn.Backward]||s.y===-1,[Vn.Forward]:i.y[Vn.Forward]||s.y===1}}},[n,e,r])}function hW(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Ph(i=>{var s;return e==null?null:(s=r??i)!=null?s:null},[r,e])}function pW(t,e){return w.useMemo(()=>t.reduce((n,r)=>{const{sensor:i}=r,s=i.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,r)}));return[...n,...s]},[]),[t,e])}var Gd;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Gd||(Gd={}));var dS;(function(t){t.Optimized="optimized"})(dS||(dS={}));const BA=new Map;function gW(t,e){let{dragging:n,dependencies:r,config:i}=e;const[s,a]=w.useState(null),{frequency:l,measure:u,strategy:d}=i,h=w.useRef(t),g=k(),m=Yd(g),O=w.useCallback(function(C){C===void 0&&(C=[]),!m.current&&a(Q=>Q===null?C:Q.concat(C.filter(R=>!Q.includes(R))))},[m]),v=w.useRef(null),x=Ph(C=>{if(g&&!n)return BA;if(!C||C===BA||h.current!==t||s!=null){const Q=new Map;for(let R of t){if(!R)continue;if(s&&s.length>0&&!s.includes(R.id)&&R.rect.current){Q.set(R.id,R.rect.current);continue}const E=R.node.current,P=E?new w1(u(E),E):null;R.rect.current=P,P&&Q.set(R.id,P)}return Q}return C},[t,s,n,g,u]);return w.useEffect(()=>{h.current=t},[t]),w.useEffect(()=>{g||O()},[n,g]),w.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),w.useEffect(()=>{g||typeof l!="number"||v.current!==null||(v.current=setTimeout(()=>{O(),v.current=null},l))},[l,g,O,...r]),{droppableRects:x,measureDroppableContainers:O,measuringScheduled:s!=null};function k(){switch(d){case Gd.Always:return!1;case Gd.BeforeDragging:return n;default:return!n}}}function T1(t,e){return Ph(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function mW(t,e){return T1(t,e)}function OW(t){let{callback:e,disabled:n}=t;const r=ly(e),i=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function uy(t){let{callback:e,disabled:n}=t;const r=ly(e),i=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function yW(t){return new w1(_h(t),t)}function UA(t,e,n){e===void 0&&(e=yW);const[r,i]=w.useState(null);function s(){i(u=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=u??n)!=null?d:null}const h=e(t);return JSON.stringify(u)===JSON.stringify(h)?u:h})}const a=OW({callback(u){if(t)for(const d of u){const{type:h,target:g}=d;if(h==="childList"&&g instanceof HTMLElement&&g.contains(t)){s();break}}}}),l=uy({callback:s});return No(()=>{s(),t?(l==null||l.observe(t),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),a==null||a.disconnect())},[t]),r}function bW(t){const e=T1(t);return tN(t,e)}const VA=[];function vW(t){const e=w.useRef(t),n=Ph(r=>t?r&&r!==VA&&t&&e.current&&t.parentNode===e.current.parentNode?r:S1(t):VA,[t]);return w.useEffect(()=>{e.current=t},[t]),n}function xW(t){const[e,n]=w.useState(null),r=w.useRef(t),i=w.useCallback(s=>{const a=Uv(s.target);a&&n(l=>l?(l.set(a,uS(a)),new Map(l)):null)},[]);return w.useEffect(()=>{const s=r.current;if(t!==s){a(s);const l=t.map(u=>{const d=Uv(u);return d?(d.addEventListener("scroll",i,{passive:!0}),[d,uS(d)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),r.current=t}return()=>{a(t),a(s)};function a(l){l.forEach(u=>{const d=Uv(u);d==null||d.removeEventListener("scroll",i)})}},[i,t]),w.useMemo(()=>t.length?e?Array.from(e.values()).reduce((s,a)=>tu(s,a),fs):lN(t):fs,[t,e])}function qA(t,e){e===void 0&&(e=[]);const n=w.useRef(null);return w.useEffect(()=>{n.current=null},e),w.useEffect(()=>{const r=t!==fs;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?Vm(t,n.current):fs}function SW(t){w.useEffect(()=>{if(!ay)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n==null||n()}},t.map(e=>{let{sensor:n}=e;return n}))}function wW(t,e){return w.useMemo(()=>t.reduce((n,r)=>{let{eventName:i,handler:s}=r;return n[i]=a=>{s(a,e)},n},{}),[t,e])}function dN(t){return w.useMemo(()=>t?GG(t):null,[t])}const YA=[];function kW(t,e){e===void 0&&(e=_h);const[n]=t,r=dN(n?Rr(n):null),[i,s]=w.useState(YA);function a(){s(()=>t.length?t.map(u=>oN(u)?r:new w1(e(u),u)):YA)}const l=uy({callback:a});return No(()=>{l==null||l.disconnect(),a(),t.forEach(u=>l==null?void 0:l.observe(u))},[t]),i}function hN(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return Ah(e)?e:t}function CW(t){let{measure:e}=t;const[n,r]=w.useState(null),i=w.useCallback(d=>{for(const{target:h}of d)if(Ah(h)){r(g=>{const m=e(h);return g?{...g,width:m.width,height:m.height}:m});break}},[e]),s=uy({callback:i}),a=w.useCallback(d=>{const h=hN(d);s==null||s.disconnect(),h&&(s==null||s.observe(h)),r(h?e(h):null)},[e,s]),[l,u]=Bm(a);return w.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const TW=[{sensor:C1,options:{}},{sensor:fN,options:{}}],QW={current:{}},dm={draggable:{measure:jA},droppable:{measure:jA,strategy:Gd.WhileDragging,frequency:dS.Optimized},dragOverlay:{measure:_h}};class Rd extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const EW={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Rd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ym},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:dm,measureDroppableContainers:Ym,windowRect:null,measuringScheduled:!1},pN={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ym,draggableNodes:new Map,over:null,measureDroppableContainers:Ym},$h=w.createContext(pN),gN=w.createContext(EW);function RW(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Rd}}}function AW(t,e){switch(e.type){case Dn.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Dn.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case Dn.DragEnd:case Dn.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Dn.RegisterDroppable:{const{element:n}=e,{id:r}=n,i=new Rd(t.droppable.containers);return i.set(r,n),{...t,droppable:{...t.droppable,containers:i}}}case Dn.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const a=new Rd(t.droppable.containers);return a.set(n,{...s,disabled:i}),{...t,droppable:{...t.droppable,containers:a}}}case Dn.UnregisterDroppable:{const{id:n,key:r}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const s=new Rd(t.droppable.containers);return s.delete(n),{...t,droppable:{...t.droppable,containers:s}}}default:return t}}function PW(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:i}=w.useContext($h),s=Um(r),a=Um(n==null?void 0:n.id);return w.useEffect(()=>{if(!e&&!r&&s&&a!=null){if(!x1(s)||document.activeElement===s.target)return;const l=i.get(a);if(!l)return;const{activatorNode:u,node:d}=l;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[u.current,d.current]){if(!h)continue;const g=SG(h);if(g){g.focus();break}}})}},[r,e,i,a,s]),null}function mN(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((i,s)=>s({transform:i,...r}),n):n}function _W(t){return w.useMemo(()=>({draggable:{...dm.draggable,...t==null?void 0:t.draggable},droppable:{...dm.droppable,...t==null?void 0:t.droppable},dragOverlay:{...dm.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function $W(t){let{activeNode:e,measure:n,initialRect:r,config:i=!0}=t;const s=w.useRef(!1),{x:a,y:l}=typeof i=="boolean"?{x:i,y:i}:i;No(()=>{if(!a&&!l||!e){s.current=!1;return}if(s.current||!r)return;const d=e==null?void 0:e.node.current;if(!d||d.isConnected===!1)return;const h=n(d),g=tN(h,r);if(a||(g.x=0),l||(g.y=0),s.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const m=rN(d);m&&m.scrollBy({top:g.y,left:g.x})}},[e,a,l,r,n])}const fy=w.createContext({...fs,scaleX:1,scaleY:1});var ba;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(ba||(ba={}));const MW=w.memo(function(e){var n,r,i,s;let{id:a,accessibility:l,autoScroll:u=!0,children:d,sensors:h=TW,collisionDetection:g=eN,measuring:m,modifiers:O,...v}=e;const x=w.useReducer(AW,void 0,RW),[k,C]=x,[Q,R]=EG(),[E,P]=w.useState(ba.Uninitialized),$=E===ba.Initialized,{draggable:{active:_,nodes:D,translate:B},droppable:{containers:L}}=k,M=_!=null?D.get(_):null,U=w.useRef({initial:null,translated:null}),Y=w.useMemo(()=>{var Bt;return _!=null?{id:_,data:(Bt=M==null?void 0:M.data)!=null?Bt:QW,rect:U}:null},[_,M]),H=w.useRef(null),[ee,N]=w.useState(null),[V,Z]=w.useState(null),W=Yd(v,Object.values(v)),fe=cy("DndDescribedBy",a),se=w.useMemo(()=>L.getEnabled(),[L]),ge=_W(m),{droppableRects:oe,measureDroppableContainers:he,measuringScheduled:me}=gW(se,{dragging:$,dependencies:[B.x,B.y],config:ge.droppable}),Ce=hW(D,_),Te=w.useMemo(()=>V?qm(V):null,[V]),Ye=mr(),je=mW(Ce,ge.draggable.measure);$W({activeNode:_!=null?D.get(_):null,config:Ye.layoutShiftCompensation,initialRect:je,measure:ge.draggable.measure});const ze=UA(Ce,ge.draggable.measure,je),Ct=UA(Ce?Ce.parentElement:null),Fe=w.useRef({activatorEvent:null,active:null,activeNode:Ce,collisionRect:null,collisions:null,droppableRects:oe,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Tt=L.getNodeFor((n=Fe.current.over)==null?void 0:n.id),lt=CW({measure:ge.dragOverlay.measure}),ut=(r=lt.nodeRef.current)!=null?r:Ce,Qt=$?(i=lt.rect)!=null?i:ze:null,on=!!(lt.nodeRef.current&&lt.rect),Ht=bW(on?null:ze),Ge=dN(ut?Rr(ut):null),It=vW($?Tt??Ce:null),jn=kW(It),He=mN(O,{transform:{x:B.x-Ht.x,y:B.y-Ht.y,scaleX:1,scaleY:1},activatorEvent:V,active:Y,activeNodeRect:ze,containerNodeRect:Ct,draggingNodeRect:Qt,over:Fe.current.over,overlayNodeRect:lt.rect,scrollableAncestors:It,scrollableAncestorRects:jn,windowRect:Ge}),Gr=Te?tu(Te,B):null,Zt=xW(It),In=qA(Zt),Be=qA(Zt,[ze]),Ue=tu(He,In),gt=Qt?VG(Qt,He):null,Fn=Y&&gt?g({active:Y,collisionRect:gt,droppableRects:oe,droppableContainers:se,pointerCoordinates:Gr}):null,gr=jG(Fn,"id"),[gn,Wr]=w.useState(null),Hn=on?He:tu(He,Be),tn=BG(Hn,(s=gn==null?void 0:gn.rect)!=null?s:null,ze),Dt=w.useRef(null),Xt=w.useCallback((Bt,ht)=>{let{sensor:Kt,options:wn}=ht;if(H.current==null)return;const et=D.get(H.current);if(!et)return;const Nt=Bt.nativeEvent,mn=new Kt({active:H.current,activeNode:et,event:Nt,options:wn,context:Fe,onAbort(ve){if(!D.get(ve))return;const{onDragAbort:re}=W.current,ue={id:ve};re==null||re(ue),Q({type:"onDragAbort",event:ue})},onPending(ve,Ve,re,ue){if(!D.get(ve))return;const{onDragPending:Ae}=W.current,vt={id:ve,constraint:Ve,initialCoordinates:re,offset:ue};Ae==null||Ae(vt),Q({type:"onDragPending",event:vt})},onStart(ve){const Ve=H.current;if(Ve==null)return;const re=D.get(Ve);if(!re)return;const{onDragStart:ue}=W.current,Oe={activatorEvent:Nt,active:{id:Ve,data:re.data,rect:U}};To.unstable_batchedUpdates(()=>{ue==null||ue(Oe),P(ba.Initializing),C({type:Dn.DragStart,initialCoordinates:ve,active:Ve}),Q({type:"onDragStart",event:Oe}),N(Dt.current),Z(Nt)})},onMove(ve){C({type:Dn.DragMove,coordinates:ve})},onEnd:ae(Dn.DragEnd),onCancel:ae(Dn.DragCancel)});Dt.current=mn;function ae(ve){return async function(){const{active:re,collisions:ue,over:Oe,scrollAdjustedTranslate:Ae}=Fe.current;let vt=null;if(re&&Ae){const{cancelDrop:cn}=W.current;vt={activatorEvent:Nt,active:re,collisions:ue,delta:Ae,over:Oe},ve===Dn.DragEnd&&typeof cn=="function"&&await Promise.resolve(cn(vt))&&(ve=Dn.DragCancel)}H.current=null,To.unstable_batchedUpdates(()=>{C({type:ve}),P(ba.Uninitialized),Wr(null),N(null),Z(null),Dt.current=null;const cn=ve===Dn.DragEnd?"onDragEnd":"onDragCancel";if(vt){const xt=W.current[cn];xt==null||xt(vt),Q({type:cn,event:vt})}})}}},[D]),bi=w.useCallback((Bt,ht)=>(Kt,wn)=>{const et=Kt.nativeEvent,Nt=D.get(wn);if(H.current!==null||!Nt||et.dndKit||et.defaultPrevented)return;const mn={active:Nt};Bt(Kt,ht.options,mn)===!0&&(et.dndKit={capturedBy:ht.sensor},H.current=wn,Xt(Kt,ht))},[D,Xt]),_r=pW(h,bi);SW(h),No(()=>{ze&&E===ba.Initializing&&P(ba.Initialized)},[ze,E]),w.useEffect(()=>{const{onDragMove:Bt}=W.current,{active:ht,activatorEvent:Kt,collisions:wn,over:et}=Fe.current;if(!ht||!Kt)return;const Nt={active:ht,activatorEvent:Kt,collisions:wn,delta:{x:Ue.x,y:Ue.y},over:et};To.unstable_batchedUpdates(()=>{Bt==null||Bt(Nt),Q({type:"onDragMove",event:Nt})})},[Ue.x,Ue.y]),w.useEffect(()=>{const{active:Bt,activatorEvent:ht,collisions:Kt,droppableContainers:wn,scrollAdjustedTranslate:et}=Fe.current;if(!Bt||H.current==null||!ht||!et)return;const{onDragOver:Nt}=W.current,mn=wn.get(gr),ae=mn&&mn.rect.current?{id:mn.id,rect:mn.rect.current,data:mn.data,disabled:mn.disabled}:null,ve={active:Bt,activatorEvent:ht,collisions:Kt,delta:{x:et.x,y:et.y},over:ae};To.unstable_batchedUpdates(()=>{Wr(ae),Nt==null||Nt(ve),Q({type:"onDragOver",event:ve})})},[gr]),No(()=>{Fe.current={activatorEvent:V,active:Y,activeNode:Ce,collisionRect:gt,collisions:Fn,droppableRects:oe,draggableNodes:D,draggingNode:ut,draggingNodeRect:Qt,droppableContainers:L,over:gn,scrollableAncestors:It,scrollAdjustedTranslate:Ue},U.current={initial:Qt,translated:gt}},[Y,Ce,Fn,gt,D,ut,Qt,oe,L,gn,It,Ue]),uW({...Ye,delta:B,draggingRect:gt,pointerCoordinates:Gr,scrollableAncestors:It,scrollableAncestorRects:jn});const eo=w.useMemo(()=>({active:Y,activeNode:Ce,activeNodeRect:ze,activatorEvent:V,collisions:Fn,containerNodeRect:Ct,dragOverlay:lt,draggableNodes:D,droppableContainers:L,droppableRects:oe,over:gn,measureDroppableContainers:he,scrollableAncestors:It,scrollableAncestorRects:jn,measuringConfiguration:ge,measuringScheduled:me,windowRect:Ge}),[Y,Ce,ze,V,Fn,Ct,lt,D,L,oe,gn,he,It,jn,ge,me,Ge]),ar=w.useMemo(()=>({activatorEvent:V,activators:_r,active:Y,activeNodeRect:ze,ariaDescribedById:{draggable:fe},dispatch:C,draggableNodes:D,over:gn,measureDroppableContainers:he}),[V,_r,Y,ze,C,fe,D,gn,he]);return it.createElement(JD.Provider,{value:R},it.createElement($h.Provider,{value:ar},it.createElement(gN.Provider,{value:eo},it.createElement(fy.Provider,{value:tn},d)),it.createElement(PW,{disabled:(l==null?void 0:l.restoreFocus)===!1})),it.createElement(PG,{...l,hiddenTextDescribedById:fe}));function mr(){const Bt=(ee==null?void 0:ee.autoScrollEnabled)===!1,ht=typeof u=="object"?u.enabled===!1:u===!1,Kt=$&&!Bt&&!ht;return typeof u=="object"?{...u,enabled:Kt}:{enabled:Kt}}}),DW=w.createContext(null),GA="button",NW="Draggable";function ON(t){let{id:e,data:n,disabled:r=!1,attributes:i}=t;const s=cy(NW),{activators:a,activatorEvent:l,active:u,activeNodeRect:d,ariaDescribedById:h,draggableNodes:g,over:m}=w.useContext($h),{role:O=GA,roleDescription:v="draggable",tabIndex:x=0}=i??{},k=(u==null?void 0:u.id)===e,C=w.useContext(k?fy:DW),[Q,R]=Bm(),[E,P]=Bm(),$=wW(a,e),_=Yd(n);No(()=>(g.set(e,{id:e,key:s,node:Q,activatorNode:E,data:_}),()=>{const B=g.get(e);B&&B.key===s&&g.delete(e)}),[g,e]);const D=w.useMemo(()=>({role:O,tabIndex:x,"aria-disabled":r,"aria-pressed":k&&O===GA?!0:void 0,"aria-roledescription":v,"aria-describedby":h.draggable}),[r,O,x,k,v,h.draggable]);return{active:u,activatorEvent:l,activeNodeRect:d,attributes:D,isDragging:k,listeners:r?void 0:$,node:Q,over:m,setNodeRef:R,setActivatorNodeRef:P,transform:C}}function LW(){return w.useContext(gN)}const zW="Droppable",jW={timeout:25};function yN(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:i}=t;const s=cy(zW),{active:a,dispatch:l,over:u,measureDroppableContainers:d}=w.useContext($h),h=w.useRef({disabled:n}),g=w.useRef(!1),m=w.useRef(null),O=w.useRef(null),{disabled:v,updateMeasurementsFor:x,timeout:k}={...jW,...i},C=Yd(x??r),Q=w.useCallback(()=>{if(!g.current){g.current=!0;return}O.current!=null&&clearTimeout(O.current),O.current=setTimeout(()=>{d(Array.isArray(C.current)?C.current:[C.current]),O.current=null},k)},[k]),R=uy({callback:Q,disabled:v||!a}),E=w.useCallback((D,B)=>{R&&(B&&(R.unobserve(B),g.current=!1),D&&R.observe(D))},[R]),[P,$]=Bm(E),_=Yd(e);return w.useEffect(()=>{!R||!P.current||(R.disconnect(),g.current=!1,R.observe(P.current))},[P,R]),w.useEffect(()=>(l({type:Dn.RegisterDroppable,element:{id:r,key:s,disabled:n,node:P,rect:m,data:_}}),()=>l({type:Dn.UnregisterDroppable,key:s,id:r})),[r]),w.useEffect(()=>{n!==h.current.disabled&&(l({type:Dn.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)},[r,s,n,l]),{active:a,rect:m,isOver:(u==null?void 0:u.id)===r,node:P,over:u,setNodeRef:$}}function IW(t){let{animation:e,children:n}=t;const[r,i]=w.useState(null),[s,a]=w.useState(null),l=Um(n);return!n&&!r&&l&&i(l),No(()=>{if(!s)return;const u=r==null?void 0:r.key,d=r==null?void 0:r.props.id;if(u==null||d==null){i(null);return}Promise.resolve(e(d,s)).then(()=>{i(null)})},[e,r,s]),it.createElement(it.Fragment,null,n,r?w.cloneElement(r,{ref:a}):null)}const ZW={x:0,y:0,scaleX:1,scaleY:1};function XW(t){let{children:e}=t;return it.createElement($h.Provider,{value:pN},it.createElement(fy.Provider,{value:ZW},e))}const BW={position:"fixed",touchAction:"none"},UW=t=>x1(t)?"transform 250ms ease":void 0,VW=w.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:i,children:s,className:a,rect:l,style:u,transform:d,transition:h=UW}=t;if(!l)return null;const g=i?d:{...d,scaleX:1,scaleY:1},m={...BW,width:l.width,height:l.height,top:l.top,left:l.left,transform:Ll.Transform.toString(g),transformOrigin:i&&r?DG(r,l):void 0,transition:typeof h=="function"?h(r):h,...u};return it.createElement(n,{className:a,style:m,ref:e},s)}),qW=t=>e=>{let{active:n,dragOverlay:r}=e;const i={},{styles:s,className:a}=t;if(s!=null&&s.active)for(const[l,u]of Object.entries(s.active))u!==void 0&&(i[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,u));if(s!=null&&s.dragOverlay)for(const[l,u]of Object.entries(s.dragOverlay))u!==void 0&&r.node.style.setProperty(l,u);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[u,d]of Object.entries(i))n.node.style.setProperty(u,d);a!=null&&a.active&&n.node.classList.remove(a.active)}},YW=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Ll.Transform.toString(e)},{transform:Ll.Transform.toString(n)}]},GW={duration:250,easing:"ease",keyframes:YW,sideEffects:qW({styles:{active:{opacity:"0"}}})};function WW(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=t;return ly((s,a)=>{if(e===null)return;const l=n.get(s);if(!l)return;const u=l.node.current;if(!u)return;const d=hN(a);if(!d)return;const{transform:h}=Rr(a).getComputedStyle(a),g=nN(h);if(!g)return;const m=typeof e=="function"?e:FW(e);return cN(u,i.draggable.measure),m({active:{id:s,data:l.data,node:u,rect:i.draggable.measure(u)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:i,transform:g})})}function FW(t){const{duration:e,easing:n,sideEffects:r,keyframes:i}={...GW,...t};return s=>{let{active:a,dragOverlay:l,transform:u,...d}=s;if(!e)return;const h={x:l.rect.left-a.rect.left,y:l.rect.top-a.rect.top},g={scaleX:u.scaleX!==1?a.rect.width*u.scaleX/l.rect.width:1,scaleY:u.scaleY!==1?a.rect.height*u.scaleY/l.rect.height:1},m={x:u.x-h.x,y:u.y-h.y,...g},O=i({...d,active:a,dragOverlay:l,transform:{initial:u,final:m}}),[v]=O,x=O[O.length-1];if(JSON.stringify(v)===JSON.stringify(x))return;const k=r==null?void 0:r({active:a,dragOverlay:l,...d}),C=l.node.animate(O,{duration:e,easing:n,fill:"forwards"});return new Promise(Q=>{C.onfinish=()=>{k==null||k(),Q()}})}}let WA=0;function HW(t){return w.useMemo(()=>{if(t!=null)return WA++,WA},[t])}const KW=it.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:i,transition:s,modifiers:a,wrapperElement:l="div",className:u,zIndex:d=999}=t;const{activatorEvent:h,active:g,activeNodeRect:m,containerNodeRect:O,draggableNodes:v,droppableContainers:x,dragOverlay:k,over:C,measuringConfiguration:Q,scrollableAncestors:R,scrollableAncestorRects:E,windowRect:P}=LW(),$=w.useContext(fy),_=HW(g==null?void 0:g.id),D=mN(a,{activatorEvent:h,active:g,activeNodeRect:m,containerNodeRect:O,draggingNodeRect:k.rect,over:C,overlayNodeRect:k.rect,scrollableAncestors:R,scrollableAncestorRects:E,transform:$,windowRect:P}),B=T1(m),L=WW({config:r,draggableNodes:v,droppableContainers:x,measuringConfiguration:Q}),M=B?k.setRef:void 0;return it.createElement(XW,null,it.createElement(IW,{animation:L},g&&_?it.createElement(VW,{key:_,id:g.id,ref:M,as:l,activatorEvent:h,adjustScale:e,className:u,transition:s,rect:B,style:{zIndex:d,...i},transform:D},n):null))}),bN="root-folder",hS=(t,e)=>`${t}:${e}`,Yv=t=>{const e=String(t),[n,r]=e.split(":");return n!=="folder"&&n!=="note"||!r?null:{type:n,publicId:r}},JW=()=>{const[t,e]=w.useState(!1);return w.useEffect(()=>{requestAnimationFrame(()=>e(!0))},[]),t},vN=(t,e,n)=>[...t.map(i=>({type:"folder",node:i,label:n==="name"?i.name:i.displayName})),...e.map(i=>({type:"note",note:i,label:n==="name"?`${i.name}.md`:i.title}))].sort((i,s)=>i.type!==s.type?i.type==="folder"?-1:1:i.label.localeCompare(s.label,void 0,{sensitivity:"base"})),eF=t=>w.useMemo(()=>{const e=new Map,n=new Map,r=new Map,i=new Map,s=a=>{a.forEach(l=>{l.id!==void 0&&(e.set(l.id,l.displayName),n.set(l.id,l.name)),l.notes.forEach(u=>{u.id!==void 0&&(r.set(u.id,u.title),i.set(u.id,u.name))}),s(l.children)})};return s(t.folders),t.rootNotes.forEach(a=>{a.id!==void 0&&(r.set(a.id,a.title),i.set(a.id,a.name))}),{folderDisplayNames:e,folderNames:n,noteTitles:r,noteNames:i}},[t]),Oa=(t,e)=>{for(const n of e){if(n.publicId===t)return n;const r=Oa(t,n.children);if(r)return r}return null},jc=t=>{const e=[],n=r=>{r.forEach(i=>{e.push(...i.notes),n(i.children)})};return n(t),e};function tF(t){const{workspaceSlug:e,workspaceName:n,workspaces:r,initialTree:i}=t,s=or(),a=D4(),l=zc(re=>re.labelMode),u=zc(re=>yG.getExpandedFolders(e??"")(re)),d=zc(re=>re.createWorkspaceModalOpen),h=zc(re=>re.activeDialog),g=zc(re=>re.dialogDraft),{setLabelMode:m,toggleExpandedFolder:O,closeCreateWorkspaceModal:v,openCreateWorkspaceModal:x,openDialog:k,closeDialog:C,setDialogDraft:Q,clearDialogDraft:R,resetExpandedFolders:E}=zc(),P=n2(),$=sG(),_=oG(),D=aG(),B=lG(),L=cG(),M=uG(),U=fG(),Y=dG(),H=w.useMemo(()=>{const re=a.pathname.split("/"),ue=re.indexOf("notes");if(ue!==-1&&re.length>ue+1){const Oe=re[ue+1];if(re[ue+2]==="history"||re.length===ue+2)return Oe}return null},[a.pathname]),ee=JW(),N=ee,V=e!=null,Z=w.useMemo(()=>({workspaceId:void 0,workspaceName:n,rootNotes:[],folders:[],workspaceSlug:e||""}),[n,e]),[W,fe]=w.useState(i??Z),[se,ge]=w.useState(null),[oe,he]=w.useState(!1),[me,Ce]=w.useState(null),[Te,Ye]=w.useState(r),[je,ze]=w.useState(""),[Ct,Fe]=w.useState(null),[Tt,lt]=w.useState(null),ut=eF(W);w.useEffect(()=>{if(!ee)return;const ue=new URL(window.location.href).searchParams.get("labels");if(ue==="display"||ue==="name"){m(ue);return}m("display")},[ee,m]),w.useEffect(()=>{Ye(r)},[r]),w.useEffect(()=>{fe(i??Z),e&&u.size===0&&E(e,i??Z)},[Z,i,e,u.size,E]),w.useEffect(()=>{e&&(h||Object.keys(g).length>0||d)&&(C(),R(),v())},[e,C,R,d,v]);const Qt=$G(_G(C1,{activationConstraint:{distance:4}})),on=w.useCallback(re=>{const ue=XG(re);return ue.length>0?ue:eN(re)},[]),Ht=w.useCallback(re=>{e&&O(e,re)},[e,O]),Ge=w.useCallback(async()=>{if(!(!V||e==null)){he(!0);try{await Sa.invalidateQueries({queryKey:dn.tree(e)})}finally{he(!1)}}},[V,e]),It=w.useCallback(async(re,ue)=>{if(!(!V||e==null)){he(!0);try{await U.mutateAsync({workspaceSlug:e,folderPublicId:re,parentId:ue})}finally{he(!1)}}},[V,U,e]),jn=w.useCallback(async(re,ue)=>{if(!(!V||e==null)){he(!0);try{await Y.mutateAsync({workspaceSlug:e,notePublicId:re,folderId:ue})}finally{he(!1)}}},[V,Y,e]),He=w.useCallback(re=>{k(re);let ue={};re.mode==="rename-folder"?(ue.displayName=re.initialDisplayName,ue.name=re.initialName):re.mode==="rename-note"?(ue.displayName=re.initialTitle,ue.name=re.initialName):(ue.displayName="",ue.name=""),ue.error=null,Q(ue)},[k,Q]),Gr=w.useCallback(()=>{v(),ze(""),Fe(null)},[v]),Zt=w.useCallback(()=>{x()},[x]),In=w.useCallback(()=>{C(),R()},[C,R]),Be=w.useCallback(()=>{He({mode:"create-folder",targetFolderPublicId:null})},[He]),Ue=w.useCallback(()=>{He({mode:"create-note",targetFolderPublicId:null})},[He]),gt=w.useCallback(()=>{lt({folderPublicId:null})},[]),Fn=w.useCallback(re=>{He({mode:"create-folder",targetFolderPublicId:re})},[He]),gr=w.useCallback(re=>{He({mode:"create-note",targetFolderPublicId:re})},[He]),gn=w.useCallback(re=>{const ue=Oa(re,W.folders);ue&&He({mode:"rename-folder",targetId:ue.id??null,targetPublicId:re,initialDisplayName:ue.displayName,initialName:ue.name})},[He,W,Oa]),Wr=w.useCallback(re=>{const ue=Oa(re,W.folders);ue&&He({mode:"delete-folder",targetPublicId:re,displayName:ue.displayName})},[He,W,Oa]),Hn=w.useCallback(re=>{lt({folderPublicId:re})},[]),tn=w.useCallback(re=>{const Oe=[...jc(W.folders),...W.rootNotes].find(Ae=>Ae.publicId===re);Oe&&He({mode:"rename-note",targetId:Oe.id??null,targetPublicId:re,initialTitle:Oe.title,initialName:Oe.name})},[He,W,jc]),Dt=w.useCallback(re=>{const Oe=[...jc(W.folders),...W.rootNotes].find(Ae=>Ae.publicId===re);Oe&&He({mode:"delete-note",targetPublicId:re,title:Oe.title})},[He,W,jc]),Xt=w.useCallback(re=>{Ce(Yv(re.active.id))},[]),bi=w.useCallback(re=>{var vt,cn,xt;if(!V){Ce(null);return}const ue=Yv(re.active.id),Oe=(vt=re.over)!=null&&vt.id?String(re.over.id):null;if(Ce(null),!ue||!Oe)return;const Ae=Oe===bN?null:((cn=Yv(Oe))==null?void 0:cn.publicId)??null;if(ue.type==="note"){const mt=[...jc(W.folders),...W.rootNotes].find(vi=>vi.publicId===ue.publicId);if(((mt==null?void 0:mt.folderPublicId)??null)===Ae)return;jn(ue.publicId,Ae);return}if(ue.type==="folder"){const ft=Oa(ue.publicId,W.folders),mt=(ft==null?void 0:ft.parentPublicId)??null,Zn=Ae?((xt=Oa(Ae,W.folders))==null?void 0:xt.publicId)??null:null;if(mt===Zn)return;It(ue.publicId,Ae);return}},[V,It,jn,W,Oa,jc]),_r=w.useCallback(re=>re.mode==="create-folder"?{title:"New folder",displayNameLabel:"Display name",displayNamePlaceholder:"Untitled folder",nameLabel:"Folder name",namePlaceholder:"folder-name",submitLabel:"Create folder"}:re.mode==="create-note"?{title:"New note",displayNameLabel:"Note title",displayNamePlaceholder:"Untitled note",nameLabel:"Note name",namePlaceholder:"note-name",submitLabel:"Create note"}:re.mode==="rename-folder"?{title:"Rename folder",displayNameLabel:"Display name",displayNamePlaceholder:"Folder display name",nameLabel:"Folder name",namePlaceholder:"folder-name",submitLabel:"Save changes"}:re.mode==="delete-note"?{title:"Delete note",displayNameLabel:"",displayNamePlaceholder:"",nameLabel:"",namePlaceholder:"",submitLabel:"Delete"}:re.mode==="delete-folder"?{title:"Delete folder",displayNameLabel:"",displayNamePlaceholder:"",nameLabel:"",namePlaceholder:"",submitLabel:"Delete"}:{title:"Rename note",displayNameLabel:"Note title",displayNamePlaceholder:"Note title",nameLabel:"Note name",namePlaceholder:"note-name",submitLabel:"Save changes"},[]),eo=w.useCallback(async re=>{if(re.preventDefault(),!h||h.mode==="create-folder"&&$.isPending||h.mode==="create-note"&&_.isPending||h.mode==="rename-folder"&&D.isPending||h.mode==="rename-note"&&B.isPending||h.mode==="delete-note"&&M.isPending||h.mode==="delete-folder"&&L.isPending)return;const Oe=(g.displayName??"").trim(),Ae=(g.name??"").trim(),vt=h.mode==="create-folder"||h.mode==="rename-folder",cn=h.mode==="create-note"||h.mode==="rename-note",xt=h.mode==="delete-note"||h.mode==="delete-folder";if(!Oe&&!xt){Q({error:vt?"Please enter a display name.":"Please enter a title."});return}if(vt&&!Ae){Q({error:"Please enter a folder name."});return}if(cn&&!Ae){Q({error:"Please enter a note name."});return}Q({error:null});try{h.mode==="create-folder"&&await $.mutateAsync({workspaceSlug:e,displayName:Oe,name:Ae,parentId:h.targetFolderPublicId||void 0}),h.mode==="create-note"&&await _.mutateAsync({workspaceSlug:e,title:Oe,name:Ae,folderId:h.targetFolderPublicId||void 0}),h.mode==="rename-folder"&&await D.mutateAsync({workspaceSlug:e,folderPublicId:h.targetPublicId,displayName:Oe,name:Ae}),h.mode==="rename-note"&&await B.mutateAsync({workspaceSlug:e,notePublicId:h.targetPublicId,title:Oe,name:Ae}),h.mode==="delete-note"&&(await M.mutateAsync({workspaceSlug:e,notePublicId:h.targetPublicId}),H===h.targetPublicId&&s({to:"/workspaces/$workspaceSlug",params:{workspaceSlug:e},search:ft=>({labels:typeof ft.labels=="string"?ft.labels:void 0})})),h.mode==="delete-folder"&&(await L.mutateAsync({workspaceSlug:e,folderPublicId:h.targetPublicId}),se===h.targetPublicId&&ge(null)),In()}catch(ft){Q({error:ft instanceof Error?ft.message:"Something went wrong. Please try again."})}},[In,h,g,e,H,se,s,$,_,D,B,M,L,Q]),ar=w.useCallback(async re=>{re.preventDefault();const ue=je.trim();if(!ue){Fe("Workspace name is required.");return}Fe(null);try{const Oe=await P.mutateAsync(ue);if(Oe)Ye(Ae=>[Oe,...Ae]),ze(""),v(),s({to:"/workspaces/$workspaceSlug",params:{workspaceSlug:Oe.slug},search:{labels:void 0}});else throw new Error("Failed to create workspace")}catch(Oe){Fe(Oe instanceof Error?Oe.message:"Unable to create workspace")}},[P,je,s,v]),mr=w.useCallback(async()=>{await rn.signOut(),Sa.invalidateQueries({queryKey:VO.session}),Sa.invalidateQueries({queryKey:dn.all}),Sa.clear(),window.location.href="/"},[Sa]),Bt=w.useCallback(()=>{const re=l==="display"?"name":"display";s({to:a.pathname,search:ue=>({...ue,labels:re})}),m(re)},[l,a.pathname,s,m]),ht=w.useCallback(re=>{s({to:"/workspaces/$workspaceSlug",params:{workspaceSlug:re},search:{labels:void 0}})},[s]),Kt=w.useMemo(()=>{if(!me)return null;if(me.type==="folder"){const Oe=W.folders.find(vt=>vt.publicId===me.publicId),Ae=Oe==null?void 0:Oe.id;return l==="name"?Ae!==void 0?ut.folderNames.get(Ae)??null:null:Ae!==void 0?ut.folderDisplayNames.get(Ae)??null:null}const re=[...W.folders.flatMap(Oe=>Oe.notes),...W.rootNotes].find(Oe=>Oe.publicId===me.publicId),ue=re==null?void 0:re.id;return l==="name"?(()=>{const Oe=ue!==void 0?ut.noteNames.get(ue):void 0;return Oe?`${Oe}.md`:null})():ue!==void 0?ut.noteTitles.get(ue)??null:null},[me,W,l,ut]),wn=h?_r(h):null,et=w.useMemo(()=>e!=null?Te.find(re=>re.slug===e)??{id:0,slug:e,name:n}:{id:0,slug:"",name:n},[e,Te,n]),Nt=P.isPending,mn=w.useMemo(()=>h?h.mode==="create-folder"&&$.isPending||h.mode==="create-note"&&_.isPending||h.mode==="rename-folder"&&D.isPending||h.mode==="rename-note"&&B.isPending||h.mode==="delete-note"&&M.isPending||h.mode==="delete-folder"&&L.isPending:!1,[h,$.isPending,_.isPending,D.isPending,B.isPending,M.isPending,L.isPending]),ae=w.useCallback(re=>{ze(re)},[]),ve=w.useCallback(re=>{lt(re)},[]),Ve=w.useCallback(re=>{Q(re)},[Q]);return{tree:W,expandedIds:u,activeDialog:h,dialogDraft:g,activeDrag:me,uploadTarget:Tt,refreshing:oe,selectedNotePublicId:H,selectedFolderPublicId:se,workspaceList:Te,newWorkspaceName:je,createWorkspaceError:Ct,createWorkspaceModalOpen:d,dragEnabled:N,isMounted:ee,hasWorkspace:V,labelMode:l,activeWorkspace:et,sensors:Qt,collisionDetection:on,dialogCopy:wn,dragLabel:Kt,dragLabels:ut,isCreateWorkspaceSubmitting:Nt,isDialogSubmitting:mn,toggleFolder:Ht,refreshTree:Ge,handleDialogSubmit:eo,handleDragStart:Xt,handleDragEnd:bi,handleOpenDialog:He,handleCloseDialog:In,handleRootCreateFolder:Be,handleRootCreateNote:Ue,handleRootUpload:gt,handleFolderCreateFolder:Fn,handleFolderCreateNote:gr,handleFolderRename:gn,handleFolderDelete:Wr,handleFolderUpload:Hn,handleNoteRename:tn,handleNoteDelete:Dt,handleCloseCreateWorkspaceModal:Gr,handleOpenCreateWorkspaceModal:Zt,handleCreateWorkspace:ar,handleSignOut:mr,handleLabelModeToggle:Bt,handleWorkspaceSwitch:ht,setNewWorkspaceName:ae,setUploadTarget:ve,setDialogDraft:Ve,getDialogCopy:_r}}function nF({item:t,label:e}){return t?S.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2 text-sm shadow-xl",children:[t.type==="folder"?S.jsx(Kc,{className:"h-4 w-4 text-muted-foreground"}):S.jsx(Ww,{className:"h-4 w-4 text-muted-foreground"}),S.jsx("span",{className:"max-w-[220px] truncate",children:e??(t.type==="folder"?"Moving folder":"Moving note")})]}):null}function rF(t){const{children:e,sensors:n,collisionDetection:r,onDragStart:i,onDragEnd:s,activeDrag:a,dragLabel:l}=t;return S.jsxs(MW,{sensors:n,onDragStart:i,onDragEnd:s,collisionDetection:r,children:[e,S.jsx(KW,{dropAnimation:{duration:150,easing:"ease-out"},children:S.jsx(nF,{item:a,label:l})})]})}function iF(t){const e=sF(t),n=w.forwardRef((r,i)=>{const{children:s,...a}=r,l=w.Children.toArray(s),u=l.find(aF);if(u){const d=u.props.children,h=l.map(g=>g===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:g);return S.jsx(e,{...a,ref:i,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return S.jsx(e,{...a,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function sF(t){const e=w.forwardRef((n,r)=>{const{children:i,...s}=n;if(w.isValidElement(i)){const a=cF(i),l=lF(s,i.props);return i.type!==w.Fragment&&(l.ref=r?Va(r,a):a),w.cloneElement(i,l)}return w.Children.count(i)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var oF=Symbol("radix.slottable");function aF(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===oF}function lF(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...l)=>{const u=s(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function cF(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var pS=["Enter"," "],uF=["ArrowDown","PageUp","Home"],xN=["ArrowUp","PageDown","End"],fF=[...uF,...xN],dF={ltr:[...pS,"ArrowRight"],rtl:[...pS,"ArrowLeft"]},hF={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Mh="Menu",[Wd,pF,gF]=$M(Mh),[Yl,dy]=Zo(Mh,[gF,iy,qO]),hy=iy(),SN=qO(),[mF,Gl]=Yl(Mh),[OF,Dh]=Yl(Mh),wN=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:a=!0}=t,l=hy(e),[u,d]=w.useState(null),h=w.useRef(!1),g=Vs(s),m=qw(i);return w.useEffect(()=>{const O=()=>{h.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>h.current=!1;return document.addEventListener("keydown",O,{capture:!0}),()=>{document.removeEventListener("keydown",O,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),S.jsx(AD,{...l,children:S.jsx(mF,{scope:e,open:n,onOpenChange:g,content:u,onContentChange:d,children:S.jsx(OF,{scope:e,onClose:w.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:h,dir:m,modal:a,children:r})})})};wN.displayName=Mh;var yF="MenuAnchor",Q1=w.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=hy(n);return S.jsx(PD,{...i,...r,ref:e})});Q1.displayName=yF;var E1="MenuPortal",[bF,kN]=Yl(E1,{forceMount:void 0}),CN=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=Gl(E1,e);return S.jsx(bF,{scope:e,forceMount:n,children:S.jsx(gs,{present:n||s.open,children:S.jsx(HO,{asChild:!0,container:i,children:r})})})};CN.displayName=E1;var Xi="MenuContent",[vF,R1]=Yl(Xi),TN=w.forwardRef((t,e)=>{const n=kN(Xi,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Gl(Xi,t.__scopeMenu),a=Dh(Xi,t.__scopeMenu);return S.jsx(Wd.Provider,{scope:t.__scopeMenu,children:S.jsx(gs,{present:r||s.open,children:S.jsx(Wd.Slot,{scope:t.__scopeMenu,children:a.modal?S.jsx(xF,{...i,ref:e}):S.jsx(SF,{...i,ref:e})})})})}),xF=w.forwardRef((t,e)=>{const n=Gl(Xi,t.__scopeMenu),r=w.useRef(null),i=Nn(e,r);return w.useEffect(()=>{const s=r.current;if(s)return X2(s)},[]),S.jsx(A1,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:$e(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),SF=w.forwardRef((t,e)=>{const n=Gl(Xi,t.__scopeMenu);return S.jsx(A1,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),wF=iF("MenuContent.ScrollLock"),A1=w.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:g,onInteractOutside:m,onDismiss:O,disableOutsideScroll:v,...x}=t,k=Gl(Xi,n),C=Dh(Xi,n),Q=hy(n),R=SN(n),E=pF(n),[P,$]=w.useState(null),_=w.useRef(null),D=Nn(e,_,k.onContentChange),B=w.useRef(0),L=w.useRef(""),M=w.useRef(0),U=w.useRef(null),Y=w.useRef("right"),H=w.useRef(0),ee=v?i1:w.Fragment,N=v?{as:wF,allowPinchZoom:!0}:void 0,V=W=>{var Te,Ye;const fe=L.current+W,se=E().filter(je=>!je.disabled),ge=document.activeElement,oe=(Te=se.find(je=>je.ref.current===ge))==null?void 0:Te.textValue,he=se.map(je=>je.textValue),me=DF(he,fe,oe),Ce=(Ye=se.find(je=>je.textValue===me))==null?void 0:Ye.ref.current;(function je(ze){L.current=ze,window.clearTimeout(B.current),ze!==""&&(B.current=window.setTimeout(()=>je(""),1e3))})(fe),Ce&&setTimeout(()=>Ce.focus())};w.useEffect(()=>()=>window.clearTimeout(B.current),[]),$2();const Z=w.useCallback(W=>{var se,ge;return Y.current===((se=U.current)==null?void 0:se.side)&&LF(W,(ge=U.current)==null?void 0:ge.area)},[]);return S.jsx(vF,{scope:n,searchRef:L,onItemEnter:w.useCallback(W=>{Z(W)&&W.preventDefault()},[Z]),onItemLeave:w.useCallback(W=>{var fe;Z(W)||((fe=_.current)==null||fe.focus(),$(null))},[Z]),onTriggerLeave:w.useCallback(W=>{Z(W)&&W.preventDefault()},[Z]),pointerGraceTimerRef:M,onPointerGraceIntentChange:w.useCallback(W=>{U.current=W},[]),children:S.jsx(ee,{...N,children:S.jsx(r1,{asChild:!0,trapped:i,onMountAutoFocus:$e(s,W=>{var fe;W.preventDefault(),(fe=_.current)==null||fe.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:S.jsx(FO,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:g,onInteractOutside:m,onDismiss:O,children:S.jsx(IM,{asChild:!0,...R,dir:C.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:$,onEntryFocus:$e(u,W=>{C.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:S.jsx(_D,{role:"menu","aria-orientation":"vertical","data-state":XN(k.open),"data-radix-menu-content":"",dir:C.dir,...Q,...x,ref:D,style:{outline:"none",...x.style},onKeyDown:$e(x.onKeyDown,W=>{const se=W.target.closest("[data-radix-menu-content]")===W.currentTarget,ge=W.ctrlKey||W.altKey||W.metaKey,oe=W.key.length===1;se&&(W.key==="Tab"&&W.preventDefault(),!ge&&oe&&V(W.key));const he=_.current;if(W.target!==he||!fF.includes(W.key))return;W.preventDefault();const Ce=E().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);xN.includes(W.key)&&Ce.reverse(),$F(Ce)}),onBlur:$e(t.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(B.current),L.current="")}),onPointerMove:$e(t.onPointerMove,Fd(W=>{const fe=W.target,se=H.current!==W.clientX;if(W.currentTarget.contains(fe)&&se){const ge=W.clientX>H.current?"right":"left";Y.current=ge,H.current=W.clientX}}))})})})})})})});TN.displayName=Xi;var kF="MenuGroup",P1=w.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return S.jsx(Wt.div,{role:"group",...r,ref:e})});P1.displayName=kF;var CF="MenuLabel",QN=w.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return S.jsx(Wt.div,{...r,ref:e})});QN.displayName=CF;var Wm="MenuItem",FA="menu.itemSelect",py=w.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=w.useRef(null),a=Dh(Wm,t.__scopeMenu),l=R1(Wm,t.__scopeMenu),u=Nn(e,s),d=w.useRef(!1),h=()=>{const g=s.current;if(!n&&g){const m=new CustomEvent(FA,{bubbles:!0,cancelable:!0});g.addEventListener(FA,O=>r==null?void 0:r(O),{once:!0}),MM(g,m),m.defaultPrevented?d.current=!1:a.onClose()}};return S.jsx(EN,{...i,ref:u,disabled:n,onClick:$e(t.onClick,h),onPointerDown:g=>{var m;(m=t.onPointerDown)==null||m.call(t,g),d.current=!0},onPointerUp:$e(t.onPointerUp,g=>{var m;d.current||(m=g.currentTarget)==null||m.click()}),onKeyDown:$e(t.onKeyDown,g=>{const m=l.searchRef.current!=="";n||m&&g.key===" "||pS.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});py.displayName=Wm;var EN=w.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,a=R1(Wm,n),l=SN(n),u=w.useRef(null),d=Nn(e,u),[h,g]=w.useState(!1),[m,O]=w.useState("");return w.useEffect(()=>{const v=u.current;v&&O((v.textContent??"").trim())},[s.children]),S.jsx(Wd.ItemSlot,{scope:n,disabled:r,textValue:i??m,children:S.jsx(ZM,{asChild:!0,...l,focusable:!r,children:S.jsx(Wt.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:d,onPointerMove:$e(t.onPointerMove,Fd(v=>{r?a.onItemLeave(v):(a.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:$e(t.onPointerLeave,Fd(v=>a.onItemLeave(v))),onFocus:$e(t.onFocus,()=>g(!0)),onBlur:$e(t.onBlur,()=>g(!1))})})})}),TF="MenuCheckboxItem",RN=w.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return S.jsx(MN,{scope:t.__scopeMenu,checked:n,children:S.jsx(py,{role:"menuitemcheckbox","aria-checked":Fm(n)?"mixed":n,...i,ref:e,"data-state":$1(n),onSelect:$e(i.onSelect,()=>r==null?void 0:r(Fm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});RN.displayName=TF;var AN="MenuRadioGroup",[QF,EF]=Yl(AN,{value:void 0,onValueChange:()=>{}}),PN=w.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=Vs(r);return S.jsx(QF,{scope:t.__scopeMenu,value:n,onValueChange:s,children:S.jsx(P1,{...i,ref:e})})});PN.displayName=AN;var _N="MenuRadioItem",$N=w.forwardRef((t,e)=>{const{value:n,...r}=t,i=EF(_N,t.__scopeMenu),s=n===i.value;return S.jsx(MN,{scope:t.__scopeMenu,checked:s,children:S.jsx(py,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":$1(s),onSelect:$e(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});$N.displayName=_N;var _1="MenuItemIndicator",[MN,RF]=Yl(_1,{checked:!1}),DN=w.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=RF(_1,n);return S.jsx(gs,{present:r||Fm(s.checked)||s.checked===!0,children:S.jsx(Wt.span,{...i,ref:e,"data-state":$1(s.checked)})})});DN.displayName=_1;var AF="MenuSeparator",NN=w.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return S.jsx(Wt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});NN.displayName=AF;var PF="MenuArrow",LN=w.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=hy(n);return S.jsx($D,{...i,...r,ref:e})});LN.displayName=PF;var _F="MenuSub",[ode,zN]=Yl(_F),Od="MenuSubTrigger",jN=w.forwardRef((t,e)=>{const n=Gl(Od,t.__scopeMenu),r=Dh(Od,t.__scopeMenu),i=zN(Od,t.__scopeMenu),s=R1(Od,t.__scopeMenu),a=w.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=s,d={__scopeMenu:t.__scopeMenu},h=w.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return w.useEffect(()=>h,[h]),w.useEffect(()=>{const g=l.current;return()=>{window.clearTimeout(g),u(null)}},[l,u]),S.jsx(Q1,{asChild:!0,...d,children:S.jsx(EN,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":XN(n.open),...t,ref:Va(e,i.onTriggerChange),onClick:g=>{var m;(m=t.onClick)==null||m.call(t,g),!(t.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:$e(t.onPointerMove,Fd(g=>{s.onItemEnter(g),!g.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:$e(t.onPointerLeave,Fd(g=>{var O,v;h();const m=(O=n.content)==null?void 0:O.getBoundingClientRect();if(m){const x=(v=n.content)==null?void 0:v.dataset.side,k=x==="right",C=k?-5:5,Q=m[k?"left":"right"],R=m[k?"right":"left"];s.onPointerGraceIntentChange({area:[{x:g.clientX+C,y:g.clientY},{x:Q,y:m.top},{x:R,y:m.top},{x:R,y:m.bottom},{x:Q,y:m.bottom}],side:x}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(g),g.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:$e(t.onKeyDown,g=>{var O;const m=s.searchRef.current!=="";t.disabled||m&&g.key===" "||dF[r.dir].includes(g.key)&&(n.onOpenChange(!0),(O=n.content)==null||O.focus(),g.preventDefault())})})})});jN.displayName=Od;var IN="MenuSubContent",ZN=w.forwardRef((t,e)=>{const n=kN(Xi,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=Gl(Xi,t.__scopeMenu),a=Dh(Xi,t.__scopeMenu),l=zN(IN,t.__scopeMenu),u=w.useRef(null),d=Nn(e,u);return S.jsx(Wd.Provider,{scope:t.__scopeMenu,children:S.jsx(gs,{present:r||s.open,children:S.jsx(Wd.Slot,{scope:t.__scopeMenu,children:S.jsx(A1,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:d,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var g;a.isUsingKeyboardRef.current&&((g=u.current)==null||g.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:$e(t.onFocusOutside,h=>{h.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:$e(t.onEscapeKeyDown,h=>{a.onClose(),h.preventDefault()}),onKeyDown:$e(t.onKeyDown,h=>{var O;const g=h.currentTarget.contains(h.target),m=hF[a.dir].includes(h.key);g&&m&&(s.onOpenChange(!1),(O=l.trigger)==null||O.focus(),h.preventDefault())})})})})})});ZN.displayName=IN;function XN(t){return t?"open":"closed"}function Fm(t){return t==="indeterminate"}function $1(t){return Fm(t)?"indeterminate":t?"checked":"unchecked"}function $F(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function MF(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function DF(t,e,n){const i=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let a=MF(t,Math.max(s,0));i.length===1&&(a=a.filter(d=>d!==n));const u=a.find(d=>d.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function NF(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const l=e[s],u=e[a],d=l.x,h=l.y,g=u.x,m=u.y;h>r!=m>r&&n<(g-d)*(r-h)/(m-h)+d&&(i=!i)}return i}function LF(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return NF(n,e)}function Fd(t){return e=>e.pointerType==="mouse"?t(e):void 0}var BN=wN,UN=Q1,VN=CN,qN=TN,YN=P1,GN=QN,WN=py,FN=RN,HN=PN,KN=$N,JN=DN,eL=NN,tL=LN,nL=jN,rL=ZN,M1="ContextMenu",[zF]=Zo(M1,[dy]),Ar=dy(),[jF,iL]=zF(M1),sL=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:i,modal:s=!0}=t,[a,l]=w.useState(!1),u=Ar(e),d=Vs(r),h=w.useCallback(g=>{l(g),d(g)},[d]);return S.jsx(jF,{scope:e,open:a,onOpenChange:h,modal:s,children:S.jsx(BN,{...u,dir:i,open:a,onOpenChange:h,modal:s,children:n})})};sL.displayName=M1;var oL="ContextMenuTrigger",aL=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=t,s=iL(oL,n),a=Ar(n),l=w.useRef({x:0,y:0}),u=w.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l.current})}),d=w.useRef(0),h=w.useCallback(()=>window.clearTimeout(d.current),[]),g=m=>{l.current={x:m.clientX,y:m.clientY},s.onOpenChange(!0)};return w.useEffect(()=>h,[h]),w.useEffect(()=>void(r&&h()),[r,h]),S.jsxs(S.Fragment,{children:[S.jsx(UN,{...a,virtualRef:u}),S.jsx(Wt.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...i,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:$e(t.onContextMenu,m=>{h(),g(m),m.preventDefault()}),onPointerDown:r?t.onPointerDown:$e(t.onPointerDown,Rg(m=>{h(),d.current=window.setTimeout(()=>g(m),700)})),onPointerMove:r?t.onPointerMove:$e(t.onPointerMove,Rg(h)),onPointerCancel:r?t.onPointerCancel:$e(t.onPointerCancel,Rg(h)),onPointerUp:r?t.onPointerUp:$e(t.onPointerUp,Rg(h))})]})});aL.displayName=oL;var IF="ContextMenuPortal",lL=t=>{const{__scopeContextMenu:e,...n}=t,r=Ar(e);return S.jsx(VN,{...r,...n})};lL.displayName=IF;var cL="ContextMenuContent",uL=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=iL(cL,n),s=Ar(n),a=w.useRef(!1);return S.jsx(qN,{...s,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{var u;(u=t.onCloseAutoFocus)==null||u.call(t,l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{var u;(u=t.onInteractOutside)==null||u.call(t,l),!l.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uL.displayName=cL;var ZF="ContextMenuGroup",XF=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Ar(n);return S.jsx(YN,{...i,...r,ref:e})});XF.displayName=ZF;var BF="ContextMenuLabel",UF=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Ar(n);return S.jsx(GN,{...i,...r,ref:e})});UF.displayName=BF;var VF="ContextMenuItem",fL=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Ar(n);return S.jsx(WN,{...i,...r,ref:e})});fL.displayName=VF;var qF="ContextMenuCheckboxItem",YF=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Ar(n);return S.jsx(FN,{...i,...r,ref:e})});YF.displayName=qF;var GF="ContextMenuRadioGroup",WF=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Ar(n);return S.jsx(HN,{...i,...r,ref:e})});WF.displayName=GF;var FF="ContextMenuRadioItem",HF=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Ar(n);return S.jsx(KN,{...i,...r,ref:e})});HF.displayName=FF;var KF="ContextMenuItemIndicator",JF=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Ar(n);return S.jsx(JN,{...i,...r,ref:e})});JF.displayName=KF;var eH="ContextMenuSeparator",dL=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Ar(n);return S.jsx(eL,{...i,...r,ref:e})});dL.displayName=eH;var tH="ContextMenuArrow",nH=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Ar(n);return S.jsx(tL,{...i,...r,ref:e})});nH.displayName=tH;var rH="ContextMenuSubTrigger",iH=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Ar(n);return S.jsx(nL,{...i,...r,ref:e})});iH.displayName=rH;var sH="ContextMenuSubContent",oH=w.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Ar(n);return S.jsx(rL,{...i,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});oH.displayName=sH;function Rg(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var aH=sL,lH=aL,cH=lL,uH=uL,fH=fL,dH=dL;function D1({...t}){return S.jsx(aH,{"data-slot":"context-menu",...t})}function N1({...t}){return S.jsx(lH,{"data-slot":"context-menu-trigger",...t})}function L1({className:t,...e}){return S.jsx(cH,{children:S.jsx(uH,{"data-slot":"context-menu-content",className:Ne("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...e})})}function Ds({className:t,inset:e,variant:n="default",...r}){return S.jsx(fH,{"data-slot":"context-menu-item","data-inset":e,"data-variant":n,className:Ne("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function gS({className:t,...e}){return S.jsx(dH,{"data-slot":"context-menu-separator",className:Ne("bg-border -mx-1 my-1 h-px",t),...e})}function hH(t){const{onRenameNote:e,onDeleteNote:n}=t;return S.jsxs(L1,{children:[S.jsxs(Ds,{onClick:e,children:[S.jsx(f2,{className:"mr-2 h-4 w-4"}),"Rename note"]}),S.jsx(gS,{}),S.jsxs(Ds,{variant:"destructive",onClick:n,children:[S.jsx(d2,{className:"mr-2 h-4 w-4"}),"Delete note"]})]})}function pH(t){const{onCreateFolder:e,onCreateNote:n,onRenameFolder:r,onDeleteFolder:i,onUpload:s}=t;return S.jsxs(L1,{children:[S.jsxs(Ds,{onClick:e,children:[S.jsx(c2,{className:"mr-2 h-4 w-4"}),"New folder"]}),S.jsxs(Ds,{onClick:n,children:[S.jsx(l2,{className:"mr-2 h-4 w-4"}),"New note"]}),S.jsxs(Ds,{onClick:s,children:[S.jsx(Gw,{className:"mr-2 h-4 w-4"}),"Upload markdown files"]}),S.jsx(gS,{}),S.jsxs(Ds,{onClick:r,children:[S.jsx(f2,{className:"mr-2 h-4 w-4"}),"Rename folder"]}),S.jsx(gS,{}),S.jsxs(Ds,{variant:"destructive",onClick:i,children:[S.jsx(d2,{className:"mr-2 h-4 w-4"}),"Delete folder"]})]})}function gH(t){const{onCreateFolder:e,onCreateNote:n,onUpload:r}=t;return S.jsxs(L1,{children:[S.jsxs(Ds,{onClick:e,children:[S.jsx(c2,{className:"mr-2 h-4 w-4"}),"New folder"]}),S.jsxs(Ds,{onClick:n,children:[S.jsx(l2,{className:"mr-2 h-4 w-4"}),"New note"]}),S.jsxs(Ds,{onClick:r,children:[S.jsx(Gw,{className:"mr-2 h-4 w-4"}),"Upload markdown files"]})]})}function hL({workspaceSlug:t,note:e,label:n,selectedNotePublicId:r,dragEnabled:i,onRenameNote:s,onDeleteNote:a,level:l=0}){const{attributes:u,listeners:d,setNodeRef:h,setActivatorNodeRef:g,transform:m,isDragging:O}=ON({id:hS("note",e.publicId)}),v=i?{...d,...u}:{},x=O?{transform:Ll.Translate.toString(m)}:void 0;return S.jsxs(D1,{children:[S.jsx(N1,{asChild:!0,children:S.jsxs("div",{ref:h,style:{...x,paddingLeft:l===0?4:l*12},className:Ne("group flex items-center gap-2 rounded-md px-2 py-1 text-sm text-muted-foreground transition","hover:bg-accent",r===e.publicId&&"bg-accent text-foreground",O&&"opacity-50"),children:[S.jsx("button",{type:"button",ref:g,...v,className:"opacity-0 transition group-hover:opacity-100 touch-none",children:S.jsx(Fw,{className:"h-3.5 w-3.5"})}),S.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[S.jsx("div",{className:"shrink-0 w-4"}),S.jsx(Ww,{className:"h-4 w-4 text-muted-foreground shrink-0"}),S.jsx(Bw,{to:"/workspaces/$workspaceSlug/notes/$noteId",params:{workspaceSlug:t,noteId:e.publicId},search:k=>({labels:typeof k.labels=="string"?k.labels:void 0,view:k.view==="code"||k.view==="split"||k.view==="preview"?k.view:void 0}),className:"flex-1 truncate",children:n})]})]})}),S.jsx(hH,{onRenameNote:s,onDeleteNote:a})]})}function mH({onCreateFolder:t,onCreateNote:e,onUpload:n}){const{setNodeRef:r,isOver:i}=yN({id:bN});return S.jsxs(D1,{children:[S.jsx(N1,{asChild:!0,children:S.jsxs("div",{ref:r,style:{paddingLeft:4},className:Ne("flex items-center gap-2 rounded-md px-2 py-1 text-sm text-muted-foreground transition","hover:bg-accent",i&&"bg-accent/70"),children:[S.jsx(Kc,{className:"h-4 w-4"}),S.jsx("span",{className:"font-medium text-foreground",children:"Root"})]})}),S.jsx(gH,{onCreateFolder:t,onCreateNote:e,onUpload:n})]})}function pL({node:t,level:e,expandedIds:n,toggleFolder:r,workspaceSlug:i,selectedFolderPublicId:s,selectedNotePublicId:a,onSelectFolder:l,dragEnabled:u,labelMode:d,onCreateFolder:h,onCreateNote:g,onRenameFolder:m,onDeleteFolder:O,onUpload:v,onRenameNote:x,onDeleteNote:k}){const C=n.has(t.publicId),Q=d==="name"?t.name:t.displayName,{attributes:R,listeners:E,setNodeRef:P,setActivatorNodeRef:$,transform:_,isDragging:D}=ON({id:hS("folder",t.publicId)}),{setNodeRef:B,isOver:L}=yN({id:hS("folder",t.publicId),disabled:D}),M=u?{...E,...R}:{},U=D?{transform:Ll.Translate.toString(_)}:void 0;return S.jsxs("div",{ref:B,className:"space-y-1",children:[S.jsxs(D1,{children:[S.jsx(N1,{asChild:!0,children:S.jsxs("div",{ref:P,style:{...U,paddingLeft:e===0?4:e*12},className:Ne("group flex items-center gap-2 rounded-md px-2 py-1 text-sm transition","hover:bg-accent",L&&"bg-accent/70",s===t.publicId&&"bg-accent text-foreground",D&&"opacity-50"),children:[S.jsx("button",{type:"button",ref:$,...M,className:"opacity-0 transition group-hover:opacity-100 touch-none",children:S.jsx(Fw,{className:"h-3.5 w-3.5"})}),S.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[S.jsx("button",{type:"button",onClick:()=>r(t.publicId),className:"text-muted-foreground shrink-0","aria-label":C?"Collapse folder":"Expand folder",children:C?S.jsx(o2,{className:"h-4 w-4"}):S.jsx(cY,{className:"h-4 w-4"})}),S.jsx(Kc,{className:"h-4 w-4 shrink-0"}),S.jsx("button",{type:"button",onClick:()=>t.id!==void 0&&l(t.id),className:"flex-1 truncate text-left",children:Q})]})]})}),S.jsx(pH,{onCreateFolder:()=>h(t.publicId),onCreateNote:()=>g(t.publicId),onRenameFolder:()=>m(t.publicId),onDeleteFolder:()=>O(t.publicId),onUpload:()=>v(t.publicId)})]}),C?S.jsx("div",{className:"space-y-1",children:vN(t.children,t.notes,d).map(Y=>Y.type==="folder"?S.jsx(pL,{node:Y.node,level:e+1,expandedIds:n,toggleFolder:r,workspaceSlug:i,selectedFolderPublicId:s,selectedNotePublicId:a,onSelectFolder:l,dragEnabled:u,labelMode:d,onCreateFolder:h,onCreateNote:g,onRenameFolder:m,onDeleteFolder:O,onUpload:v,onRenameNote:x,onDeleteNote:k},`folder-${Y.node.publicId}`):S.jsx(hL,{workspaceSlug:i,note:Y.note,label:Y.label,selectedNotePublicId:a,dragEnabled:u,onRenameNote:()=>x(Y.note.publicId),onDeleteNote:()=>k(Y.note.publicId),level:e+1},`note-${Y.note.publicId}`))}):null]})}function OH({activeDialog:t,dialogCopy:e,dialogDraft:n,isSubmitting:r,onSubmit:i,onClose:s,onDraftChange:a}){if(!t||!e)return null;const l=t.mode==="delete-note"||t.mode==="delete-folder";return S.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",children:[S.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:s}),S.jsxs("div",{className:"relative z-10 w-full max-w-sm rounded-lg border border-border bg-card p-4 shadow-xl",onClick:u=>u.stopPropagation(),children:[S.jsx("div",{className:"text-sm font-semibold text-foreground",children:e.title}),S.jsxs("form",{className:"mt-4 space-y-3",onSubmit:i,children:[l?S.jsx("div",{className:"space-y-2",children:t.mode==="delete-note"?S.jsxs("p",{className:"text-sm text-muted-foreground",children:['Are you sure you want to delete "',t.title,'"? This action cannot be undone.']}):S.jsxs("p",{className:"text-sm text-muted-foreground",children:['Are you sure you want to delete "',t.displayName,'"? This will also delete all notes and subfolders. This action cannot be undone.']})}):S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:e.displayNameLabel}),S.jsx("input",{value:n.displayName??"",onChange:u=>a({displayName:u.target.value}),placeholder:e.displayNamePlaceholder,autoFocus:!0,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground"})]}),e.nameLabel?S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:e.nameLabel}),S.jsx("input",{value:n.name??"",onChange:u=>a({name:u.target.value}),placeholder:e.namePlaceholder,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground"})]}):null]}),n.error?S.jsx("p",{className:"text-xs text-destructive",children:n.error}):null,S.jsxs("div",{className:"flex justify-end gap-2",children:[S.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-border px-3 py-1.5 text-xs text-foreground",children:"Cancel"}),S.jsx("button",{type:"submit",disabled:r,className:Ne("rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground transition",r&&"cursor-not-allowed opacity-60"),children:r?"Saving…":e.submitLabel})]})]})]})]})}function yH({open:t,workspaceName:e,error:n,isSubmitting:r,onNameChange:i,onSubmit:s,onClose:a}){return t?S.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",children:[S.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:a}),S.jsxs("div",{className:"relative z-10 w-full max-w-sm rounded-lg border border-border bg-card p-4 shadow-xl",onClick:l=>l.stopPropagation(),children:[S.jsx("div",{className:"text-sm font-semibold text-foreground",children:"Create workspace"}),S.jsxs("form",{className:"mt-4 space-y-3",onSubmit:s,children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Workspace name"}),S.jsx("input",{value:e,onChange:l=>i(l.target.value),placeholder:"Product planning",autoFocus:!0,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground"})]}),n?S.jsx("p",{className:"text-xs text-destructive",children:n}):null,S.jsxs("div",{className:"flex justify-end gap-2",children:[S.jsx("button",{type:"button",onClick:a,className:"rounded-md border border-border px-3 py-1.5 text-xs text-foreground",children:"Cancel"}),S.jsx("button",{type:"submit",disabled:r,className:Ne("rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground transition",r&&"cursor-not-allowed opacity-60"),children:r?"Creating…":"Create workspace"})]})]})]})]}):null}var gy="DropdownMenu",[bH]=Zo(gy,[dy]),Pr=dy(),[vH,gL]=bH(gy),mL=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:a,modal:l=!0}=t,u=Pr(e),d=w.useRef(null),[h,g]=Th({prop:i,defaultProp:s??!1,onChange:a,caller:gy});return S.jsx(vH,{scope:e,triggerId:Pa(),triggerRef:d,contentId:Pa(),open:h,onOpenChange:g,onOpenToggle:w.useCallback(()=>g(m=>!m),[g]),modal:l,children:S.jsx(BN,{...u,open:h,onOpenChange:g,dir:r,modal:l,children:n})})};mL.displayName=gy;var OL="DropdownMenuTrigger",yL=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,s=gL(OL,n),a=Pr(n);return S.jsx(UN,{asChild:!0,...a,children:S.jsx(Wt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Va(e,s.triggerRef),onPointerDown:$e(t.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:$e(t.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});yL.displayName=OL;var xH="DropdownMenuPortal",bL=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Pr(e);return S.jsx(VN,{...r,...n})};bL.displayName=xH;var vL="DropdownMenuContent",xL=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=gL(vL,n),s=Pr(n),a=w.useRef(!1);return S.jsx(qN,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:e,onCloseAutoFocus:$e(t.onCloseAutoFocus,l=>{var u;a.current||(u=i.triggerRef.current)==null||u.focus(),a.current=!1,l.preventDefault()}),onInteractOutside:$e(t.onInteractOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,h=u.button===2||d;(!i.modal||h)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});xL.displayName=vL;var SH="DropdownMenuGroup",wH=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Pr(n);return S.jsx(YN,{...i,...r,ref:e})});wH.displayName=SH;var kH="DropdownMenuLabel",SL=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Pr(n);return S.jsx(GN,{...i,...r,ref:e})});SL.displayName=kH;var CH="DropdownMenuItem",wL=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Pr(n);return S.jsx(WN,{...i,...r,ref:e})});wL.displayName=CH;var TH="DropdownMenuCheckboxItem",QH=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Pr(n);return S.jsx(FN,{...i,...r,ref:e})});QH.displayName=TH;var EH="DropdownMenuRadioGroup",RH=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Pr(n);return S.jsx(HN,{...i,...r,ref:e})});RH.displayName=EH;var AH="DropdownMenuRadioItem",PH=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Pr(n);return S.jsx(KN,{...i,...r,ref:e})});PH.displayName=AH;var _H="DropdownMenuItemIndicator",$H=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Pr(n);return S.jsx(JN,{...i,...r,ref:e})});$H.displayName=_H;var MH="DropdownMenuSeparator",kL=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Pr(n);return S.jsx(eL,{...i,...r,ref:e})});kL.displayName=MH;var DH="DropdownMenuArrow",NH=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Pr(n);return S.jsx(tL,{...i,...r,ref:e})});NH.displayName=DH;var LH="DropdownMenuSubTrigger",zH=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Pr(n);return S.jsx(nL,{...i,...r,ref:e})});zH.displayName=LH;var jH="DropdownMenuSubContent",IH=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Pr(n);return S.jsx(rL,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});IH.displayName=jH;var ZH=mL,XH=yL,BH=bL,UH=xL,VH=SL,qH=wL,YH=kL;function my({...t}){return S.jsx(ZH,{"data-slot":"dropdown-menu",...t})}function Oy({...t}){return S.jsx(XH,{"data-slot":"dropdown-menu-trigger",...t})}function yy({className:t,sideOffset:e=4,...n}){return S.jsx(BH,{children:S.jsx(UH,{"data-slot":"dropdown-menu-content",sideOffset:e,className:Ne("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...n})})}function zl({className:t,inset:e,variant:n="default",...r}){return S.jsx(qH,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:Ne("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function CL({className:t,inset:e,...n}){return S.jsx(VH,{"data-slot":"dropdown-menu-label","data-inset":e,className:Ne("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...n})}function GH({className:t,...e}){return S.jsx(YH,{"data-slot":"dropdown-menu-separator",className:Ne("bg-border -mx-1 my-1 h-px",t),...e})}function WH({activeWorkspace:t,workspaces:e,labelMode:n,refreshing:r,hasWorkspace:i,isMobile:s,onSwitchWorkspace:a,onCreateWorkspace:l,onToggleLabelMode:u}){return S.jsxs(tG,{className:"gap-3 px-4 py-3",children:[S.jsx(qD,{children:S.jsx(YD,{children:S.jsxs(my,{children:[S.jsx(Oy,{asChild:!0,children:S.jsxs(GD,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[S.jsx("div",{className:"bg-sidebar-primary text-sidebar-primary-foreground flex size-8 items-center justify-center rounded-lg",children:S.jsx(Kc,{className:"size-4"})}),S.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[S.jsx("span",{className:"truncate font-medium",children:t.name}),S.jsx("span",{className:"truncate text-xs text-muted-foreground",children:"Switch workspace"})]}),S.jsx(a2,{className:"ml-auto size-4"})]})}),S.jsxs(yy,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",align:"start",side:s?"bottom":"right",sideOffset:4,children:[S.jsx(CL,{className:"text-xs text-muted-foreground",children:"Workspaces"}),e.map(d=>S.jsxs(zl,{onClick:()=>a(d.slug),className:"gap-2 p-2",children:[S.jsx("div",{className:"flex size-6 items-center justify-center rounded-md border border-border",children:S.jsx(Kc,{className:"size-3.5 shrink-0"})}),d.name]},d.slug)),S.jsxs(zl,{onClick:l,className:"gap-2 p-2 text-muted-foreground",children:[S.jsx("div",{className:"flex size-6 items-center justify-center rounded-md border border-dashed border-border",children:S.jsx(Kc,{className:"size-3.5 shrink-0"})}),"New workspace"]})]})]})})}),i?S.jsx("div",{className:"flex items-center justify-between gap-2",children:S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{type:"button",onClick:u,className:"rounded-md border border-border px-2 py-1 text-[10px] text-muted-foreground transition hover:bg-accent",children:n==="display"?"Show names":"Show titles"}),r?S.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Refreshing…"}):null]})}):null]})}function FH({user:t,isMobile:e,onSignOut:n}){if(!t)return null;const r=t.name??t.email??"Unknown user",i=t.email??"",s=r.trim().charAt(0).toUpperCase()||"U";return S.jsx(nG,{className:"px-4 pb-4",children:S.jsx(qD,{children:S.jsx(YD,{children:S.jsxs(my,{children:[S.jsx(Oy,{asChild:!0,children:S.jsxs(GD,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[S.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-sidebar-primary text-xs font-semibold text-sidebar-primary-foreground",children:s}),S.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[S.jsx("span",{className:"truncate font-medium",children:r}),i?S.jsx("span",{className:"truncate text-xs",children:i}):null]}),S.jsx(a2,{className:"ml-auto size-4"})]})}),S.jsxs(yy,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:e?"bottom":"right",align:"end",sideOffset:4,children:[S.jsx(CL,{className:"p-0 font-normal",children:S.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[S.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-sidebar-primary text-xs font-semibold text-sidebar-primary-foreground",children:s}),S.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[S.jsx("span",{className:"truncate font-medium",children:r}),i?S.jsx("span",{className:"truncate text-xs",children:i}):null]})]})}),S.jsx(GH,{}),S.jsx(zl,{onClick:n,children:"Log out"})]})]})})})})}const HH=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,KH=/^[a-z0-9]+(?:_[a-z0-9]+)*$/,JH=/^[a-z][a-z0-9]*([A-Z][a-z0-9]*)*$/,eK=/^[A-Z][a-z0-9]*([A-Z][a-z0-9]*)*$/,tK=t=>HH.test(t)||KH.test(t)||JH.test(t)||eK.test(t),TL=t=>t.name.toLowerCase().endsWith(".md"),nK=t=>t.replace(/[-_]/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,e=>e.toUpperCase()),rK=t=>t.toLowerCase().replace(/[^a-z0-9\s-_]/g,"").trim().replace(/\s+/g,"-").replace(/-+/g,"-"),iK=t=>{const e=t.replace(/\.md$/i,"");return tK(e)?e:rK(e)},sK=t=>{const e=[],n=new Map;return t.forEach(r=>{if(!TL(r))return;const s=(r.webkitRelativePath||r.name).split("/").filter(Boolean),a=s.pop();let l="",u=e;for(const d of s){l=l?`${l}/${d}`:d;let h=n.get(l);h||(h={type:"folder",name:d,path:l,children:[]},n.set(l,h),u.push(h)),u=h.children}u.push({type:"file",name:a,path:l?`${l}/${a}`:a,file:r})}),e},oK=t=>{const e=[],n=new Map;return t.forEach(({file:r,relativePath:i})=>{if(!TL(r))return;const s=i.split("/").filter(Boolean),a=s.pop();let l="",u=e;for(const d of s){l=l?`${l}/${d}`:d;let h=n.get(l);h||(h={type:"folder",name:d,path:l,children:[]},n.set(l,h),u.push(h)),u=h.children}u.push({type:"file",name:a,path:l?`${l}/${a}`:a,file:r})}),e},HA=(t,e=null)=>{const n=[],r=(i,s)=>{i.forEach(a=>{if(a.type==="folder"&&a.children){const l=s?`${s}/${a.name}`:a.name;r(a.children,l)}else if(a.type==="file"&&a.file){const l=a.file.name,u=iK(l),d=nK(u);n.push({name:u,title:d,content:"",folderPath:s,file:a.file})}})};return r(t,e),n},aK=UO("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function lK({className:t,variant:e,asChild:n=!1,...r}){const i=n?Uw:"span";return S.jsx(i,{"data-slot":"badge",className:Ne(aK({variant:e}),t),...r})}function cK({workspaceSlug:t,targetFolderPublicId:e,open:n,onOpenChange:r,onSuccess:i}){const[s,a]=w.useState(!1),[l,u]=w.useState([]),[d,h]=w.useState(null),[g,m]=w.useState({uploading:!1,progress:0,created:0,errors:[]}),O=w.useCallback(()=>{u([]),h(null),m({uploading:!1,progress:0,created:0,errors:[]})},[]),v=w.useCallback(()=>{g.uploading||(r(!1),setTimeout(O,300))},[g.uploading,r,O]),x=w.useCallback(_=>{_.preventDefault(),a(!0)},[]),k=w.useCallback(_=>{_.preventDefault(),a(!1)},[]),C=w.useCallback(async(_,D,B="")=>{if(_.isFile){const L=_,M=await new Promise((Y,H)=>{L.file(ee=>Y(ee),H)}),U=B?`${B}/${M.name}`:M.name;D.push({file:M,relativePath:U})}else if(_.isDirectory){const L=_.createReader(),M=await new Promise((Y,H)=>{L.readEntries(Y,H)}),U=B?`${B}/${_.name}`:_.name;for(const Y of M)await C(Y,D,U)}},[]),Q=w.useCallback(async _=>{if(_.length===0)return;const D=sK(_),B=HA(D,null),L=[];for(const M of B)try{const U=await M.file.text();L.push({...M,content:U})}catch(U){console.error(`Failed to read file ${M.file.name}:`,U)}u(L)},[]),R=w.useCallback(async _=>{var M,U;_.preventDefault(),a(!1);const D=Array.from(_.dataTransfer.items||[]),B=Array.from(_.dataTransfer.files||[]);if(D.length===0){Q(B);return}let L=!1;for(const Y of D){const H=(M=Y.webkitGetAsEntry)==null?void 0:M.call(Y);if(H!=null&&H.isDirectory){L=!0;break}}if(L){const Y=[];for(const V of D){const Z=(U=V.webkitGetAsEntry)==null?void 0:U.call(V);Z&&await C(Z,Y)}h("folder");const H=oK(Y),ee=HA(H,null),N=[];for(const V of ee)try{const Z=await V.file.text();N.push({...V,content:Z})}catch(Z){console.error(`Failed to read file ${V.file.name}:`,Z)}u(N)}else h("files"),Q(B)},[C,Q]),E=w.useCallback(_=>{const D=_.target.id==="markdown-upload-files"?"files":"folder";h(D);const B=Array.from(_.target.files||[]);Q(B)},[Q]),P=Fq(),$=w.useCallback(async()=>{if(l.length!==0){m(_=>({..._,uploading:!0,progress:0,errors:[]}));try{const _={entries:l.map(B=>({name:B.name,title:B.title,content:B.content,folderPath:B.folderPath})),targetFolderPublicId:e},D=await P.mutateAsync({workspaceSlug:t,request:_});m(B=>({...B,uploading:!1,progress:100,created:D.created||0,errors:D.errors||[]})),D.errors.length===0&&i&&setTimeout(()=>{i(),v()},1e3)}catch(_){m(D=>({...D,uploading:!1,errors:[{path:"upload",error:_ instanceof Error?_.message:"Upload failed"}]}))}}},[l,t,e,P,i,v]);return S.jsx(iD,{open:n,onOpenChange:v,children:S.jsxs(sD,{className:"flex flex-col",children:[S.jsxs(oD,{children:[S.jsx(aD,{children:"Upload Markdown Files"}),S.jsx(lD,{children:"Upload single or multiple markdown files, or entire folder structures to your workspace"})]}),S.jsxs("div",{className:"flex-1 flex flex-col gap-4 overflow-hidden p-2",children:[l.length===0&&!g.uploading?S.jsxs("div",{onDragOver:x,onDragLeave:k,onDrop:R,className:Ne("border-2 border-dashed rounded-lg flex flex-col items-center justify-center gap-4 transition-colors p-4 h-full",s?"border-primary bg-primary/5":"border-border"),children:[S.jsxs("div",{className:"text-center flex flex-col items-center",children:[S.jsx(Gw,{className:"h-8 w-8 text-muted-foreground"}),S.jsx("p",{className:"text-sm font-medium text-foreground",children:"Drop markdown files or folder here"}),S.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"or click to browse"})]}),S.jsx("input",{id:"markdown-upload-files",type:"file",multiple:!0,accept:".md,.markdown",onChange:E,className:"hidden"}),S.jsx("input",{id:"markdown-upload-folder",type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:E,className:"hidden"}),S.jsxs(my,{children:[S.jsx(Oy,{asChild:!0,children:S.jsxs(Yn,{type:"button",variant:"outline",size:"sm",children:["Select Files or Folder",S.jsx(o2,{className:"ml-2 h-4 w-4"})]})}),S.jsxs(yy,{align:"center",children:[S.jsx(zl,{onClick:()=>{var _;return(_=document.getElementById("markdown-upload-files"))==null?void 0:_.click()},children:"Select Files"}),S.jsx(zl,{onClick:()=>{var _;return(_=document.getElementById("markdown-upload-folder"))==null?void 0:_.click()},children:"Select Folder"})]})]})]}):null,l.length>0&&!g.uploading?S.jsx("div",{className:"flex-1 overflow-auto",children:S.jsxs("div",{className:"px-2 space-y-2",children:[S.jsxs("div",{className:"flex items-center justify-between text-sm",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[d&&S.jsx(lK,{variant:"secondary",children:d==="folder"?"Folder Upload":"Files Upload"}),S.jsxs("span",{className:"text-muted-foreground",children:[l.length," ",l.length===1?"file":"files"," ready to upload"]})]}),S.jsx(Yn,{type:"button",variant:"ghost",size:"sm",onClick:O,disabled:g.uploading,children:"Clear"})]}),S.jsx("div",{className:"space-y-1",children:l.map((_,D)=>S.jsxs("div",{className:"flex items-center gap-2 text-sm p-2 rounded-md bg-muted/50",children:[S.jsx(Ww,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),S.jsx("span",{className:"flex-1 truncate text-foreground",children:_.title}),_.folderPath&&S.jsx("span",{className:"text-xs text-muted-foreground",children:_.folderPath})]},D))})]})}):null,g.uploading?S.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4",children:[S.jsx(u2,{className:"h-12 w-12 text-primary animate-spin"}),S.jsxs("p",{className:"text-sm text-muted-foreground",children:["Uploading ",l.length," ",l.length===1?"file":"files","..."]})]}):null,g.created>0&&g.errors.length===0?S.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4",children:[S.jsx(dY,{className:"h-12 w-12 text-green-500"}),S.jsxs("p",{className:"text-sm text-foreground",children:["Successfully uploaded ",g.created," ",g.created===1?"file":"files"]})]}):null,g.errors.length>0?S.jsxs("div",{className:"flex-1 overflow-auto",children:[S.jsxs("p",{className:"text-sm font-medium text-foreground mb-2",children:[g.errors.length," ",g.errors.length===1?"error":"errors"," occurred"]}),S.jsx("div",{className:"px-2 space-y-1",children:g.errors.map((_,D)=>S.jsxs("div",{className:"flex items-start gap-2 text-sm p-2 rounded-md bg-destructive/10 border border-destructive/20",children:[S.jsx(pY,{className:"h-4 w-4 text-destructive flex-shrink-0 mt-0.5"}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("p",{className:"text-destructive font-medium truncate",children:_.path}),S.jsx("p",{className:"text-destructive/80 text-xs",children:_.error})]})]},D))})]}):null]}),l.length>0&&!g.uploading&&g.errors.length===0?S.jsxs("div",{className:"flex gap-2 p-4 border-t",children:[S.jsx(Yn,{type:"button",variant:"outline",onClick:O,className:"flex-1",children:"Cancel"}),S.jsxs(Yn,{type:"button",onClick:$,className:"flex-1",children:["Upload ",l.length," ",l.length===1?"File":"Files"]})]}):null,g.errors.length>0&&!g.uploading?S.jsx("div",{className:"flex gap-2 pt-4 border-t",children:S.jsx(Yn,{type:"button",variant:"outline",onClick:O,className:"flex-1",children:"Close"})}):null]})})}function uK({workspaceSlug:t,workspaceName:e,workspaces:n,initialTree:r}){const{data:i}=Ur(Ch),{isMobile:s}=y1(),{tree:a,expandedIds:l,activeDialog:u,dialogDraft:d,activeDrag:h,uploadTarget:g,refreshing:m,selectedNotePublicId:O,selectedFolderPublicId:v,workspaceList:x,newWorkspaceName:k,createWorkspaceError:C,createWorkspaceModalOpen:Q,dragEnabled:R,isMounted:E,hasWorkspace:P,labelMode:$,activeWorkspace:_,isCreateWorkspaceSubmitting:D,isDialogSubmitting:B,sensors:L,collisionDetection:M,dialogCopy:U,dragLabel:Y,toggleFolder:H,refreshTree:ee,handleDialogSubmit:N,handleDragStart:V,handleDragEnd:Z,handleCloseDialog:W,handleRootCreateFolder:fe,handleRootCreateNote:se,handleRootUpload:ge,handleFolderCreateFolder:oe,handleFolderCreateNote:he,handleFolderRename:me,handleFolderDelete:Ce,handleFolderUpload:Te,handleNoteRename:Ye,handleNoteDelete:je,handleCloseCreateWorkspaceModal:ze,handleCreateWorkspace:Ct,handleOpenCreateWorkspaceModal:Fe,handleSignOut:Tt,handleLabelModeToggle:lt,handleWorkspaceSwitch:ut,setNewWorkspaceName:Qt,setUploadTarget:on,setDialogDraft:Ht}=tF({workspaceSlug:t,workspaceName:e,workspaces:n,initialTree:r});return S.jsxs(S.Fragment,{children:[S.jsxs(J9,{collapsible:"none",className:"w-full min-w-[300px] border-r border-border h-svh",children:[S.jsx(WH,{activeWorkspace:_,workspaces:x,labelMode:$,refreshing:m,hasWorkspace:P,isMobile:s,onSwitchWorkspace:ut,onCreateWorkspace:Fe,onToggleLabelMode:lt}),S.jsx("div",{className:"px-4",children:S.jsx(DA,{className:"mx-0"})}),S.jsx(rG,{className:"px-4 pb-4 pt-2",children:P&&E?S.jsx(rF,{sensors:L,collisionDetection:M,onDragStart:V,onDragEnd:Z,activeDrag:h,dragLabel:Y,children:S.jsxs("div",{className:"space-y-2",children:[S.jsx("div",{className:"mt-1",children:S.jsx(mH,{onCreateFolder:fe,onCreateNote:se,onUpload:ge})}),a.rootNotes.length===0&&a.folders.length===0?S.jsx("p",{className:"text-xs text-muted-foreground",children:"No notes or folders yet."}):S.jsx("div",{className:"space-y-1",children:vN(a.folders,a.rootNotes,$).map(Ge=>Ge.type==="folder"?S.jsx(pL,{node:Ge.node,level:0,expandedIds:l,toggleFolder:H,workspaceSlug:t,selectedFolderPublicId:v,selectedNotePublicId:O,onSelectFolder:()=>{},dragEnabled:R,labelMode:$,onCreateFolder:oe,onCreateNote:he,onRenameFolder:me,onDeleteFolder:Ce,onUpload:Te,onRenameNote:Ye,onDeleteNote:je},`folder-${Ge.node.publicId}`):S.jsx(hL,{workspaceSlug:t,note:Ge.note,label:Ge.label,selectedNotePublicId:O,dragEnabled:R,onRenameNote:()=>Ye(Ge.note.publicId),onDeleteNote:()=>je(Ge.note.publicId),level:0},`note-${Ge.note.publicId}`))})]})}):S.jsx("div",{className:"flex-1 px-4 py-4"})}),S.jsx("div",{className:"px-4",children:S.jsx(DA,{className:"mx-0"})}),S.jsx(FH,{user:i!=null&&i.user?{name:i.user.name??null,email:i.user.email??null}:null,isMobile:s,onSignOut:Tt}),S.jsx(yH,{open:Q,workspaceName:k,error:C,isSubmitting:D,onNameChange:Qt,onSubmit:Ct,onClose:ze}),S.jsx(OH,{activeDialog:u,dialogCopy:U,dialogDraft:d,isSubmitting:B,onSubmit:N,onClose:W,onDraftChange:Ht})]}),g&&t&&S.jsx(cK,{workspaceSlug:t,targetFolderPublicId:g.folderPublicId,open:!0,onOpenChange:Ge=>!Ge&&on(null),onSuccess:ee})]})}function fK({children:t,workspaceSlug:e,workspaceName:n,workspaces:r,initialTree:i}){return S.jsx(K9,{children:S.jsxs(y8,{orientation:"horizontal",className:"h-svh",children:[S.jsx(uA,{defaultSize:20,minSize:300,maxSize:500,children:S.jsx(uK,{workspaceSlug:e,workspaceName:n,workspaces:r,initialTree:i})}),S.jsx(b8,{withHandle:!0}),S.jsx(uA,{defaultSize:80,children:S.jsx(eG,{className:"h-svh min-h-0 overflow-hidden",children:t})})]})})}function dK(t){const e=Yr();w.useEffect(()=>{if(!t)return;const n=i=>{try{const s=JSON.parse(i.data),a=i.type;switch(a){case"note.created":case"note.updated":case"note.deleted":case"note.moved":case"folder.created":case"folder.updated":case"folder.deleted":case"folder.moved":e.invalidateQueries({queryKey:dn.tree(t)}),(a==="note.updated"||a==="note.deleted"||a==="note.moved")&&"publicId"in s&&typeof s.publicId=="string"&&e.invalidateQueries({queryKey:Zr.detail(t,s.publicId)}),a==="note.updated"&&"publicId"in s&&typeof s.publicId=="string"&&e.invalidateQueries({queryKey:Zr.history(t,s.publicId)});break;case"ready":break;default:console.debug("Unknown SSE event type:",a,s)}}catch(s){console.warn("Failed to parse SSE event:",s)}},{cleanup:r}=rn.subscribeToWorkspaceEvents(t,n);return r},[t,e])}function hK(){const t=or(),{workspaceSlug:e}=ju({from:"/_authed/workspaces/$workspaceSlug"}),{data:n,isLoading:r,error:i}=Ur({...r2(e||""),enabled:!!e}),{data:s,isLoading:a,error:l}=Ur({...i2(e||""),enabled:!!e}),{data:u}=Ur(WO);dK(e||null),w.useEffect(()=>{if(!e){t({to:"/workspaces",replace:!0});return}},[e,t,r,n,i]),w.useEffect(()=>{(i&&Bd(i)||l&&Bd(l))&&t({to:"/login",replace:!0})},[i,l,t]);const d=r||a,h=(i==null?void 0:i.message)||(l==null?void 0:l.message)||null;if(d)return S.jsxs("div",{className:"flex h-svh",children:[S.jsxs("div",{className:"w-80 border-r border-border p-4 space-y-4",children:[S.jsx(Zs,{className:"h-8 w-full"}),S.jsx(Zs,{className:"h-4 w-3/4"}),S.jsx(Zs,{className:"h-4 w-1/2"})]}),S.jsx("div",{className:"flex-1 flex items-center justify-center",children:S.jsx("div",{className:"text-muted-foreground",children:"Loading workspace..."})})]});if(h||!n||!s)return S.jsx("div",{className:"flex h-svh items-center justify-center",children:S.jsx("div",{className:"text-destructive",children:h||"Failed to load workspace"})});const g=(u||[]).map(m=>({id:m.id,slug:m.slug,name:m.name}));return S.jsx(fK,{workspaceSlug:e||null,workspaceName:n.name,workspaces:g,initialTree:s,children:S.jsx(kh,{})})}const pK=ls("/_authed/workspaces/$workspaceSlug")({component:hK,validateSearch:t=>({labels:typeof t.labels=="string"?t.labels:void 0}),loader:async({params:t,context:e})=>{const{workspaceSlug:n}=t,{queryClient:r}=e;if(n)try{await r.ensureQueryData(WO),await r.ensureQueryData(r2(n)),await r.ensureQueryData(i2(n))}catch(i){if(Bd(i))throw wh({to:"/login",replace:!0})}}});class by extends Error{constructor(n="Unauthorized - session may have expired"){super(n);We(this,"name","UnauthorizedError")}}function ts(t){return t instanceof by}function vy(t,e){return{queryKey:Zr.detail(t,e),queryFn:async()=>{const n=await rn.getNote(t,e);if(n.status===401)throw new by;if(n.status!==200||!n.data)throw new Error(n.error||"Failed to load note");return n.data}}}function QL(t,e){return{queryKey:Zr.history(t,e),queryFn:async()=>{const n=await rn.getNoteHistory(t,e);if(n.status===401)throw new by;if(n.status!==200||!n.data)throw new Error(n.error||"Failed to load note history");return n.data}}}function KA(t,e){return{queryKey:Zr.collabToken(t,e),queryFn:async()=>{const n=await rn.getCollabToken(t,e);if(n.status===401)throw new by;if(n.status!==200||!n.data)throw new Error(n.error||"Failed to get collab token");return n.data}}}function gK(){return S.jsx(kh,{})}const mK=ls("/_authed/workspaces/$workspaceSlug/notes/$noteId")({component:gK,loader:async({params:t,context:e})=>{const{workspaceSlug:n,noteId:r}=t,{queryClient:i}=e;if(!(!n||!r))try{await i.ensureQueryData(vy(n,r))}catch(s){if(ts(s))throw wh({to:"/login",replace:!0})}}});/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:EL,setPrototypeOf:JA,isFrozen:OK,getPrototypeOf:yK,getOwnPropertyDescriptor:bK}=Object;let{freeze:Qr,seal:Ui,create:mS}=Object,{apply:OS,construct:yS}=typeof Reflect<"u"&&Reflect;Qr||(Qr=function(e){return e});Ui||(Ui=function(e){return e});OS||(OS=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return e.apply(n,i)});yS||(yS=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new e(...r)});const Ag=Er(Array.prototype.forEach),vK=Er(Array.prototype.lastIndexOf),eP=Er(Array.prototype.pop),ed=Er(Array.prototype.push),xK=Er(Array.prototype.splice),hm=Er(String.prototype.toLowerCase),Gv=Er(String.prototype.toString),Wv=Er(String.prototype.match),td=Er(String.prototype.replace),SK=Er(String.prototype.indexOf),wK=Er(String.prototype.trim),Ji=Er(Object.prototype.hasOwnProperty),br=Er(RegExp.prototype.test),nd=kK(TypeError);function Er(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return OS(t,e,r)}}function kK(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return yS(t,n)}}function tt(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hm;JA&&JA(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const s=n(i);s!==i&&(OK(e)||(e[r]=s),i=s)}t[i]=!0}return t}function CK(t){for(let e=0;e<t.length;e++)Ji(t,e)||(t[e]=null);return t}function Es(t){const e=mS(null);for(const[n,r]of EL(t))Ji(t,n)&&(Array.isArray(r)?e[n]=CK(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=Es(r):e[n]=r);return e}function rd(t,e){for(;t!==null;){const r=bK(t,e);if(r){if(r.get)return Er(r.get);if(typeof r.value=="function")return Er(r.value)}t=yK(t)}function n(){return null}return n}const tP=Qr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Fv=Qr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Hv=Qr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),TK=Qr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Kv=Qr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),QK=Qr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),nP=Qr(["#text"]),rP=Qr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Jv=Qr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),iP=Qr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Pg=Qr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),EK=Ui(/\{\{[\w\W]*|[\w\W]*\}\}/gm),RK=Ui(/<%[\w\W]*|[\w\W]*%>/gm),AK=Ui(/\$\{[\w\W]*/gm),PK=Ui(/^data-[\-\w.\u00B7-\uFFFF]+$/),_K=Ui(/^aria-[\-\w]+$/),RL=Ui(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$K=Ui(/^(?:\w+script|data):/i),MK=Ui(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),AL=Ui(/^html$/i),DK=Ui(/^[a-z][.\w]*(-[.\w]+)+$/i);var sP=Object.freeze({__proto__:null,ARIA_ATTR:_K,ATTR_WHITESPACE:MK,CUSTOM_ELEMENT:DK,DATA_ATTR:PK,DOCTYPE_NAME:AL,ERB_EXPR:RK,IS_ALLOWED_URI:RL,IS_SCRIPT_OR_DATA:$K,MUSTACHE_EXPR:EK,TMPLIT_EXPR:AK});const id={element:1,text:3,progressingInstruction:7,comment:8,document:9},NK=function(){return typeof window>"u"?null:window},LK=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},oP=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function PL(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:NK();const e=ye=>PL(ye);if(e.version="3.3.1",e.removed=[],!t||!t.document||t.document.nodeType!==id.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:u,NodeFilter:d,NamedNodeMap:h=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:g,DOMParser:m,trustedTypes:O}=t,v=u.prototype,x=rd(v,"cloneNode"),k=rd(v,"remove"),C=rd(v,"nextSibling"),Q=rd(v,"childNodes"),R=rd(v,"parentNode");if(typeof a=="function"){const ye=n.createElement("template");ye.content&&ye.content.ownerDocument&&(n=ye.content.ownerDocument)}let E,P="";const{implementation:$,createNodeIterator:_,createDocumentFragment:D,getElementsByTagName:B}=n,{importNode:L}=r;let M=oP();e.isSupported=typeof EL=="function"&&typeof R=="function"&&$&&$.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:U,ERB_EXPR:Y,TMPLIT_EXPR:H,DATA_ATTR:ee,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:Z,CUSTOM_ELEMENT:W}=sP;let{IS_ALLOWED_URI:fe}=sP,se=null;const ge=tt({},[...tP,...Fv,...Hv,...Kv,...nP]);let oe=null;const he=tt({},[...rP,...Jv,...iP,...Pg]);let me=Object.seal(mS(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,Te=null;const Ye=Object.seal(mS(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let je=!0,ze=!0,Ct=!1,Fe=!0,Tt=!1,lt=!0,ut=!1,Qt=!1,on=!1,Ht=!1,Ge=!1,It=!1,jn=!0,He=!1;const Gr="user-content-";let Zt=!0,In=!1,Be={},Ue=null;const gt=tt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Fn=null;const gr=tt({},["audio","video","img","source","image","track"]);let gn=null;const Wr=tt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Hn="http://www.w3.org/1998/Math/MathML",tn="http://www.w3.org/2000/svg",Dt="http://www.w3.org/1999/xhtml";let Xt=Dt,bi=!1,_r=null;const eo=tt({},[Hn,tn,Dt],Gv);let ar=tt({},["mi","mo","mn","ms","mtext"]),mr=tt({},["annotation-xml"]);const Bt=tt({},["title","style","font","a","script"]);let ht=null;const Kt=["application/xhtml+xml","text/html"],wn="text/html";let et=null,Nt=null;const mn=n.createElement("form"),ae=function(I){return I instanceof RegExp||I instanceof Function},ve=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Nt&&Nt===I)){if((!I||typeof I!="object")&&(I={}),I=Es(I),ht=Kt.indexOf(I.PARSER_MEDIA_TYPE)===-1?wn:I.PARSER_MEDIA_TYPE,et=ht==="application/xhtml+xml"?Gv:hm,se=Ji(I,"ALLOWED_TAGS")?tt({},I.ALLOWED_TAGS,et):ge,oe=Ji(I,"ALLOWED_ATTR")?tt({},I.ALLOWED_ATTR,et):he,_r=Ji(I,"ALLOWED_NAMESPACES")?tt({},I.ALLOWED_NAMESPACES,Gv):eo,gn=Ji(I,"ADD_URI_SAFE_ATTR")?tt(Es(Wr),I.ADD_URI_SAFE_ATTR,et):Wr,Fn=Ji(I,"ADD_DATA_URI_TAGS")?tt(Es(gr),I.ADD_DATA_URI_TAGS,et):gr,Ue=Ji(I,"FORBID_CONTENTS")?tt({},I.FORBID_CONTENTS,et):gt,Ce=Ji(I,"FORBID_TAGS")?tt({},I.FORBID_TAGS,et):Es({}),Te=Ji(I,"FORBID_ATTR")?tt({},I.FORBID_ATTR,et):Es({}),Be=Ji(I,"USE_PROFILES")?I.USE_PROFILES:!1,je=I.ALLOW_ARIA_ATTR!==!1,ze=I.ALLOW_DATA_ATTR!==!1,Ct=I.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=I.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Tt=I.SAFE_FOR_TEMPLATES||!1,lt=I.SAFE_FOR_XML!==!1,ut=I.WHOLE_DOCUMENT||!1,Ht=I.RETURN_DOM||!1,Ge=I.RETURN_DOM_FRAGMENT||!1,It=I.RETURN_TRUSTED_TYPE||!1,on=I.FORCE_BODY||!1,jn=I.SANITIZE_DOM!==!1,He=I.SANITIZE_NAMED_PROPS||!1,Zt=I.KEEP_CONTENT!==!1,In=I.IN_PLACE||!1,fe=I.ALLOWED_URI_REGEXP||RL,Xt=I.NAMESPACE||Dt,ar=I.MATHML_TEXT_INTEGRATION_POINTS||ar,mr=I.HTML_INTEGRATION_POINTS||mr,me=I.CUSTOM_ELEMENT_HANDLING||{},I.CUSTOM_ELEMENT_HANDLING&&ae(I.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(me.tagNameCheck=I.CUSTOM_ELEMENT_HANDLING.tagNameCheck),I.CUSTOM_ELEMENT_HANDLING&&ae(I.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(me.attributeNameCheck=I.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),I.CUSTOM_ELEMENT_HANDLING&&typeof I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(me.allowCustomizedBuiltInElements=I.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Tt&&(ze=!1),Ge&&(Ht=!0),Be&&(se=tt({},nP),oe=[],Be.html===!0&&(tt(se,tP),tt(oe,rP)),Be.svg===!0&&(tt(se,Fv),tt(oe,Jv),tt(oe,Pg)),Be.svgFilters===!0&&(tt(se,Hv),tt(oe,Jv),tt(oe,Pg)),Be.mathMl===!0&&(tt(se,Kv),tt(oe,iP),tt(oe,Pg))),I.ADD_TAGS&&(typeof I.ADD_TAGS=="function"?Ye.tagCheck=I.ADD_TAGS:(se===ge&&(se=Es(se)),tt(se,I.ADD_TAGS,et))),I.ADD_ATTR&&(typeof I.ADD_ATTR=="function"?Ye.attributeCheck=I.ADD_ATTR:(oe===he&&(oe=Es(oe)),tt(oe,I.ADD_ATTR,et))),I.ADD_URI_SAFE_ATTR&&tt(gn,I.ADD_URI_SAFE_ATTR,et),I.FORBID_CONTENTS&&(Ue===gt&&(Ue=Es(Ue)),tt(Ue,I.FORBID_CONTENTS,et)),I.ADD_FORBID_CONTENTS&&(Ue===gt&&(Ue=Es(Ue)),tt(Ue,I.ADD_FORBID_CONTENTS,et)),Zt&&(se["#text"]=!0),ut&&tt(se,["html","head","body"]),se.table&&(tt(se,["tbody"]),delete Ce.tbody),I.TRUSTED_TYPES_POLICY){if(typeof I.TRUSTED_TYPES_POLICY.createHTML!="function")throw nd('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof I.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw nd('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=I.TRUSTED_TYPES_POLICY,P=E.createHTML("")}else E===void 0&&(E=LK(O,i)),E!==null&&typeof P=="string"&&(P=E.createHTML(""));Qr&&Qr(I),Nt=I}},Ve=tt({},[...Fv,...Hv,...TK]),re=tt({},[...Kv,...QK]),ue=function(I){let ce=R(I);(!ce||!ce.tagName)&&(ce={namespaceURI:Xt,tagName:"template"});const be=hm(I.tagName),Et=hm(ce.tagName);return _r[I.namespaceURI]?I.namespaceURI===tn?ce.namespaceURI===Dt?be==="svg":ce.namespaceURI===Hn?be==="svg"&&(Et==="annotation-xml"||ar[Et]):!!Ve[be]:I.namespaceURI===Hn?ce.namespaceURI===Dt?be==="math":ce.namespaceURI===tn?be==="math"&&mr[Et]:!!re[be]:I.namespaceURI===Dt?ce.namespaceURI===tn&&!mr[Et]||ce.namespaceURI===Hn&&!ar[Et]?!1:!re[be]&&(Bt[be]||!Ve[be]):!!(ht==="application/xhtml+xml"&&_r[I.namespaceURI]):!1},Oe=function(I){ed(e.removed,{element:I});try{R(I).removeChild(I)}catch{k(I)}},Ae=function(I,ce){try{ed(e.removed,{attribute:ce.getAttributeNode(I),from:ce})}catch{ed(e.removed,{attribute:null,from:ce})}if(ce.removeAttribute(I),I==="is")if(Ht||Ge)try{Oe(ce)}catch{}else try{ce.setAttribute(I,"")}catch{}},vt=function(I){let ce=null,be=null;if(on)I="<remove></remove>"+I;else{const Ke=Wv(I,/^[\r\n\t ]+/);be=Ke&&Ke[0]}ht==="application/xhtml+xml"&&Xt===Dt&&(I='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+I+"</body></html>");const Et=E?E.createHTML(I):I;if(Xt===Dt)try{ce=new m().parseFromString(Et,ht)}catch{}if(!ce||!ce.documentElement){ce=$.createDocument(Xt,"template",null);try{ce.documentElement.innerHTML=bi?P:Et}catch{}}const an=ce.body||ce.documentElement;return I&&be&&an.insertBefore(n.createTextNode(be),an.childNodes[0]||null),Xt===Dt?B.call(ce,ut?"html":"body")[0]:ut?ce.documentElement:an},cn=function(I){return _.call(I.ownerDocument||I,I,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},xt=function(I){return I instanceof g&&(typeof I.nodeName!="string"||typeof I.textContent!="string"||typeof I.removeChild!="function"||!(I.attributes instanceof h)||typeof I.removeAttribute!="function"||typeof I.setAttribute!="function"||typeof I.namespaceURI!="string"||typeof I.insertBefore!="function"||typeof I.hasChildNodes!="function")},ft=function(I){return typeof l=="function"&&I instanceof l};function mt(ye,I,ce){Ag(ye,be=>{be.call(e,I,ce,Nt)})}const Zn=function(I){let ce=null;if(mt(M.beforeSanitizeElements,I,null),xt(I))return Oe(I),!0;const be=et(I.nodeName);if(mt(M.uponSanitizeElement,I,{tagName:be,allowedTags:se}),lt&&I.hasChildNodes()&&!ft(I.firstElementChild)&&br(/<[/\w!]/g,I.innerHTML)&&br(/<[/\w!]/g,I.textContent)||I.nodeType===id.progressingInstruction||lt&&I.nodeType===id.comment&&br(/<[/\w]/g,I.data))return Oe(I),!0;if(!(Ye.tagCheck instanceof Function&&Ye.tagCheck(be))&&(!se[be]||Ce[be])){if(!Ce[be]&&Kl(be)&&(me.tagNameCheck instanceof RegExp&&br(me.tagNameCheck,be)||me.tagNameCheck instanceof Function&&me.tagNameCheck(be)))return!1;if(Zt&&!Ue[be]){const Et=R(I)||I.parentNode,an=Q(I)||I.childNodes;if(an&&Et){const Ke=an.length;for(let Kn=Ke-1;Kn>=0;--Kn){const xi=x(an[Kn],!0);xi.__removalCount=(I.__removalCount||0)+1,Et.insertBefore(xi,C(I))}}}return Oe(I),!0}return I instanceof u&&!ue(I)||(be==="noscript"||be==="noembed"||be==="noframes")&&br(/<\/no(script|embed|frames)/i,I.innerHTML)?(Oe(I),!0):(Tt&&I.nodeType===id.text&&(ce=I.textContent,Ag([U,Y,H],Et=>{ce=td(ce,Et," ")}),I.textContent!==ce&&(ed(e.removed,{element:I.cloneNode()}),I.textContent=ce)),mt(M.afterSanitizeElements,I,null),!1)},vi=function(I,ce,be){if(jn&&(ce==="id"||ce==="name")&&(be in n||be in mn))return!1;if(!(ze&&!Te[ce]&&br(ee,ce))){if(!(je&&br(N,ce))){if(!(Ye.attributeCheck instanceof Function&&Ye.attributeCheck(ce,I))){if(!oe[ce]||Te[ce]){if(!(Kl(I)&&(me.tagNameCheck instanceof RegExp&&br(me.tagNameCheck,I)||me.tagNameCheck instanceof Function&&me.tagNameCheck(I))&&(me.attributeNameCheck instanceof RegExp&&br(me.attributeNameCheck,ce)||me.attributeNameCheck instanceof Function&&me.attributeNameCheck(ce,I))||ce==="is"&&me.allowCustomizedBuiltInElements&&(me.tagNameCheck instanceof RegExp&&br(me.tagNameCheck,be)||me.tagNameCheck instanceof Function&&me.tagNameCheck(be))))return!1}else if(!gn[ce]){if(!br(fe,td(be,Z,""))){if(!((ce==="src"||ce==="xlink:href"||ce==="href")&&I!=="script"&&SK(be,"data:")===0&&Fn[I])){if(!(Ct&&!br(V,td(be,Z,"")))){if(be)return!1}}}}}}}return!0},Kl=function(I){return I!=="annotation-xml"&&Wv(I,W)},Pn=function(I){mt(M.beforeSanitizeAttributes,I,null);const{attributes:ce}=I;if(!ce||xt(I))return;const be={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe,forceKeepAttr:void 0};let Et=ce.length;for(;Et--;){const an=ce[Et],{name:Ke,namespaceURI:Kn,value:xi}=an,$r=et(Ke),bs=xi;let _n=Ke==="value"?bs:wK(bs);if(be.attrName=$r,be.attrValue=_n,be.keepAttr=!0,be.forceKeepAttr=void 0,mt(M.uponSanitizeAttribute,I,be),_n=be.attrValue,He&&($r==="id"||$r==="name")&&(Ae(Ke,I),_n=Gr+_n),lt&&br(/((--!?|])>)|<\/(style|title|textarea)/i,_n)){Ae(Ke,I);continue}if($r==="attributename"&&Wv(_n,"href")){Ae(Ke,I);continue}if(be.forceKeepAttr)continue;if(!be.keepAttr){Ae(Ke,I);continue}if(!Fe&&br(/\/>/i,_n)){Ae(Ke,I);continue}Tt&&Ag([U,Y,H],tf=>{_n=td(_n,tf," ")});const ef=et(I.nodeName);if(!vi(ef,$r,_n)){Ae(Ke,I);continue}if(E&&typeof O=="object"&&typeof O.getAttributeType=="function"&&!Kn)switch(O.getAttributeType(ef,$r)){case"TrustedHTML":{_n=E.createHTML(_n);break}case"TrustedScriptURL":{_n=E.createScriptURL(_n);break}}if(_n!==bs)try{Kn?I.setAttributeNS(Kn,Ke,_n):I.setAttribute(Ke,_n),xt(I)?Oe(I):eP(e.removed)}catch{Ae(Ke,I)}}mt(M.afterSanitizeAttributes,I,null)},Or=function ye(I){let ce=null;const be=cn(I);for(mt(M.beforeSanitizeShadowDOM,I,null);ce=be.nextNode();)mt(M.uponSanitizeShadowNode,ce,null),Zn(ce),Pn(ce),ce.content instanceof s&&ye(ce.content);mt(M.afterSanitizeShadowDOM,I,null)};return e.sanitize=function(ye){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ce=null,be=null,Et=null,an=null;if(bi=!ye,bi&&(ye="<!-->"),typeof ye!="string"&&!ft(ye))if(typeof ye.toString=="function"){if(ye=ye.toString(),typeof ye!="string")throw nd("dirty is not a string, aborting")}else throw nd("toString is not a function");if(!e.isSupported)return ye;if(Qt||ve(I),e.removed=[],typeof ye=="string"&&(In=!1),In){if(ye.nodeName){const xi=et(ye.nodeName);if(!se[xi]||Ce[xi])throw nd("root node is forbidden and cannot be sanitized in-place")}}else if(ye instanceof l)ce=vt("<!---->"),be=ce.ownerDocument.importNode(ye,!0),be.nodeType===id.element&&be.nodeName==="BODY"||be.nodeName==="HTML"?ce=be:ce.appendChild(be);else{if(!Ht&&!Tt&&!ut&&ye.indexOf("<")===-1)return E&&It?E.createHTML(ye):ye;if(ce=vt(ye),!ce)return Ht?null:It?P:""}ce&&on&&Oe(ce.firstChild);const Ke=cn(In?ye:ce);for(;Et=Ke.nextNode();)Zn(Et),Pn(Et),Et.content instanceof s&&Or(Et.content);if(In)return ye;if(Ht){if(Ge)for(an=D.call(ce.ownerDocument);ce.firstChild;)an.appendChild(ce.firstChild);else an=ce;return(oe.shadowroot||oe.shadowrootmode)&&(an=L.call(r,an,!0)),an}let Kn=ut?ce.outerHTML:ce.innerHTML;return ut&&se["!doctype"]&&ce.ownerDocument&&ce.ownerDocument.doctype&&ce.ownerDocument.doctype.name&&br(AL,ce.ownerDocument.doctype.name)&&(Kn="<!DOCTYPE "+ce.ownerDocument.doctype.name+`>
230
+ `+Kn),Tt&&Ag([U,Y,H],xi=>{Kn=td(Kn,xi," ")}),E&&It?E.createHTML(Kn):Kn},e.setConfig=function(){let ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ve(ye),Qt=!0},e.clearConfig=function(){Nt=null,Qt=!1},e.isValidAttribute=function(ye,I,ce){Nt||ve({});const be=et(ye),Et=et(I);return vi(be,Et,ce)},e.addHook=function(ye,I){typeof I=="function"&&ed(M[ye],I)},e.removeHook=function(ye,I){if(I!==void 0){const ce=vK(M[ye],I);return ce===-1?void 0:xK(M[ye],ce,1)[0]}return eP(M[ye])},e.removeHooks=function(ye){M[ye]=[]},e.removeAllHooks=function(){M=oP()},e}var _L=PL();function z1(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Wl=z1();function $L(t){Wl=t}var Ad={exec:()=>null};function bt(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Cr.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,e)};return r}var zK=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Cr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},jK=/^(?:[ \t]*(?:\n|$))+/,IK=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ZK=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Nh=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,XK=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,j1=/(?:[*+-]|\d{1,9}[.)])/,ML=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,DL=bt(ML).replace(/bull/g,j1).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),BK=bt(ML).replace(/bull/g,j1).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),I1=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,UK=/^[^\n]+/,Z1=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,VK=bt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Z1).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),qK=bt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,j1).getRegex(),xy="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",X1=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,YK=bt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",X1).replace("tag",xy).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),NL=bt(I1).replace("hr",Nh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xy).getRegex(),GK=bt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",NL).getRegex(),B1={blockquote:GK,code:IK,def:VK,fences:ZK,heading:XK,hr:Nh,html:YK,lheading:DL,list:qK,newline:jK,paragraph:NL,table:Ad,text:UK},aP=bt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Nh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xy).getRegex(),WK={...B1,lheading:BK,table:aP,paragraph:bt(I1).replace("hr",Nh).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",aP).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xy).getRegex()},FK={...B1,html:bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",X1).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ad,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:bt(I1).replace("hr",Nh).replace("heading",` *#{1,6} *[^
231
+ ]`).replace("lheading",DL).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},HK=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,KK=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,LL=/^( {2,}|\\)\n(?!\s*$)/,JK=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Sy=/[\p{P}\p{S}]/u,U1=/[\s\p{P}\p{S}]/u,zL=/[^\s\p{P}\p{S}]/u,eJ=bt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,U1).getRegex(),jL=/(?!~)[\p{P}\p{S}]/u,tJ=/(?!~)[\s\p{P}\p{S}]/u,nJ=/(?:[^\s\p{P}\p{S}]|~)/u,rJ=bt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",zK?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),IL=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,iJ=bt(IL,"u").replace(/punct/g,Sy).getRegex(),sJ=bt(IL,"u").replace(/punct/g,jL).getRegex(),ZL="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",oJ=bt(ZL,"gu").replace(/notPunctSpace/g,zL).replace(/punctSpace/g,U1).replace(/punct/g,Sy).getRegex(),aJ=bt(ZL,"gu").replace(/notPunctSpace/g,nJ).replace(/punctSpace/g,tJ).replace(/punct/g,jL).getRegex(),lJ=bt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,zL).replace(/punctSpace/g,U1).replace(/punct/g,Sy).getRegex(),cJ=bt(/\\(punct)/,"gu").replace(/punct/g,Sy).getRegex(),uJ=bt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),fJ=bt(X1).replace("(?:-->|$)","-->").getRegex(),dJ=bt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",fJ).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Hm=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,hJ=bt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Hm).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),XL=bt(/^!?\[(label)\]\[(ref)\]/).replace("label",Hm).replace("ref",Z1).getRegex(),BL=bt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Z1).getRegex(),pJ=bt("reflink|nolink(?!\\()","g").replace("reflink",XL).replace("nolink",BL).getRegex(),lP=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,V1={_backpedal:Ad,anyPunctuation:cJ,autolink:uJ,blockSkip:rJ,br:LL,code:KK,del:Ad,emStrongLDelim:iJ,emStrongRDelimAst:oJ,emStrongRDelimUnd:lJ,escape:HK,link:hJ,nolink:BL,punctuation:eJ,reflink:XL,reflinkSearch:pJ,tag:dJ,text:JK,url:Ad},gJ={...V1,link:bt(/^!?\[(label)\]\((.*?)\)/).replace("label",Hm).getRegex(),reflink:bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Hm).getRegex()},bS={...V1,emStrongRDelimAst:aJ,emStrongLDelim:sJ,url:bt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",lP).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:bt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",lP).getRegex()},mJ={...bS,br:bt(LL).replace("{2,}","*").getRegex(),text:bt(bS.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},_g={normal:B1,gfm:WK,pedantic:FK},sd={normal:V1,gfm:bS,breaks:mJ,pedantic:gJ},OJ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},cP=t=>OJ[t];function So(t,e){if(e){if(Cr.escapeTest.test(t))return t.replace(Cr.escapeReplace,cP)}else if(Cr.escapeTestNoEncode.test(t))return t.replace(Cr.escapeReplaceNoEncode,cP);return t}function uP(t){try{t=encodeURI(t).replace(Cr.percentDecode,"%")}catch{return null}return t}function fP(t,e){var s;let n=t.replace(Cr.findPipe,(a,l,u)=>{let d=!1,h=l;for(;--h>=0&&u[h]==="\\";)d=!d;return d?"|":" |"}),r=n.split(Cr.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Cr.slashPipe,"|");return r}function od(t,e,n){let r=t.length;if(r===0)return"";let i=0;for(;i<r&&t.charAt(r-i-1)===e;)i++;return t.slice(0,r-i)}function yJ(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function dP(t,e,n,r,i){let s=e.href,a=e.title||null,l=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let u={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,u}function bJ(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let i=r[1];return e.split(`
232
+ `).map(s=>{let a=s.match(n.other.beginningSpace);if(a===null)return s;let[l]=a;return l.length>=i.length?s.slice(i.length):s}).join(`
233
+ `)}var Km=class{constructor(t){We(this,"options");We(this,"rules");We(this,"lexer");this.options=t||Wl}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:od(n,`
234
+ `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=bJ(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=od(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:od(e[0],`
235
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=od(e[0],`
236
+ `).split(`
237
+ `),r="",i="",s=[];for(;n.length>0;){let a=!1,l=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))l.push(n[u]),a=!0;else if(!a)l.push(n[u]);else break;n=n.slice(u);let d=l.join(`
238
+ `),h=d.replace(this.rules.other.blockquoteSetextReplace,`
239
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
240
+ ${d}`:d,i=i?`${i}
241
+ ${h}`:h;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,s,!0),this.lexer.state.top=g,n.length===0)break;let m=s.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){let O=m,v=O.raw+`
242
+ `+n.join(`
243
+ `),x=this.blockquote(v);s[s.length-1]=x,r=r.substring(0,r.length-O.raw.length)+x.raw,i=i.substring(0,i.length-O.text.length)+x.text;break}else if((m==null?void 0:m.type)==="list"){let O=m,v=O.raw+`
244
+ `+n.join(`
245
+ `),x=this.list(v);s[s.length-1]=x,r=r.substring(0,r.length-m.raw.length)+x.raw,i=i.substring(0,i.length-O.raw.length)+x.raw,n=v.substring(s.at(-1).raw.length).split(`
246
+ `);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(t){var n,r;let e=this.rules.block.list.exec(t);if(e){let i=e[1].trim(),s=i.length>1,a={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let l=this.rules.other.listItemRegex(i),u=!1;for(;t;){let h=!1,g="",m="";if(!(e=l.exec(t))||this.rules.block.hr.test(t))break;g=e[0],t=t.substring(g.length);let O=e[2].split(`
247
+ `,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),v=t.split(`
248
+ `,1)[0],x=!O.trim(),k=0;if(this.options.pedantic?(k=2,m=O.trimStart()):x?k=e[1].length+1:(k=e[2].search(this.rules.other.nonSpaceChar),k=k>4?1:k,m=O.slice(k),k+=e[1].length),x&&this.rules.other.blankLine.test(v)&&(g+=v+`
249
+ `,t=t.substring(v.length+1),h=!0),!h){let C=this.rules.other.nextBulletRegex(k),Q=this.rules.other.hrRegex(k),R=this.rules.other.fencesBeginRegex(k),E=this.rules.other.headingBeginRegex(k),P=this.rules.other.htmlBeginRegex(k);for(;t;){let $=t.split(`
250
+ `,1)[0],_;if(v=$,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),_=v):_=v.replace(this.rules.other.tabCharGlobal," "),R.test(v)||E.test(v)||P.test(v)||C.test(v)||Q.test(v))break;if(_.search(this.rules.other.nonSpaceChar)>=k||!v.trim())m+=`
251
+ `+_.slice(k);else{if(x||O.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||R.test(O)||E.test(O)||Q.test(O))break;m+=`
252
+ `+v}!x&&!v.trim()&&(x=!0),g+=$+`
253
+ `,t=t.substring($.length+1),O=_.slice(k)}}a.loose||(u?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(u=!0)),a.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(m),loose:!1,text:m,tokens:[]}),a.raw+=g}let d=a.items.at(-1);if(d)d.raw=d.raw.trimEnd(),d.text=d.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let h of a.items){if(this.lexer.state.top=!1,h.tokens=this.lexer.blockTokens(h.text,[]),h.task){if(h.text=h.text.replace(this.rules.other.listReplaceTask,""),((n=h.tokens[0])==null?void 0:n.type)==="text"||((r=h.tokens[0])==null?void 0:r.type)==="paragraph"){h.tokens[0].raw=h.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),h.tokens[0].text=h.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}}let g=this.rules.other.listTaskCheckbox.exec(h.raw);if(g){let m={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};h.checked=m.checked,a.loose?h.tokens[0]&&["paragraph","text"].includes(h.tokens[0].type)&&"tokens"in h.tokens[0]&&h.tokens[0].tokens?(h.tokens[0].raw=m.raw+h.tokens[0].raw,h.tokens[0].text=m.raw+h.tokens[0].text,h.tokens[0].tokens.unshift(m)):h.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):h.tokens.unshift(m)}}if(!a.loose){let g=h.tokens.filter(O=>O.type==="space"),m=g.length>0&&g.some(O=>this.rules.other.anyLine.test(O.raw));a.loose=m}}if(a.loose)for(let h of a.items){h.loose=!0;for(let g of h.tokens)g.type==="text"&&(g.type="paragraph")}return a}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:i}}}table(t){var a;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=fP(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(a=e[3])!=null&&a.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
254
+ `):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<n.length;l++)s.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:s.align[l]});for(let l of i)s.rows.push(fP(l,s.header.length).map((u,d)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:s.align[d]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
255
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=od(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=yJ(e[2],"()");if(s===-2)return;if(s>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),dP(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return dP(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,a,l=i,u=0,d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(r=d.exec(e))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(a=[...s].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){u+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+u);let h=[...r[0]][0].length,g=t.slice(0,i+r.index+h+a);if(Math.min(i,a)%2){let O=g.slice(1,-1);return{type:"em",raw:g,text:O,tokens:this.lexer.inlineTokens(O)}}let m=g.slice(2,-2);return{type:"strong",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let e;if(e=this.rules.inline.url.exec(t)){let r,i;if(e[2]==="@")r=e[0],i="mailto:"+r;else{let s;do s=e[0],e[0]=((n=this.rules.inline._backpedal.exec(e[0]))==null?void 0:n[0])??"";while(s!==e[0]);r=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},ns=class vS{constructor(e){We(this,"tokens");We(this,"options");We(this,"state");We(this,"inlineQueue");We(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Wl,this.options.tokenizer=this.options.tokenizer||new Km,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Cr,block:_g.normal,inline:sd.normal};this.options.pedantic?(n.block=_g.pedantic,n.inline=sd.pedantic):this.options.gfm&&(n.block=_g.gfm,this.options.breaks?n.inline=sd.breaks:n.inline=sd.gfm),this.tokenizer.rules=n}static get rules(){return{block:_g,inline:sd}}static lex(e,n){return new vS(n).lex(e)}static lexInline(e,n){return new vS(n).inlineTokens(e)}lex(e){e=e.replace(Cr.carriageReturn,`
256
+ `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){var i,s,a;for(this.options.pedantic&&(e=e.replace(Cr.tabCharGlobal," ").replace(Cr.spaceLine,""));e;){let l;if((s=(i=this.options.extensions)==null?void 0:i.block)!=null&&s.some(d=>(l=d.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);let d=n.at(-1);l.raw.length===1&&d!==void 0?d.raw+=`
257
+ `:n.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);let d=n.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
258
+ `)?"":`
259
+ `)+l.raw,d.text+=`
260
+ `+l.text,this.inlineQueue.at(-1).src=d.text):n.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);let d=n.at(-1);(d==null?void 0:d.type)==="paragraph"||(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
261
+ `)?"":`
262
+ `)+l.raw,d.text+=`
263
+ `+l.raw,this.inlineQueue.at(-1).src=d.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},n.push(l));continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),n.push(l);continue}let u=e;if((a=this.options.extensions)!=null&&a.startBlock){let d=1/0,h=e.slice(1),g;this.options.extensions.startBlock.forEach(m=>{g=m.call({lexer:this},h),typeof g=="number"&&g>=0&&(d=Math.min(d,g))}),d<1/0&&d>=0&&(u=e.substring(0,d+1))}if(this.state.top&&(l=this.tokenizer.paragraph(u))){let d=n.at(-1);r&&(d==null?void 0:d.type)==="paragraph"?(d.raw+=(d.raw.endsWith(`
264
+ `)?"":`
265
+ `)+l.raw,d.text+=`
266
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):n.push(l),r=u.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);let d=n.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=(d.raw.endsWith(`
267
+ `)?"":`
268
+ `)+l.raw,d.text+=`
269
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=d.text):n.push(l);continue}if(e){let d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var u,d,h,g,m;let r=e,i=null;if(this.tokens.links){let O=Object.keys(this.tokens.links);if(O.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)O.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)s=i[2]?i[2].length:0,r=r.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((d=(u=this.options.hooks)==null?void 0:u.emStrongMask)==null?void 0:d.call({lexer:this},r))??r;let a=!1,l="";for(;e;){a||(l=""),a=!1;let O;if((g=(h=this.options.extensions)==null?void 0:h.inline)!=null&&g.some(x=>(O=x.call({lexer:this},e,n))?(e=e.substring(O.raw.length),n.push(O),!0):!1))continue;if(O=this.tokenizer.escape(e)){e=e.substring(O.raw.length),n.push(O);continue}if(O=this.tokenizer.tag(e)){e=e.substring(O.raw.length),n.push(O);continue}if(O=this.tokenizer.link(e)){e=e.substring(O.raw.length),n.push(O);continue}if(O=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(O.raw.length);let x=n.at(-1);O.type==="text"&&(x==null?void 0:x.type)==="text"?(x.raw+=O.raw,x.text+=O.text):n.push(O);continue}if(O=this.tokenizer.emStrong(e,r,l)){e=e.substring(O.raw.length),n.push(O);continue}if(O=this.tokenizer.codespan(e)){e=e.substring(O.raw.length),n.push(O);continue}if(O=this.tokenizer.br(e)){e=e.substring(O.raw.length),n.push(O);continue}if(O=this.tokenizer.del(e)){e=e.substring(O.raw.length),n.push(O);continue}if(O=this.tokenizer.autolink(e)){e=e.substring(O.raw.length),n.push(O);continue}if(!this.state.inLink&&(O=this.tokenizer.url(e))){e=e.substring(O.raw.length),n.push(O);continue}let v=e;if((m=this.options.extensions)!=null&&m.startInline){let x=1/0,k=e.slice(1),C;this.options.extensions.startInline.forEach(Q=>{C=Q.call({lexer:this},k),typeof C=="number"&&C>=0&&(x=Math.min(x,C))}),x<1/0&&x>=0&&(v=e.substring(0,x+1))}if(O=this.tokenizer.inlineText(v)){e=e.substring(O.raw.length),O.raw.slice(-1)!=="_"&&(l=O.raw.slice(-1)),a=!0;let x=n.at(-1);(x==null?void 0:x.type)==="text"?(x.raw+=O.raw,x.text+=O.text):n.push(O);continue}if(e){let x="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return n}},Jm=class{constructor(t){We(this,"options");We(this,"parser");this.options=t||Wl}space(t){return""}code({text:t,lang:e,escaped:n}){var s;let r=(s=(e||"").match(Cr.notSpaceStart))==null?void 0:s[0],i=t.replace(Cr.endingNewline,"")+`
270
+ `;return r?'<pre><code class="language-'+So(r)+'">'+(n?i:So(i,!0))+`</code></pre>
271
+ `:"<pre><code>"+(n?i:So(i,!0))+`</code></pre>
272
+ `}blockquote({tokens:t}){return`<blockquote>
273
+ ${this.parser.parse(t)}</blockquote>
274
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
275
+ `}hr(t){return`<hr>
276
+ `}list(t){let e=t.ordered,n=t.start,r="";for(let a=0;a<t.items.length;a++){let l=t.items[a];r+=this.listitem(l)}let i=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
277
+ `+r+"</"+i+`>
278
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
279
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
280
+ `}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){let s=t.rows[i];n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
281
+ <thead>
282
+ `+e+`</thead>
283
+ `+r+`</table>
284
+ `}tablerow({text:t}){return`<tr>
285
+ ${t}</tr>
286
+ `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
287
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${So(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),i=uP(t);if(i===null)return r;t=i;let s='<a href="'+t+'"';return e&&(s+=' title="'+So(e)+'"'),s+=">"+r+"</a>",s}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=uP(t);if(i===null)return So(n);t=i;let s=`<img src="${t}" alt="${n}"`;return e&&(s+=` title="${So(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:So(t.text)}},q1=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},rs=class xS{constructor(e){We(this,"options");We(this,"renderer");We(this,"textRenderer");this.options=e||Wl,this.options.renderer=this.options.renderer||new Jm,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new q1}static parse(e,n){return new xS(n).parse(e)}static parseInline(e,n){return new xS(n).parseInline(e)}parse(e){var r,i;let n="";for(let s=0;s<e.length;s++){let a=e[s];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){let u=a,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){n+=d||"";continue}}let l=a;switch(l.type){case"space":{n+=this.renderer.space(l);break}case"hr":{n+=this.renderer.hr(l);break}case"heading":{n+=this.renderer.heading(l);break}case"code":{n+=this.renderer.code(l);break}case"table":{n+=this.renderer.table(l);break}case"blockquote":{n+=this.renderer.blockquote(l);break}case"list":{n+=this.renderer.list(l);break}case"checkbox":{n+=this.renderer.checkbox(l);break}case"html":{n+=this.renderer.html(l);break}case"def":{n+=this.renderer.def(l);break}case"paragraph":{n+=this.renderer.paragraph(l);break}case"text":{n+=this.renderer.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}parseInline(e,n=this.renderer){var i,s;let r="";for(let a=0;a<e.length;a++){let l=e[a];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[l.type]){let d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=d||"";continue}}let u=l;switch(u.type){case"escape":{r+=n.text(u);break}case"html":{r+=n.html(u);break}case"link":{r+=n.link(u);break}case"image":{r+=n.image(u);break}case"checkbox":{r+=n.checkbox(u);break}case"strong":{r+=n.strong(u);break}case"em":{r+=n.em(u);break}case"codespan":{r+=n.codespan(u);break}case"br":{r+=n.br(u);break}case"del":{r+=n.del(u);break}case"text":{r+=n.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return r}},tm,yd=(tm=class{constructor(e){We(this,"options");We(this,"block");this.options=e||Wl}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?ns.lex:ns.lexInline}provideParser(){return this.block?rs.parse:rs.parseInline}},We(tm,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),We(tm,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),tm),vJ=class{constructor(...t){We(this,"defaults",z1());We(this,"options",this.setOptions);We(this,"parse",this.parseMarkdown(!0));We(this,"parseInline",this.parseMarkdown(!1));We(this,"Parser",rs);We(this,"Renderer",Jm);We(this,"TextRenderer",q1);We(this,"Lexer",ns);We(this,"Tokenizer",Km);We(this,"Hooks",yd);this.use(...t)}walkTokens(t,e){var r,i;let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let a=s;for(let l of a.header)n=n.concat(this.walkTokens(l.tokens,e));for(let l of a.rows)for(let u of l)n=n.concat(this.walkTokens(u.tokens,e));break}case"list":{let a=s;n=n.concat(this.walkTokens(a.items,e));break}default:{let a=s;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let u=a[l].flat(1/0);n=n.concat(this.walkTokens(u,e))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=e.renderers[i.name];s?e.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[i.level];s?s.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),n.renderer){let i=this.defaults.renderer||new Jm(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,l=n.renderer[a],u=i[a];i[a]=(...d)=>{let h=l.apply(i,d);return h===!1&&(h=u.apply(i,d)),h||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Km(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,l=n.tokenizer[a],u=i[a];i[a]=(...d)=>{let h=l.apply(i,d);return h===!1&&(h=u.apply(i,d)),h}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new yd;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,l=n.hooks[a],u=i[a];yd.passThroughHooks.has(s)?i[a]=d=>{if(this.defaults.async&&yd.passThroughHooksRespectAsync.has(s))return(async()=>{let g=await l.call(i,d);return u.call(i,g)})();let h=l.call(i,d);return u.call(i,h)}:i[a]=(...d)=>{if(this.defaults.async)return(async()=>{let g=await l.apply(i,d);return g===!1&&(g=await u.apply(i,d)),g})();let h=l.apply(i,d);return h===!1&&(h=u.apply(i,d)),h}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return ns.lex(t,e??this.defaults)}parser(t,e){return rs.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let a=i.hooks?await i.hooks.preprocess(e):e,l=await(i.hooks?await i.hooks.provideLexer():t?ns.lex:ns.lexInline)(a,i),u=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(u,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser():t?rs.parse:rs.parseInline)(u,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(s);try{i.hooks&&(e=i.hooks.preprocess(e));let a=(i.hooks?i.hooks.provideLexer():t?ns.lex:ns.lexInline)(e,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let l=(i.hooks?i.hooks.provideParser():t?rs.parse:rs.parseInline)(a,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(a){return s(a)}}}onError(t,e){return n=>{if(n.message+=`
288
+ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+So(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},jl=new vJ;function Pt(t,e){return jl.parse(t,e)}Pt.options=Pt.setOptions=function(t){return jl.setOptions(t),Pt.defaults=jl.defaults,$L(Pt.defaults),Pt};Pt.getDefaults=z1;Pt.defaults=Wl;Pt.use=function(...t){return jl.use(...t),Pt.defaults=jl.defaults,$L(Pt.defaults),Pt};Pt.walkTokens=function(t,e){return jl.walkTokens(t,e)};Pt.parseInline=jl.parseInline;Pt.Parser=rs;Pt.parser=rs.parse;Pt.Renderer=Jm;Pt.TextRenderer=q1;Pt.Lexer=ns;Pt.lexer=ns.lex;Pt.Tokenizer=Km;Pt.Hooks=yd;Pt.parse=Pt;Pt.options;Pt.setOptions;Pt.use;Pt.walkTokens;Pt.parseInline;rs.parse;ns.lex;let SS=[],UL=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?UL:SS).push(n=n+t[e])})();function xJ(t){if(t<768)return!1;for(let e=0,n=SS.length;;){let r=e+n>>1;if(t<SS[r])n=r;else if(t>=UL[r])e=r+1;else return!0;if(e==n)return!1}}function hP(t){return t>=127462&&t<=127487}const pP=8205;function SJ(t,e,n=!0,r=!0){return(n?VL:wJ)(t,e,r)}function VL(t,e,n){if(e==t.length)return e;e&&qL(t.charCodeAt(e))&&YL(t.charCodeAt(e-1))&&e--;let r=ex(t,e);for(e+=gP(r);e<t.length;){let i=ex(t,e);if(r==pP||i==pP||n&&xJ(i))e+=gP(i),r=i;else if(hP(i)){let s=0,a=e-2;for(;a>=0&&hP(ex(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function wJ(t,e,n){for(;e>0;){let r=VL(t,e-2,n);if(r<e)return r;e--}return 0}function ex(t,e){let n=t.charCodeAt(e);if(!YL(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return qL(r)?(n-55296<<10)+(r-56320)+65536:n}function qL(t){return t>=56320&&t<57344}function YL(t){return t>=55296&&t<56320}function gP(t){return t<65536?1:2}class pt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=bu(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Ns.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=bu(this,e,n);let r=[];return this.decompose(e,n,r,0),Ns.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new Pd(this),s=new Pd(e);for(let a=n,l=n;;){if(i.next(a),s.next(a),a=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(l+=i.value.length,i.done||l>=r)return!0}}iter(e=1){return new Pd(this,e)}iterRange(e,n=this.length){return new GL(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new WL(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?pt.empty:e.length<=32?new vn(e):Ns.from(vn.split(e,[]))}}class vn extends pt{constructor(e,n=kJ(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let a=this.text[s],l=i+a.length;if((n?r:l)>=e)return new CJ(i,l,r,a);i=l+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new vn(mP(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),l=pm(s.text,a.text.slice(),0,s.length);if(l.length<=32)r.push(new vn(l,a.length+s.length));else{let u=l.length>>1;r.push(new vn(l.slice(0,u)),new vn(l.slice(u)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof vn))return super.replace(e,n,r);[e,n]=bu(this,e,n);let i=pm(this.text,pm(r.text,mP(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new vn(i,s):Ns.from(vn.split(i,[]),s)}sliceString(e,n=this.length,r=`
289
+ `){[e,n]=bu(this,e,n);let i="";for(let s=0,a=0;s<=n&&a<this.text.length;a++){let l=this.text[a],u=s+l.length;s>e&&a&&(i+=r),e<u&&n>s&&(i+=l.slice(Math.max(0,e-s),n-s)),s=u+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new vn(r,i)),r=[],i=-1);return i>-1&&n.push(new vn(r,i)),n}}class Ns extends pt{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let a=this.children[s],l=i+a.length,u=r+a.lines-1;if((n?u:l)>=e)return a.lineInner(e,n,r,i);i=l+1,r=u+1}}decompose(e,n,r,i){for(let s=0,a=0;a<=n&&s<this.children.length;s++){let l=this.children[s],u=a+l.length;if(e<=u&&n>=a){let d=i&((a<=e?1:0)|(u>=n?2:0));a>=e&&u<=n&&!d?r.push(l):l.decompose(e-a,n-a,r,d)}a=u+1}}replace(e,n,r){if([e,n]=bu(this,e,n),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let a=this.children[i],l=s+a.length;if(e>=s&&n<=l){let u=a.replace(e-s,n-s,r),d=this.lines-a.lines+u.lines;if(u.lines<d>>4&&u.lines>d>>6){let h=this.children.slice();return h[i]=u,new Ns(h,this.length-(n-e)+r.length)}return super.replace(s,l,u)}s=l+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
290
+ `){[e,n]=bu(this,e,n);let i="";for(let s=0,a=0;s<this.children.length&&a<=n;s++){let l=this.children[s],u=a+l.length;a>e&&s&&(i+=r),e<u&&n>a&&(i+=l.sliceString(e-a,n-a,r)),a=u+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Ns))return 0;let r=0,[i,s,a,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==a||s==l)return r;let u=this.children[i],d=e.children[s];if(u!=d)return r+u.scanIdentical(d,n);r+=u.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let O of e)r+=O.lines;if(r<32){let O=[];for(let v of e)v.flatten(O);return new vn(O,n)}let i=Math.max(32,r>>5),s=i<<1,a=i>>1,l=[],u=0,d=-1,h=[];function g(O){let v;if(O.lines>s&&O instanceof Ns)for(let x of O.children)g(x);else O.lines>a&&(u>a||!u)?(m(),l.push(O)):O instanceof vn&&u&&(v=h[h.length-1])instanceof vn&&O.lines+v.lines<=32?(u+=O.lines,d+=O.length+1,h[h.length-1]=new vn(v.text.concat(O.text),v.length+1+O.length)):(u+O.lines>i&&m(),u+=O.lines,d+=O.length+1,h.push(O))}function m(){u!=0&&(l.push(h.length==1?h[0]:Ns.from(h,d)),d=-1,u=h.length=0)}for(let O of e)g(O);return m(),l.length==1?l[0]:new Ns(l,n)}}pt.empty=new vn([""],0);function kJ(t){let e=-1;for(let n of t)e+=n.length+1;return e}function pm(t,e,n=0,r=1e9){for(let i=0,s=0,a=!0;s<t.length&&i<=r;s++){let l=t[s],u=i+l.length;u>=n&&(u>r&&(l=l.slice(0,r-i)),i<n&&(l=l.slice(n-i)),a?(e[e.length-1]+=l,a=!1):e.push(l)),i=u+1}return e}function mP(t,e,n){return pm(t,[""],e,n)}class Pd{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof vn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],a=s>>1,l=i instanceof vn?i.text.length:i.children.length;if(a==(n>0?l:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
291
+ `,this;e--}else if(i instanceof vn){let u=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,u.length>Math.max(0,e))return this.value=e==0?u:n>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=i.children[a+(n<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(n>0?1:(u instanceof vn?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class GL{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Pd(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class WL{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(pt.prototype[Symbol.iterator]=function(){return this.iter()},Pd.prototype[Symbol.iterator]=GL.prototype[Symbol.iterator]=WL.prototype[Symbol.iterator]=function(){return this});let CJ=class{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function bu(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function sr(t,e,n=!0,r=!0){return SJ(t,e,n,r)}function TJ(t){return t>=56320&&t<57344}function QJ(t){return t>=55296&&t<56320}function EJ(t,e){let n=t.charCodeAt(e);if(!QJ(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return TJ(r)?(n-55296<<10)+(r-56320)+65536:n}function RJ(t){return t<65536?1:2}const wS=/\r\n?|\n/;var Sr=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Sr||(Sr={}));class Ao{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let s=this.sections[n++],a=this.sections[n++];a<0?(e(r,i,s),i+=s):i+=a,r+=s}}iterChangedRanges(e,n=!1){kS(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new Ao(e)}composeDesc(e){return this.empty?e:e.empty?this:FL(this,e)}mapDesc(e,n=!1){return e.empty?this:CS(this,e,n)}mapPos(e,n=-1,r=Sr.Simple){let i=0,s=0;for(let a=0;a<this.sections.length;){let l=this.sections[a++],u=this.sections[a++],d=i+l;if(u<0){if(d>e)return s+(e-i);s+=l}else{if(r!=Sr.Simple&&d>=e&&(r==Sr.TrackDel&&i<e&&d>e||r==Sr.TrackBefore&&i<e||r==Sr.TrackAfter&&d>e))return null;if(d>e||d==e&&n<0&&!l)return e==i||n<0?s:s+u;s+=u}i=d}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let s=this.sections[r++],a=this.sections[r++],l=i+s;if(a>=0&&i<=n&&l>=e)return i<e&&l>n?"cover":!0;i=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ao(e)}static create(e){return new Ao(e)}}class qn extends Ao{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return kS(this,(n,r,i,s,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return CS(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i<n.length;i+=2){let a=n[i],l=n[i+1];if(l>=0){n[i]=l,n[i+1]=a;let u=i>>1;for(;r.length<u;)r.push(pt.empty);r.push(a?e.slice(s,s+a):pt.empty)}s+=a}return new qn(n,r)}compose(e){return this.empty?e:e.empty?this:FL(this,e,!0)}map(e,n=!1){return e.empty?this:CS(this,e,n,!0)}iterChanges(e,n=!1){kS(this,e,n)}get desc(){return Ao.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new Hd(this);e:for(let a=0,l=0;;){let u=a==e.length?1e9:e[a++];for(;l<u||l==u&&s.len==0;){if(s.done)break e;let h=Math.min(s.len,u-l);ur(i,h,-1);let g=s.ins==-1?-1:s.off==0?s.ins:0;ur(n,h,g),g>0&&Ea(r,n,s.text),s.forward(h),l+=h}let d=e[a++];for(;l<d;){if(s.done)break e;let h=Math.min(s.len,d-l);ur(n,h,-1),ur(i,h,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(h),l+=h}}return{changes:new qn(n,r),filtered:Ao.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],a=0,l=null;function u(h=!1){if(!h&&!i.length)return;a<n&&ur(i,n-a,-1);let g=new qn(i,s);l=l?l.compose(g.map(l)):g,i=[],s=[],a=0}function d(h){if(Array.isArray(h))for(let g of h)d(g);else if(h instanceof qn){if(h.length!=n)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${n})`);u(),l=l?l.compose(h.map(l)):h}else{let{from:g,to:m=g,insert:O}=h;if(g>m||g<0||m>n)throw new RangeError(`Invalid change range ${g} to ${m} (in doc of length ${n})`);let v=O?typeof O=="string"?pt.of(O.split(r||wS)):O:pt.empty,x=v.length;if(g==m&&x==0)return;g<a&&u(),g>a&&ur(i,g-a,-1),ur(i,m-g,x),Ea(s,i,v),a=m}}return d(e),u(!l),l}static empty(e){return new qn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((a,l)=>l&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length<i;)r.push(pt.empty);r[i]=pt.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new qn(n,r)}static createSet(e,n){return new qn(e,n)}}function ur(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Ea(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(pt.empty);t.push(n)}}function kS(t,e,n){let r=t.inserted;for(let i=0,s=0,a=0;a<t.sections.length;){let l=t.sections[a++],u=t.sections[a++];if(u<0)i+=l,s+=l;else{let d=i,h=s,g=pt.empty;for(;d+=l,h+=u,u&&r&&(g=g.append(r[a-2>>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)l=t.sections[a++],u=t.sections[a++];e(i,d,s,h,g),i=d,s=h}}}function CS(t,e,n,r=!1){let i=[],s=r?[]:null,a=new Hd(t),l=new Hd(e);for(let u=-1;;){if(a.done&&l.len||l.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&l.ins==-1){let d=Math.min(a.len,l.len);ur(i,d,-1),a.forward(d),l.forward(d)}else if(l.ins>=0&&(a.ins<0||u==a.i||a.off==0&&(l.len<a.len||l.len==a.len&&!n))){let d=l.len;for(ur(i,l.ins,-1);d;){let h=Math.min(a.len,d);a.ins>=0&&u<a.i&&a.len<=h&&(ur(i,0,a.ins),s&&Ea(s,i,a.text),u=a.i),a.forward(h),d-=h}l.next()}else if(a.ins>=0){let d=0,h=a.len;for(;h;)if(l.ins==-1){let g=Math.min(h,l.len);d+=g,h-=g,l.forward(g)}else if(l.ins==0&&l.len<h)h-=l.len,l.next();else break;ur(i,d,u<a.i?a.ins:0),s&&u<a.i&&Ea(s,i,a.text),u=a.i,a.forward(a.len-h)}else{if(a.done&&l.done)return s?qn.createSet(i,s):Ao.create(i);throw new Error("Mismatched change set lengths")}}}function FL(t,e,n=!1){let r=[],i=n?[]:null,s=new Hd(t),a=new Hd(e);for(let l=!1;;){if(s.done&&a.done)return i?qn.createSet(r,i):Ao.create(r);if(s.ins==0)ur(r,s.len,0,l),s.next();else if(a.len==0&&!a.done)ur(r,0,a.ins,l),i&&Ea(i,r,a.text),a.next();else{if(s.done||a.done)throw new Error("Mismatched change set lengths");{let u=Math.min(s.len2,a.len),d=r.length;if(s.ins==-1){let h=a.ins==-1?-1:a.off?0:a.ins;ur(r,u,h,l),i&&h&&Ea(i,r,a.text)}else a.ins==-1?(ur(r,s.off?0:s.len,u,l),i&&Ea(i,r,s.textBit(u))):(ur(r,s.off?0:s.len,a.off?0:a.ins,l),i&&!a.off&&Ea(i,r,a.text));l=(s.ins>u||a.ins>=0&&a.len>u)&&(l||r.length>d),s.forward2(u),a.forward(u)}}}}class Hd{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?pt.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?pt.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class wl{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new wl(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return le.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return le.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return le.range(e.anchor,e.head)}static create(e,n,r){return new wl(e,n,r)}}class le{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:le.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new le([this.main],0)}addRange(e,n=!0){return le.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,le.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new le(e.ranges.map(n=>wl.fromJSON(n)),e.main)}static single(e,n=e){return new le([le.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return le.normalized(e.slice(),n);r=s.to}return new le(e,n)}static cursor(e,n=0,r,i){return wl.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i){let s=(r??16777215)<<6|(i==null?7:Math.min(6,i));return n<e?wl.create(n,e,48|s):wl.create(e,n,(n>e?8:0)|s)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],a=e[i-1];if(s.empty?s.from<=a.to:s.from<a.to){let l=a.from,u=Math.max(s.to,a.to);i<=n&&n--,e.splice(--i,2,s.anchor>s.head?le.range(u,l):le.range(l,u))}}return new le(e,n)}}function HL(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Y1=0;class Re{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=Y1++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Re(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:G1),!!e.static,e.enables)}of(e){return new gm([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new gm(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new gm(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function G1(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class gm{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=Y1++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,a=e[s]>>1,l=this.type==2,u=!1,d=!1,h=[];for(let g of this.dependencies)g=="doc"?u=!0:g=="selection"?d=!0:(((n=e[g.id])!==null&&n!==void 0?n:1)&1)==0&&h.push(e[g.id]);return{create(g){return g.values[a]=r(g),1},update(g,m){if(u&&m.docChanged||d&&(m.docChanged||m.selection)||TS(g,h)){let O=r(g);if(l?!OP(O,g.values[a],i):!i(O,g.values[a]))return g.values[a]=O,1}return 0},reconfigure:(g,m)=>{let O,v=m.config.address[s];if(v!=null){let x=tO(m,v);if(this.dependencies.every(k=>k instanceof Re?m.facet(k)===g.facet(k):k instanceof qa?m.field(k,!1)==g.field(k,!1):!0)||(l?OP(O=r(g),x,i):i(O=r(g),x)))return g.values[a]=x,0}else O=r(g);return g.values[a]=O,1}}}}function OP(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function TS(t,e){let n=!1;for(let r of e)_d(t,r)&1&&(n=!0);return n}function AJ(t,e,n){let r=n.map(u=>t[u.id]),i=n.map(u=>u.type),s=r.filter(u=>!(u&1)),a=t[e.id]>>1;function l(u){let d=[];for(let h=0;h<r.length;h++){let g=tO(u,r[h]);if(i[h]==2)for(let m of g)d.push(m);else d.push(g)}return e.combine(d)}return{create(u){for(let d of r)_d(u,d);return u.values[a]=l(u),1},update(u,d){if(!TS(u,s))return 0;let h=l(u);return e.compare(h,u.values[a])?0:(u.values[a]=h,1)},reconfigure(u,d){let h=TS(u,r),g=d.config.facets[e.id],m=d.facet(e);if(g&&!h&&G1(n,g))return u.values[a]=m,0;let O=l(u);return e.compare(O,m)?(u.values[a]=m,0):(u.values[a]=O,1)}}}const $g=Re.define({static:!0});class qa{constructor(e,n,r,i,s){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let n=new qa(Y1++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet($g).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],a=this.updateF(s,i);return this.compareF(s,a)?0:(r.values[n]=a,1)},reconfigure:(r,i)=>{let s=r.facet($g),a=i.facet($g),l;return(l=s.find(u=>u.field==this))&&l!=a.find(u=>u.field==this)?(r.values[n]=l.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,$g.of({field:this,create:e})]}get extension(){return this}}const bl={lowest:4,low:3,default:2,high:1,highest:0};function ad(t){return e=>new KL(e,t)}const Lh={highest:ad(bl.highest),high:ad(bl.high),default:ad(bl.default),low:ad(bl.low),lowest:ad(bl.lowest)};class KL{constructor(e,n){this.inner=e,this.prec=n}}class zh{of(e){return new QS(this,e)}reconfigure(e){return zh.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class QS{constructor(e,n){this.compartment=e,this.inner=n}}class eO{constructor(e,n,r,i,s,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],s=Object.create(null),a=new Map;for(let m of PJ(e,n,a))m instanceof qa?i.push(m):(s[m.facet.id]||(s[m.facet.id]=[])).push(m);let l=Object.create(null),u=[],d=[];for(let m of i)l[m.id]=d.length<<1,d.push(O=>m.slot(O));let h=r==null?void 0:r.config.facets;for(let m in s){let O=s[m],v=O[0].facet,x=h&&h[m]||[];if(O.every(k=>k.type==0))if(l[v.id]=u.length<<1|1,G1(x,O))u.push(r.facet(v));else{let k=v.combine(O.map(C=>C.value));u.push(r&&v.compare(k,r.facet(v))?r.facet(v):k)}else{for(let k of O)k.type==0?(l[k.id]=u.length<<1|1,u.push(k.value)):(l[k.id]=d.length<<1,d.push(C=>k.dynamicSlot(C)));l[v.id]=d.length<<1,d.push(k=>AJ(k,v,O))}}let g=d.map(m=>m(l));return new eO(e,a,g,l,u,s)}}function PJ(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(a,l){let u=i.get(a);if(u!=null){if(u<=l)return;let d=r[u].indexOf(a);d>-1&&r[u].splice(d,1),a instanceof QS&&n.delete(a.compartment)}if(i.set(a,l),Array.isArray(a))for(let d of a)s(d,l);else if(a instanceof QS){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;n.set(a.compartment,d),s(d,l)}else if(a instanceof KL)s(a.inner,a.prec);else if(a instanceof qa)r[l].push(a),a.provides&&s(a.provides,l);else if(a instanceof gm)r[l].push(a),a.facet.extensions&&s(a.facet.extensions,bl.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(d,l)}}return s(t,bl.default),r.reduce((a,l)=>a.concat(l))}function _d(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function tO(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const JL=Re.define(),ES=Re.define({combine:t=>t.some(e=>e),static:!0}),ez=Re.define({combine:t=>t.length?t[0]:void 0,static:!0}),tz=Re.define(),nz=Re.define(),rz=Re.define(),iz=Re.define({combine:t=>t.length?t[0]:!1});class Xo{constructor(e,n){this.type=e,this.value=n}static define(){return new _J}}class _J{of(e){return new Xo(this,e)}}class $J{constructor(e){this.map=e}of(e){return new hn(this,e)}}class hn{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new hn(this.type,n)}is(e){return this.type==e}static define(e={}){return new $J(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}hn.reconfigure=hn.define();hn.appendConfig=hn.define();let Bi=class bd{constructor(e,n,r,i,s,a){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,r&&HL(r,n.newLength),s.some(l=>l.type==bd.time)||(this.annotations=s.concat(bd.time.of(Date.now())))}static create(e,n,r,i,s,a){return new bd(e,n,r,i,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(bd.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}};Bi.time=Xo.define();Bi.userEvent=Xo.define();Bi.addToHistory=Xo.define();Bi.remote=Xo.define();function MJ(t,e){let n=[];for(let r=0,i=0;;){let s,a;if(r<t.length&&(i==e.length||e[i]>=t[r]))s=t[r++],a=t[r++];else if(i<e.length)s=e[i++],a=e[i++];else return n;!n.length||n[n.length-1]<s?n.push(s,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function sz(t,e,n){var r;let i,s,a;return n?(i=e.changes,s=qn.empty(e.changes.length),a=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(i)),{changes:a,selection:e.selection?e.selection.map(s):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:hn.mapEffects(t.effects,i).concat(hn.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function RS(t,e,n){let r=e.selection,i=nu(e.annotations);return e.userEvent&&(i=i.concat(Bi.userEvent.of(e.userEvent))),{changes:e.changes instanceof qn?e.changes:qn.of(e.changes||[],n,t.facet(ez)),selection:r&&(r instanceof le?r:le.single(r.anchor,r.head)),effects:nu(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function oz(t,e,n){let r=RS(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let a=!!e[s].sequential;r=sz(r,RS(t,e[s],a?r.changes.newLength:t.doc.length),a)}let i=Bi.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return NJ(n?DJ(i):i)}function DJ(t){let e=t.startState,n=!0;for(let i of e.facet(tz)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:MJ(n,s))}if(n!==!0){let i,s;if(n===!1)s=t.changes.invertedDesc,i=qn.empty(e.doc.length);else{let a=t.changes.filter(n);i=a.changes,s=a.filtered.mapDesc(a.changes).invertedDesc}t=Bi.create(e,i,t.selection&&t.selection.map(s),hn.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let r=e.facet(nz);for(let i=r.length-1;i>=0;i--){let s=r[i](t);s instanceof Bi?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Bi?t=s[0]:t=oz(e,nu(s),!1)}return t}function NJ(t){let e=t.startState,n=e.facet(rz),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=sz(r,RS(e,s,t.changes.newLength),!0))}return r==t?t:Bi.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const LJ=[];function nu(t){return t==null?LJ:Array.isArray(t)?t:[t]}var Qo=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Qo||(Qo={}));const zJ=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let AS;try{AS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function jJ(t){if(AS)return AS.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||zJ.test(n)))return!0}return!1}function IJ(t){return e=>{if(!/\S/.test(e))return Qo.Space;if(jJ(e))return Qo.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Qo.Word;return Qo.Other}}class wt{constructor(e,n,r,i,s,a){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)_d(this,l<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return _d(this,r),tO(this,r)}update(...e){return oz(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let l of e.effects)l.is(zh.reconfigure)?(n&&(i=new Map,n.compartments.forEach((u,d)=>i.set(d,u)),n=null),i.set(l.value.compartment,l.value.extension)):l.is(hn.reconfigure)?(n=null,r=l.value):l.is(hn.appendConfig)&&(n=null,r=nu(r).concat(l.value));let s;n?s=e.startState.values.slice():(n=eO.resolve(r,i,this),s=new wt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(u,d)=>d.reconfigure(u,this),null).values);let a=e.startState.facet(ES)?e.newSelection:e.newSelection.asSingle();new wt(n,e.newDoc,a,s,(l,u)=>u.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:le.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],a=nu(r.effects);for(let l=1;l<n.ranges.length;l++){let u=e(n.ranges[l]),d=this.changes(u.changes),h=d.map(i);for(let m=0;m<l;m++)s[m]=s[m].map(h);let g=i.mapDesc(d,!0);s.push(u.range.map(g)),i=i.compose(h),a=hn.mapEffects(a,h).concat(hn.mapEffects(nu(u.effects),g))}return{changes:i,selection:le.create(s,n.mainIndex),effects:a}}changes(e=[]){return e instanceof qn?e:qn.of(e,this.doc.length,this.facet(wt.lineSeparator))}toText(e){return pt.of(e.split(this.facet(wt.lineSeparator)||wS))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(_d(this,n),tO(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof qa&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let a=r[s],l=e[s];i.push(a.init(u=>a.spec.fromJSON(l,u)))}}return wt.create({doc:e.doc,selection:le.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=eO.resolve(e.extensions||[],new Map),r=e.doc instanceof pt?e.doc:pt.of((e.doc||"").split(n.staticFacet(wt.lineSeparator)||wS)),i=e.selection?e.selection instanceof le?e.selection:le.single(e.selection.anchor,e.selection.head):le.single(0);return HL(i,r.length),n.staticFacet(ES)||(i=i.asSingle()),new wt(n,r,i,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(wt.tabSize)}get lineBreak(){return this.facet(wt.lineSeparator)||`
292
+ `}get readOnly(){return this.facet(iz)}phrase(e,...n){for(let r of this.facet(wt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(JL))for(let a of s(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&i.push(a[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return IJ(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),a=e-r,l=e-r;for(;a>0;){let u=sr(n,a,!1);if(s(n.slice(u,a))!=Qo.Word)break;a=u}for(;l<i;){let u=sr(n,l);if(s(n.slice(l,u))!=Qo.Word)break;l=u}return a==l?null:le.range(a+r,l+r)}}wt.allowMultipleSelections=ES;wt.tabSize=Re.define({combine:t=>t.length?t[0]:4});wt.lineSeparator=ez;wt.readOnly=iz;wt.phrases=Re.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});wt.languageData=JL;wt.changeFilter=tz;wt.transactionFilter=nz;wt.transactionExtender=rz;zh.reconfigure=hn.define();function ZJ(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let a=i[s],l=r[s];if(l===void 0)r[s]=a;else if(!(l===a||a===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](l,a);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class La{eq(e){return this==e}range(e,n=e){return PS.create(e,n,this)}}La.prototype.startSide=La.prototype.endSide=0;La.prototype.point=!1;La.prototype.mapMode=Sr.TrackDel;function W1(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let PS=class az{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new az(e,n,r)}};function _S(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class F1{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let a=i,l=s.length;;){if(a==l)return a;let u=a+l>>1,d=s[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-n;if(u==a)return d>=0?a:l;d>=0?l=u:a=u+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,s);s<a;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let r=[],i=[],s=[],a=-1,l=-1;for(let u=0;u<this.value.length;u++){let d=this.value[u],h=this.from[u]+e,g=this.to[u]+e,m,O;if(h==g){let v=n.mapPos(h,d.startSide,d.mapMode);if(v==null||(m=O=v,d.startSide!=d.endSide&&(O=n.mapPos(h,d.endSide),O<m)))continue}else if(m=n.mapPos(h,d.startSide),O=n.mapPos(g,d.endSide),m>O||m==O&&d.startSide>0&&d.endSide<=0)continue;(O-m||d.endSide-d.startSide)<0||(a<0&&(a=m),d.point&&(l=Math.max(l,O-m)),r.push(d),i.push(m-a),s.push(O-a))}return{mapped:r.length?new F1(i,s,r,l):null,pos:a}}}class at{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new at(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(_S)),this.isEmpty)return n.length?at.of(n):this;let l=new lz(this,null,-1).goto(0),u=0,d=[],h=new Kd;for(;l.value||u<n.length;)if(u<n.length&&(l.from-n[u].from||l.startSide-n[u].value.startSide)>=0){let g=n[u++];h.addInner(g.from,g.to,g.value)||d.push(g)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(u==n.length||this.chunkEnd(l.chunkIndex)<n[u].from)&&(!a||i>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!a||i>l.to||s<l.from||a(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||d.push(PS.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!d.length?at.empty:this.nextLayer.update({add:d,filter:a,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let a=0;a<this.chunk.length;a++){let l=this.chunkPos[a],u=this.chunk[a],d=e.touchesRange(l,l+u.length);if(d===!1)i=Math.max(i,u.maxPoint),n.push(u),r.push(e.mapPos(l));else if(d===!0){let{mapped:h,pos:g}=u.map(l,e);h&&(i=Math.max(i,h.maxPoint),n.push(h),r.push(g))}}let s=this.nextLayer.map(e);return n.length==0?s:new at(r,n,s||at.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],a=this.chunk[i];if(n>=s&&e<=s+a.length&&a.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Jd.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Jd.from(e).goto(n)}static compare(e,n,r,i,s=-1){let a=e.filter(g=>g.maxPoint>0||!g.isEmpty&&g.maxPoint>=s),l=n.filter(g=>g.maxPoint>0||!g.isEmpty&&g.maxPoint>=s),u=yP(a,l,r),d=new ld(a,u,s),h=new ld(l,u,s);r.iterGaps((g,m,O)=>bP(d,g,h,m,O,i)),r.empty&&r.length==0&&bP(d,0,h,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(h=>!h.isEmpty&&n.indexOf(h)<0),a=n.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let l=yP(s,a),u=new ld(s,l,0).goto(r),d=new ld(a,l,0).goto(r);for(;;){if(u.to!=d.to||!$S(u.active,d.active)||u.point&&(!d.point||!W1(u.point,d.point)))return!1;if(u.to>i)return!0;u.next(),d.next()}}static spans(e,n,r,i,s=-1){let a=new ld(e,null,s).goto(n),l=n,u=a.openStart;for(;;){let d=Math.min(a.to,r);if(a.point){let h=a.activeForPoint(a.to),g=a.pointFrom<n?h.length+1:a.point.startSide<0?h.length:Math.min(h.length,u);i.point(l,d,a.point,h,g,a.pointRank),u=Math.min(a.openEnd(d),h.length)}else d>l&&(i.span(l,d,a.active,u),u=a.openEnd(d));if(a.to>r)return u+(a.point&&a.to>r?1:0);l=a.to,a.next()}}static of(e,n=!1){let r=new Kd;for(let i of e instanceof PS?[e]:n?XJ(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return at.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=at.empty;i=i.nextLayer)n=new at(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}at.empty=new at([],[],null,-1);function XJ(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(_S(e,r)>0)return t.slice().sort(_S);e=r}return t}at.empty.nextLayer=at.empty;class Kd{finishChunk(e){this.chunks.push(new F1(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new Kd)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(at.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=at.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function yP(t,e,n){let r=new Map;for(let s of t)for(let a=0;a<s.chunk.length;a++)s.chunk[a].maxPoint<=0&&r.set(s.chunk[a],s.chunkPos[a]);let i=new Set;for(let s of e)for(let a=0;a<s.chunk.length;a++){let l=r.get(s.chunk[a]);l!=null&&(n?n.mapPos(l):l)==s.chunkPos[a]&&!(n!=null&&n.touchesRange(l,l+s.chunk[a].length))&&i.add(s.chunk[a])}return i}class lz{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Jd{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let a=e[s];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new lz(a,n,r,s));return i.length==1?i[0]:new Jd(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)tx(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)tx(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),tx(this.heap,0)}}}function tx(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class ld{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Jd.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Mg(this.active,e),Mg(this.activeTo,e),Mg(this.activeRank,e),this.minActive=vP(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||i-this.activeTo[n])>0;)n++;Dg(this.active,n,r),Dg(this.activeTo,n,i),Dg(this.activeRank,n,s),e&&Dg(e,n,this.cursor.from),this.minActive=vP(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Mg(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function bP(t,e,n,r,i,s){t.goto(e),n.goto(r);let a=r+i,l=r,u=r-e,d=!!s.boundChange;for(let h=!1;;){let g=t.to+u-n.to,m=g||t.endSide-n.endSide,O=m<0?t.to+u:n.to,v=Math.min(O,a);if(t.point||n.point?(t.point&&n.point&&W1(t.point,n.point)&&$S(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,v,t.point,n.point),h=!1):(h&&s.boundChange(l),v>l&&!$S(t.active,n.active)&&s.compareRange(l,v,t.active,n.active),d&&v<a&&(g||t.openEnd(O)!=n.openEnd(O))&&(h=!0)),O>a)break;l=O,m<=0&&t.next(),m>=0&&n.next()}}function $S(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!W1(t[n],e[n]))return!1;return!0}function Mg(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function Dg(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function vP(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function Lo(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=sr(t,i));return r}function BJ(t,e,n,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=sr(t,i)}return t.length}const cz=1024;let UJ=0;class ji{constructor(e,n){this.from=e,this.to=n}}class Le{constructor(e={}){this.id=UJ++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Ln.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Le.closedBy=new Le({deserialize:t=>t.split(" ")});Le.openedBy=new Le({deserialize:t=>t.split(" ")});Le.group=new Le({deserialize:t=>t.split(" ")});Le.isolate=new Le({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Le.contextHash=new Le({perNode:!0});Le.lookAhead=new Le({perNode:!0});Le.mounted=new Le({perNode:!0});class ru{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[Le.mounted.id]}}const VJ=Object.create(null);class Ln{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):VJ,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Ln(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Le.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Le.group),s=-1;s<(i?i.length:0);s++){let a=n[s<0?r.name:i[s]];if(a)return a}}}}Ln.none=new Ln("",Object.create(null),0,8);class jh{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let s of e){let a=s(r);if(a){i||(i=Object.assign({},r.props));let l=a[1],u=a[0];u.combine&&u.id in i&&(l=u.combine(i[u.id],l)),i[u.id]=l}}n.push(i?new Ln(r.name,i,r.id,r.flags):r)}return new jh(n)}}const Ng=new WeakMap,xP=new WeakMap;var Rt;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(Rt||(Rt={}));class kt{constructor(e,n,r,i,s){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[a,l]of s)this.props[typeof a=="number"?a:a.id]=l}}toString(){let e=ru.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new nO(this.topNode,e)}cursorAt(e,n=0,r=0){let i=Ng.get(this)||this.topNode,s=new nO(i);return s.moveTo(e,n),Ng.set(this,s._tree),s}get topNode(){return new fr(this,0,0,null)}resolve(e,n=0){let r=eh(Ng.get(this)||this.topNode,e,n,!1);return Ng.set(this,r),r}resolveInner(e,n=0){let r=eh(xP.get(this)||this.topNode,e,n,!0);return xP.set(this,r),r}resolveStack(e,n=0){return GJ(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:s=this.length}=e,a=e.mode||0,l=(a&Rt.IncludeAnonymous)>0;for(let u=this.cursor(a|Rt.IncludeAnonymous);;){let d=!1;if(u.from<=s&&u.to>=i&&(!l&&u.type.isAnonymous||n(u)!==!1)){if(u.firstChild())continue;d=!0}for(;d&&r&&(l||!u.type.isAnonymous)&&r(u),!u.nextSibling();){if(!u.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:J1(Ln.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new kt(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new kt(Ln.none,n,r,i)))}static build(e){return WJ(e)}}kt.empty=new kt(Ln.none,[],[],0);class H1{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new H1(this.buffer,this.index)}}class za{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Ln.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let a=[];for(;e<r;)a.push(this.childString(e)),e=this.buffer[e+3];return s+"("+a.join(",")+")"}findChild(e,n,r,i,s){let{buffer:a}=this,l=-1;for(let u=e;u!=n&&!(uz(s,i,a[u+1],a[u+2])&&(l=u,r>0));u=a[u+3]);return l}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),a=0;for(let l=e,u=0;l<n;){s[u++]=i[l++],s[u++]=i[l++]-r;let d=s[u++]=i[l++]-r;s[u++]=i[l++]-e,a=Math.max(a,d)}return new za(s,a,this.set)}}function uz(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function eh(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let a=!r&&t instanceof fr&&t.index<0?null:t.parent;if(!a)return t;t=a}let s=r?0:Rt.IgnoreOverlays;if(r)for(let a=t,l=a.parent;l;a=l,l=a.parent)a instanceof fr&&a.index<0&&((i=l.enter(e,n,s))===null||i===void 0?void 0:i.from)!=a.from&&(t=l);for(;;){let a=t.enter(e,n,s);if(!a)return t;t=a}}class fz{cursor(e=0){return new nO(this,e)}getChild(e,n=null,r=null){let i=SP(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return SP(this,e,n,r)}resolve(e,n=0){return eh(this,e,n,!1)}resolveInner(e,n=0){return eh(this,e,n,!0)}matchContext(e){return MS(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class fr extends fz{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,s=0){for(let a=this;;){for(let{children:l,positions:u}=a._tree,d=n>0?l.length:-1;e!=d;e+=n){let h=l[e],g=u[e]+a.from,m;if(!(!(s&Rt.EnterBracketed&&h instanceof kt&&(m=ru.get(h))&&!m.overlay&&m.bracketed&&r>=g&&r<=g+h.length)&&!uz(i,r,g,g+h.length))){if(h instanceof za){if(s&Rt.ExcludeBuffers)continue;let O=h.findChild(0,h.buffer.length,n,r-g,i);if(O>-1)return new js(new qJ(a,h,e,g),null,O)}else if(s&Rt.IncludeAnonymous||!h.type.isAnonymous||K1(h)){let O;if(!(s&Rt.IgnoreMounts)&&(O=ru.get(h))&&!O.overlay)return new fr(O.tree,g,e,a);let v=new fr(h,g,e,a);return s&Rt.IncludeAnonymous||!v.type.isAnonymous?v:v.nextChild(n<0?h.children.length-1:0,n,r,i,s)}}}if(s&Rt.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,r=0){let i;if(!(r&Rt.IgnoreOverlays)&&(i=ru.get(this._tree))&&i.overlay){let s=e-this.from,a=r&Rt.EnterBracketed&&i.bracketed;for(let{from:l,to:u}of i.overlay)if((n>0||a?l<=s:l<s)&&(n<0||a?u>=s:u>s))return new fr(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function SP(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function MS(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class qJ{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class js extends fz{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new js(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,r=0){if(r&Rt.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new js(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new js(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new js(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let a=r.buffer[this.index+1];e.push(r.slice(i,s,a)),n.push(0)}return new kt(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function dz(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let a=t[s];(a.from>n.from||a.to<n.to)&&(n=a,e=s)}let r=n instanceof fr&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new YJ(i,n)}class YJ{constructor(e,n){this.heads=e,this.node=n}get next(){return dz(this.heads)}}function GJ(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof fr?r:r.context.parent;s;s=s.parent)if(s.index<0){let a=s.parent;(i||(i=[r])).push(a.resolve(e,n)),s=a}else{let a=ru.get(s.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let l=new fr(a.tree,a.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(eh(l,e,n,!1))}}return i?dz(i):r}class nO{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Rt.EnterBracketed,e instanceof fr)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof fr?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Rt.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Rt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Rt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let s=n+e,a=e<0?-1:r._tree.children.length;s!=a;s+=e){let l=r._tree.children[s];if(this.mode&Rt.IncludeAnonymous||l instanceof za||!l.type.isAnonymous||K1(l))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)n=new js(this.buffer,n,this.stack[i]);return this.bufferNode=new js(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return MS(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return MS(this._tree,e,i);let a=r[n.buffer[this.stack[s]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}}function K1(t){return t.children.some(e=>e instanceof za||!e.type.isAnonymous||K1(e))}function WJ(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=cz,reused:s=[],minRepeatType:a=r.types.length}=t,l=Array.isArray(n)?new H1(n,n.length):n,u=r.types,d=0,h=0;function g(P,$,_,D,B,L){let{id:M,start:U,end:Y,size:H}=l,ee=h,N=d;if(H<0)if(l.next(),H==-1){let se=s[M];_.push(se),D.push(U-P);return}else if(H==-3){d=M;return}else if(H==-4){h=M;return}else throw new RangeError(`Unrecognized record size: ${H}`);let V=u[M],Z,W,fe=U-P;if(Y-U<=i&&(W=k(l.pos-$,B))){let se=new Uint16Array(W.size-W.skip),ge=l.pos-W.size,oe=se.length;for(;l.pos>ge;)oe=C(W.start,se,oe);Z=new za(se,Y-W.start,r),fe=W.start-P}else{let se=l.pos-H;l.next();let ge=[],oe=[],he=M>=a?M:-1,me=0,Ce=Y;for(;l.pos>se;)he>=0&&l.id==he&&l.size>=0?(l.end<=Ce-i&&(v(ge,oe,U,me,l.end,Ce,he,ee,N),me=ge.length,Ce=l.end),l.next()):L>2500?m(U,se,ge,oe):g(U,se,ge,oe,he,L+1);if(he>=0&&me>0&&me<ge.length&&v(ge,oe,U,me,U,Ce,he,ee,N),ge.reverse(),oe.reverse(),he>-1&&me>0){let Te=O(V,N);Z=J1(V,ge,oe,0,ge.length,0,Y-U,Te,Te)}else Z=x(V,ge,oe,Y-U,ee-Y,N)}_.push(Z),D.push(fe)}function m(P,$,_,D){let B=[],L=0,M=-1;for(;l.pos>$;){let{id:U,start:Y,end:H,size:ee}=l;if(ee>4)l.next();else{if(M>-1&&Y<M)break;M<0&&(M=H-i),B.push(U,Y,H),L++,l.next()}}if(L){let U=new Uint16Array(L*4),Y=B[B.length-2];for(let H=B.length-3,ee=0;H>=0;H-=3)U[ee++]=B[H],U[ee++]=B[H+1]-Y,U[ee++]=B[H+2]-Y,U[ee++]=ee;_.push(new za(U,B[2]-Y,r)),D.push(Y-P)}}function O(P,$){return(_,D,B)=>{let L=0,M=_.length-1,U,Y;if(M>=0&&(U=_[M])instanceof kt){if(!M&&U.type==P&&U.length==B)return U;(Y=U.prop(Le.lookAhead))&&(L=D[M]+U.length+Y)}return x(P,_,D,B,L,$)}}function v(P,$,_,D,B,L,M,U,Y){let H=[],ee=[];for(;P.length>D;)H.push(P.pop()),ee.push($.pop()+_-B);P.push(x(r.types[M],H,ee,L-B,U-L,Y)),$.push(B-_)}function x(P,$,_,D,B,L,M){if(L){let U=[Le.contextHash,L];M=M?[U].concat(M):[U]}if(B>25){let U=[Le.lookAhead,B];M=M?[U].concat(M):[U]}return new kt(P,$,_,D,M)}function k(P,$){let _=l.fork(),D=0,B=0,L=0,M=_.end-i,U={size:0,start:0,skip:0};e:for(let Y=_.pos-P;_.pos>Y;){let H=_.size;if(_.id==$&&H>=0){U.size=D,U.start=B,U.skip=L,L+=4,D+=4,_.next();continue}let ee=_.pos-H;if(H<0||ee<Y||_.start<M)break;let N=_.id>=a?4:0,V=_.start;for(_.next();_.pos>ee;){if(_.size<0)if(_.size==-3||_.size==-4)N+=4;else break e;else _.id>=a&&(N+=4);_.next()}B=V,D+=H,L+=N}return($<0||D==P)&&(U.size=D,U.start=B,U.skip=L),U.size>4?U:void 0}function C(P,$,_){let{id:D,start:B,end:L,size:M}=l;if(l.next(),M>=0&&D<a){let U=_;if(M>4){let Y=l.pos-(M-4);for(;l.pos>Y;)_=C(P,$,_)}$[--_]=U,$[--_]=L-P,$[--_]=B-P,$[--_]=D}else M==-3?d=D:M==-4&&(h=D);return _}let Q=[],R=[];for(;l.pos>0;)g(t.start||0,t.bufferStart||0,Q,R,-1,0);let E=(e=t.length)!==null&&e!==void 0?e:Q.length?R[0]+Q[0].length:0;return new kt(u[t.topID],Q.reverse(),R.reverse(),E)}const wP=new WeakMap;function mm(t,e){if(!t.isAnonymous||e instanceof za||e.type!=t)return 1;let n=wP.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof kt)){n=1;break}n+=mm(t,r)}wP.set(e,n)}return n}function J1(t,e,n,r,i,s,a,l,u){let d=0;for(let v=r;v<i;v++)d+=mm(t,e[v]);let h=Math.ceil(d*1.5/8),g=[],m=[];function O(v,x,k,C,Q){for(let R=k;R<C;){let E=R,P=x[R],$=mm(t,v[R]);for(R++;R<C;R++){let _=mm(t,v[R]);if($+_>=h)break;$+=_}if(R==E+1){if($>h){let _=v[E];O(_.children,_.positions,0,_.children.length,x[E]+Q);continue}g.push(v[E])}else{let _=x[R-1]+v[R-1].length-P;g.push(J1(t,v,x,E,R,P,_,null,u))}m.push(P+Q-s)}}return O(e,n,r,i,0),(l||u)(g,m,a)}class hz{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof js?this.setBuffer(e.context.buffer,e.index,n):e instanceof fr&&this.map.set(e.tree,n)}get(e){return e instanceof js?this.getBuffer(e.context.buffer,e.index):e instanceof fr?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Po{constructor(e,n,r,i,s=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Po(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,a=e.length?e[0]:null;for(let l=0,u=0,d=0;;l++){let h=l<n.length?n[l]:null,g=h?h.fromA:1e9;if(g-u>=r)for(;a&&a.from<g;){let m=a;if(u>=m.from||g<=m.to||d){let O=Math.max(m.from,u)-d,v=Math.min(m.to,g)-d;m=O>=v?null:new Po(O,v,m.tree,m.offset+d,l>0,!!h)}if(m&&i.push(m),a.to>g)break;a=s<e.length?e[s++]:null}if(!h)break;u=h.toA,d=h.toA-h.toB}return i}}class ek{startParse(e,n,r){return typeof e=="string"&&(e=new FJ(e)),r=r?r.length?r.map(i=>new ji(i.from,i.to)):[new ji(0,0)]:[new ji(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}}class FJ{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function pz(t){return(e,n,r,i)=>new KJ(e,t,n,r,i)}class kP{constructor(e,n,r,i,s,a){this.parser=e,this.parse=n,this.overlay=r,this.bracketed=i,this.target=s,this.from=a}}function CP(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class HJ{constructor(e,n,r,i,s,a,l,u){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=s,this.bracketed=a,this.target=l,this.prev=u,this.depth=0,this.ranges=[]}}const DS=new Le({perNode:!0});class KJ{constructor(e,n,r,i,s){this.nest=n,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new kt(r.type,r.children,r.positions,r.length,r.propValues.concat([[DS,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[Le.mounted.id]=new ru(n,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new tee(this.fragments),n=null,r=null,i=new nO(new fr(this.baseTree,this.ranges[0].from,0,null),Rt.IncludeAnonymous|Rt.IgnoreMounts);e:for(let s,a;;){let l=!0,u;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)l=!1;else if(e.hasNode(i)){if(n){let d=n.mounts.find(h=>h.frag.from<=i.from&&h.frag.to>=i.to&&h.mount.overlay);if(d)for(let h of d.mount.overlay){let g=h.from+d.pos,m=h.to+d.pos;g>=i.from&&m<=i.to&&!n.ranges.some(O=>O.from<m&&O.to>g)&&n.ranges.push({from:g,to:m})}}l=!1}else if(r&&(a=JJ(r.ranges,i.from,i.to)))l=a!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.from<i.to||!s.overlay)){i.tree||(eee(i),n&&n.depth++,r&&r.depth++);let d=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")n=new HJ(s.parser,s.overlay,d,this.inner.length,i.from,!!s.bracketed,i.tree,n);else{let h=EP(this.ranges,s.overlay||(i.from<i.to?[new ji(i.from,i.to)]:[]));h.length&&CP(h),(h.length||!s.overlay)&&this.inner.push(new kP(s.parser,h.length?s.parser.startParse(this.input,RP(d,h),h):s.parser.startParse(""),s.overlay?s.overlay.map(g=>new ji(g.from-i.from,g.to-i.from)):null,!!s.bracketed,i.tree,h.length?h[0].from:i.from)),s.overlay?h.length&&(r={ranges:h,depth:0,prev:r}):l=!1}}else if(n&&(u=n.predicate(i))&&(u===!0&&(u=new ji(i.from,i.to)),u.from<u.to)){let d=n.ranges.length-1;d>=0&&n.ranges[d].to==u.from?n.ranges[d]={from:n.ranges[d].from,to:u.to}:n.ranges.push(u)}if(l&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let d=EP(this.ranges,n.ranges);d.length&&(CP(d),this.inner.splice(n.index,0,new kP(n.parser,n.parser.startParse(this.input,RP(n.mounts,d),d),n.ranges.map(h=>new ji(h.from-n.start,h.to-n.start)),n.bracketed,n.target,d[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function JJ(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function TP(t,e,n,r,i,s){if(e<n){let a=t.buffer[e+1];r.push(t.slice(e,n,a)),i.push(a-s)}}function eee(t){let{node:e}=t,n=[],r=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let i=t.tree,s=i.children.indexOf(r),a=i.children[s],l=a.buffer,u=[s];function d(h,g,m,O,v,x){let k=n[x],C=[],Q=[];TP(a,h,k,C,Q,O);let R=l[k+1],E=l[k+2];u.push(C.length);let P=x?d(k+4,l[k+3],a.set.types[l[k]],R,E-R,x-1):e.toTree();return C.push(P),Q.push(R-O),TP(a,l[k+3],g,C,Q,O),new kt(m,C,Q,v)}i.children[s]=d(0,l.length,Ln.none,0,a.length,n.length-1);for(let h of u){let g=t.tree.children[h],m=t.tree.positions[h];t.yield(new fr(g,m+t.from,h,t._tree))}}class QP{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(Rt.IncludeAnonymous|Rt.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from<r;)n.to>=e&&n.enter(r,1,Rt.IgnoreOverlays|Rt.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof kt)n=n.children[0];else break}return!1}}let tee=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(DS))!==null&&n!==void 0?n:r.to,this.inner=new QP(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(DS))!==null&&e!==void 0?e:n.to,this.inner=new QP(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let a=(r=s.tree)===null||r===void 0?void 0:r.prop(Le.mounted);if(a&&a.parser==n)for(let l=this.fragI;l<this.fragments.length;l++){let u=this.fragments[l];if(u.from>=s.to)break;u.tree==this.curFrag.tree&&i.push({frag:u,pos:s.from-u.offset,mount:a})}}}return i}};function EP(t,e){let n=null,r=e;for(let i=1,s=0;i<t.length;i++){let a=t[i-1].to,l=t[i].from;for(;s<r.length;s++){let u=r[s];if(u.from>=l)break;u.to<=a||(n||(r=n=e.slice()),u.from<a?(n[s]=new ji(u.from,a),u.to>l&&n.splice(s+1,0,new ji(l,u.to))):u.to>l?n[s--]=new ji(l,u.to):n.splice(s--,1))}}return r}function nee(t,e,n,r){let i=0,s=0,a=!1,l=!1,u=-1e9,d=[];for(;;){let h=i==t.length?1e9:a?t[i].to:t[i].from,g=s==e.length?1e9:l?e[s].to:e[s].from;if(a!=l){let m=Math.max(u,n),O=Math.min(h,g,r);m<O&&d.push(new ji(m,O))}if(u=Math.min(h,g),u==1e9)break;h==u&&(a?(a=!1,i++):a=!0),g==u&&(l?(l=!1,s++):l=!0)}return d}function RP(t,e){let n=[];for(let{pos:r,mount:i,frag:s}of t){let a=r+(i.overlay?i.overlay[0].from:0),l=a+i.tree.length,u=Math.max(s.from,a),d=Math.min(s.to,l);if(i.overlay){let h=i.overlay.map(m=>new ji(m.from+r,m.to+r)),g=nee(e,h,u,d);for(let m=0,O=u;;m++){let v=m==g.length,x=v?d:g[m].from;if(x>O&&n.push(new Po(O,x,i.tree,-a,s.from>=O||s.openStart,s.to<=x||s.openEnd)),v)break;O=g[m].to}}else n.push(new Po(u,d,i.tree,-a,s.from>=a||s.openStart,s.to<=l||s.openEnd))}return n}const NS="ͼ",AP=typeof Symbol>"u"?"__"+NS:Symbol.for(NS),LS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),PP=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ja{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,l,u,d){let h=[],g=/^@(\w+)\b/.exec(a[0]),m=g&&g[1]=="keyframes";if(g&&l==null)return u.push(a[0]+";");for(let O in l){let v=l[O];if(/&/.test(O))s(O.split(/,\s*/).map(x=>a.map(k=>x.replace(/&/,k))).reduce((x,k)=>x.concat(k)),v,u);else if(v&&typeof v=="object"){if(!g)throw new RangeError("The value of a property ("+O+") should be a primitive value.");s(i(O),v,h,m)}else v!=null&&h.push(O.replace(/_.*/,"").replace(/[A-Z]/g,x=>"-"+x.toLowerCase())+": "+v+";")}(h.length||m)&&u.push((r&&!g&&!d?a.map(r):a).join(", ")+" {"+h.join(" ")+"}")}for(let a in e)s(i(a),e[a],this.rules)}getRules(){return this.rules.join(`
293
+ `)}static newName(){let e=PP[AP]||1;return PP[AP]=e+1,NS+e.toString(36)}static mount(e,n,r){let i=e[LS],s=r&&r.nonce;i?s&&i.setNonce(s):i=new ree(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let _P=new Map;class ree{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=_P.get(r);if(s)return e[LS]=s;this.sheet=new i.CSSStyleSheet,_P.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[LS]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let a=0;a<e.length;a++){let l=e[a],u=this.modules.indexOf(l);if(u<s&&u>-1&&(this.modules.splice(u,1),s--,u=-1),u==-1){if(this.modules.splice(s++,0,l),r)for(let d=0;d<l.rules.length;d++)r.insertRule(l.rules[d],i++)}else{for(;s<u;)i+=this.modules[s++].rules.length;i+=l.rules.length,s++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let a="";for(let u=0;u<this.modules.length;u++)a+=this.modules[u].getRules()+`
294
+ `;this.styleTag.textContent=a;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Ia={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},th={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},iee=typeof navigator<"u"&&/Mac/.test(navigator.platform),see=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ir=0;ir<10;ir++)Ia[48+ir]=Ia[96+ir]=String(ir);for(var ir=1;ir<=24;ir++)Ia[ir+111]="F"+ir;for(var ir=65;ir<=90;ir++)Ia[ir]=String.fromCharCode(ir+32),th[ir]=String.fromCharCode(ir);for(var nx in Ia)th.hasOwnProperty(nx)||(th[nx]=Ia[nx]);function oee(t){var e=iee&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||see&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?th:Ia)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}let xr=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},zS=typeof document<"u"?document:{documentElement:{style:{}}};const jS=/Edge\/(\d+)/.exec(xr.userAgent),gz=/MSIE \d/.test(xr.userAgent),IS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xr.userAgent),wy=!!(gz||IS||jS),$P=!wy&&/gecko\/(\d+)/i.test(xr.userAgent),rx=!wy&&/Chrome\/(\d+)/.exec(xr.userAgent),aee="webkitFontSmoothing"in zS.documentElement.style,ZS=!wy&&/Apple Computer/.test(xr.vendor),MP=ZS&&(/Mobile\/\w+/.test(xr.userAgent)||xr.maxTouchPoints>2);var xe={mac:MP||/Mac/.test(xr.platform),windows:/Win/.test(xr.platform),linux:/Linux|X11/.test(xr.platform),ie:wy,ie_version:gz?zS.documentMode||6:IS?+IS[1]:jS?+jS[1]:0,gecko:$P,gecko_version:$P?+(/Firefox\/(\d+)/.exec(xr.userAgent)||[0,0])[1]:0,chrome:!!rx,chrome_version:rx?+rx[1]:0,ios:MP,android:/Android\b/.test(xr.userAgent),webkit_version:aee?+(/\bAppleWebKit\/(\d+)/.exec(xr.userAgent)||[0,0])[1]:0,safari:ZS,safari_version:ZS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(xr.userAgent)||[0,0])[1]:0,tabSize:zS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function tk(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const rO=Object.create(null);function nk(t,e,n){if(t==e)return!0;t||(t=rO),e||(e=rO);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function lee(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function DP(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function cee(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class qu{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Vr=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Vr||(Vr={}));class At extends La{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Ih(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Il(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:a}=mz(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new Il(e,r,i,n,e.widget||null,!0)}static line(e){return new Zh(e)}static set(e,n=!1){return at.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}At.none=at.empty;class Ih extends At{constructor(e){let{start:n,end:r}=mz(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?tk(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||rO}eq(e){return this==e||e instanceof Ih&&this.tagName==e.tagName&&nk(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Ih.prototype.point=!1;class Zh extends At{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Zh&&this.spec.class==e.spec.class&&nk(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Zh.prototype.mapMode=Sr.TrackBefore;Zh.prototype.point=!0;class Il extends At{constructor(e,n,r,i,s,a){super(n,r,s,e),this.block=i,this.isReplace=a,this.mapMode=i?n<=0?Sr.TrackBefore:Sr.TrackAfter:Sr.TrackDel}get type(){return this.startSide!=this.endSide?Vr.WidgetRange:this.startSide<=0?Vr.WidgetBefore:Vr.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Il&&uee(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Il.prototype.point=!0;function mz(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function uee(t,e){return t==e||!!(t&&e&&t.compare(e))}function iu(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class nh extends La{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof nh&&this.tagName==e.tagName&&nk(this.attributes,e.attributes)}static create(e){return new nh(e.tagName,e.attributes||rO)}static set(e,n=!1){return at.of(e,n)}}nh.prototype.startSide=nh.prototype.endSide=-1;function vu(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function XS(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function $d(t,e){if(!e.anchorNode)return!1;try{return XS(t,e.anchorNode)}catch{return!1}}function Om(t){return t.nodeType==3?rh(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Md(t,e,n,r){return n?NP(t,e,n,r,-1)||NP(t,e,n,r,1):!1}function Za(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function iO(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function NP(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:zo(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=Za(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?zo(t):0}else return!1}}function zo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function sO(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function fee(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Oz(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function dee(t,e,n,r,i,s,a,l){let u=t.ownerDocument,d=u.defaultView||window;for(let h=t,g=!1;h&&!g;)if(h.nodeType==1){let m,O=h==u.body,v=1,x=1;if(O)m=fee(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(g=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let Q=h.getBoundingClientRect();({scaleX:v,scaleY:x}=Oz(h,Q)),m={left:Q.left,right:Q.left+h.clientWidth*v,top:Q.top,bottom:Q.top+h.clientHeight*x}}let k=0,C=0;if(i=="nearest")e.top<m.top?(C=e.top-(m.top+a),n>0&&e.bottom>m.bottom+C&&(C=e.bottom-m.bottom+a)):e.bottom>m.bottom&&(C=e.bottom-m.bottom+a,n<0&&e.top-C<m.top&&(C=e.top-(m.top+a)));else{let Q=e.bottom-e.top,R=m.bottom-m.top;C=(i=="center"&&Q<=R?e.top+Q/2-R/2:i=="start"||i=="center"&&n<0?e.top-a:e.bottom-R+a)-m.top}if(r=="nearest"?e.left<m.left?(k=e.left-(m.left+s),n>0&&e.right>m.right+k&&(k=e.right-m.right+s)):e.right>m.right&&(k=e.right-m.right+s,n<0&&e.left<m.left+k&&(k=e.left-(m.left+s))):k=(r=="center"?e.left+(e.right-e.left)/2-(m.right-m.left)/2:r=="start"==l?e.left-s:e.right-(m.right-m.left)+s)-m.left,k||C)if(O)d.scrollBy(k,C);else{let Q=0,R=0;if(C){let E=h.scrollTop;h.scrollTop+=C/x,R=(h.scrollTop-E)*x}if(k){let E=h.scrollLeft;h.scrollLeft+=k/v,Q=(h.scrollLeft-E)*v}e={left:e.left-Q,top:e.top-R,right:e.right-Q,bottom:e.bottom-R},Q&&Math.abs(Q-k)<1&&(r="nearest"),R&&Math.abs(R-C)<1&&(i="nearest")}if(O)break;(e.top<m.top||e.bottom>m.bottom||e.left<m.left||e.right>m.right)&&(e={left:Math.max(e.left,m.left),right:Math.min(e.right,m.right),top:Math.max(e.top,m.top),bottom:Math.min(e.bottom,m.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function hee(t){let e=t.ownerDocument,n,r;for(let i=t.parentNode;i&&!(i==e.body||n&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!n&&i.scrollWidth>i.clientWidth&&(n=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:n,y:r}}class pee{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?zo(n):0),r,Math.min(e.focusOffset,r?zo(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let yl=null;xe.safari&&xe.safari_version>=26&&(yl=!1);function yz(t){if(t.setActive)return t.setActive();if(yl)return t.focus(yl);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(yl==null?{get preventScroll(){return yl={preventScroll:!0},!0}}:void 0),!yl){yl=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],s=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let LP;function rh(t,e,n=e){let r=LP||(LP=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function su(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,t.dispatchEvent(s);let a=new KeyboardEvent("keyup",i);return a.synthetic=!0,t.dispatchEvent(a),s.defaultPrevented||a.defaultPrevented}function gee(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function mee(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,zo(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=zo(n))}else{if(n==t)return!0;r=Za(n),n=n.parentNode}}function bz(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function vz(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=zo(n)}else if(n.parentNode&&!iO(n))r=Za(n),n=n.parentNode;else return null}}function xz(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!iO(n))r=Za(n)+1,n=n.parentNode;else return null}}class os{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new os(e.parentNode,Za(e),n)}static after(e,n){return new os(e.parentNode,Za(e)+1,n)}}var xn=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(xn||(xn={}));const Zl=xn.LTR,rk=xn.RTL;function Sz(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const Oee=Sz("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),yee=Sz("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),BS=Object.create(null),ks=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);BS[e]=n,BS[n]=-e}function wz(t){return t<=247?Oee[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?yee[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const bee=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Eo{get dir(){return this.level%2?rk:Zl}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let s=-1;for(let a=0;a<e.length;a++){let l=e[a];if(l.from<=n&&l.to>=n){if(l.level==r)return a;(s<0||(i!=0?i<0?l.from<n:l.to>n:e[s].level>l.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function kz(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!kz(r.inner,i.inner))return!1}return!0}const qt=[];function vee(t,e,n,r,i){for(let s=0;s<=r.length;s++){let a=s?r[s-1].to:e,l=s<r.length?r[s].from:n,u=s?256:i;for(let d=a,h=u,g=u;d<l;d++){let m=wz(t.charCodeAt(d));m==512?m=h:m==8&&g==4&&(m=16),qt[d]=m==4?2:m,m&7&&(g=m),h=m}for(let d=a,h=u,g=u;d<l;d++){let m=qt[d];if(m==128)d<l-1&&h==qt[d+1]&&h&24?m=qt[d]=h:qt[d]=256;else if(m==64){let O=d+1;for(;O<l&&qt[O]==64;)O++;let v=d&&h==8||O<n&&qt[O]==8?g==1?1:8:256;for(let x=d;x<O;x++)qt[x]=v;d=O-1}else m==8&&g==1&&(qt[d]=1);h=m,m&7&&(g=m)}}}function xee(t,e,n,r,i){let s=i==1?2:1;for(let a=0,l=0,u=0;a<=r.length;a++){let d=a?r[a-1].to:e,h=a<r.length?r[a].from:n;for(let g=d,m,O,v;g<h;g++)if(O=BS[m=t.charCodeAt(g)])if(O<0){for(let x=l-3;x>=0;x-=3)if(ks[x+1]==-O){let k=ks[x+2],C=k&2?i:k&4?k&1?s:i:0;C&&(qt[g]=qt[ks[x]]=C),l=x;break}}else{if(ks.length==189)break;ks[l++]=g,ks[l++]=m,ks[l++]=u}else if((v=qt[g])==2||v==1){let x=v==i;u=x?0:1;for(let k=l-3;k>=0;k-=3){let C=ks[k+2];if(C&2)break;if(x)ks[k+2]|=2;else{if(C&4)break;ks[k+2]|=4}}}}}function See(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let a=i?n[i-1].to:t,l=i<n.length?n[i].from:e;for(let u=a;u<l;){let d=qt[u];if(d==256){let h=u+1;for(;;)if(h==l){if(i==n.length)break;h=n[i++].to,l=i<n.length?n[i].from:e}else if(qt[h]==256)h++;else break;let g=s==1,m=(h<e?qt[h]:r)==1,O=g==m?g?1:2:r;for(let v=h,x=i,k=x?n[x-1].to:t;v>u;)v==k&&(v=n[--x].from,k=x?n[x-1].to:t),qt[--v]=O;u=h}else s=d,u++}}}function US(t,e,n,r,i,s,a){let l=r%2?2:1;if(r%2==i%2)for(let u=e,d=0;u<n;){let h=!0,g=!1;if(d==s.length||u<s[d].from){let x=qt[u];x!=l&&(h=!1,g=x==16)}let m=!h&&l==1?[]:null,O=h?r:r+1,v=u;e:for(;;)if(d<s.length&&v==s[d].from){if(g)break e;let x=s[d];if(!h)for(let k=x.to,C=d+1;;){if(k==n)break e;if(C<s.length&&s[C].from==k)k=s[C++].to;else{if(qt[k]==l)break e;break}}if(d++,m)m.push(x);else{x.from>u&&a.push(new Eo(u,x.from,O));let k=x.direction==Zl!=!(O%2);VS(t,k?r+1:r,i,x.inner,x.from,x.to,a),u=x.to}v=x.to}else{if(v==n||(h?qt[v]!=l:qt[v]==l))break;v++}m?US(t,u,v,r+1,i,m,a):u<v&&a.push(new Eo(u,v,O)),u=v}else for(let u=n,d=s.length;u>e;){let h=!0,g=!1;if(!d||u>s[d-1].to){let x=qt[u-1];x!=l&&(h=!1,g=x==16)}let m=!h&&l==1?[]:null,O=h?r:r+1,v=u;e:for(;;)if(d&&v==s[d-1].to){if(g)break e;let x=s[--d];if(!h)for(let k=x.from,C=d;;){if(k==e)break e;if(C&&s[C-1].to==k)k=s[--C].from;else{if(qt[k-1]==l)break e;break}}if(m)m.push(x);else{x.to<u&&a.push(new Eo(x.to,u,O));let k=x.direction==Zl!=!(O%2);VS(t,k?r+1:r,i,x.inner,x.from,x.to,a),u=x.from}v=x.from}else{if(v==e||(h?qt[v-1]!=l:qt[v-1]==l))break;v--}m?US(t,v,u,r+1,i,m,a):v<u&&a.push(new Eo(v,u,O)),u=v}}function VS(t,e,n,r,i,s,a){let l=e%2?2:1;vee(t,i,s,r,l),xee(t,i,s,r,l),See(i,s,r,l),US(t,i,s,e,n,r,a)}function wee(t,e,n){if(!t)return[new Eo(0,0,e==rk?1:0)];if(e==Zl&&!n.length&&!bee.test(t))return Cz(t.length);if(n.length)for(;t.length>qt.length;)qt[qt.length]=256;let r=[],i=e==Zl?0:1;return VS(t,i,i,n,0,t.length,r),r}function Cz(t){return[new Eo(0,t,0)]}let Tz="";function kee(t,e,n,r,i){var s;let a=r.head-t.from,l=Eo.find(e,a,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),u=e[l],d=u.side(i,n);if(a==d){let m=l+=i?1:-1;if(m<0||m>=e.length)return null;u=e[l=m],a=u.side(!i,n),d=u.side(i,n)}let h=sr(t.text,a,u.forward(i,n));(h<u.from||h>u.to)&&(h=d),Tz=t.text.slice(Math.min(a,h),Math.max(a,h));let g=l==(i?e.length-1:0)?null:e[l+(i?1:-1)];return g&&h==d&&g.level+(i?0:1)<u.level?le.cursor(g.side(!i,n)+t.from,g.forward(i,n)?1:-1,g.level):le.cursor(h+t.from,u.forward(i,n)?-1:1,u.level)}function Cee(t,e,n){for(let r=e;r<n;r++){let i=wz(t.charCodeAt(r));if(i==1)return Zl;if(i==2||i==4)return rk}return Zl}const Qz=Re.define(),Ez=Re.define(),Rz=Re.define(),Az=Re.define(),qS=Re.define(),Pz=Re.define(),_z=Re.define(),ik=Re.define(),sk=Re.define(),$z=Re.define({combine:t=>t.some(e=>e)}),Tee=Re.define({combine:t=>t.some(e=>e)}),Mz=Re.define();class ou{constructor(e,n="nearest",r="nearest",i=5,s=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=a}map(e){return e.empty?this:new ou(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new ou(le.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Lg=hn.define({map:(t,e)=>t.map(e)}),Dz=hn.define();function Is(t,e,n){let r=t.facet(Az);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const ko=Re.define({combine:t=>t.length?t[0]:!0});let Qee=0;const qc=Re.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class Vi{constructor(e,n,r,i,s){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(qc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(qc.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:a}=n||{};return new Vi(Qee++,e,r,i,l=>{let u=[];return a&&u.push(ky.of(d=>{let h=d.plugin(l);return h?a(h):At.none})),s&&u.push(s(l)),u})}static fromClass(e,n){return Vi.define((r,i)=>new e(r,i),n)}}class ix{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Is(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Is(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Is(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Nz=Re.define(),ok=Re.define(),ky=Re.define(),Lz=Re.define(),ak=Re.define(),Xh=Re.define(),zz=Re.define();function zP(t,e){let n=t.state.facet(zz);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return at.spans(r,e.from,e.to,{point(){},span(s,a,l,u){let d=s-e.from,h=a-e.from,g=i;for(let m=l.length-1;m>=0;m--,u--){let O=l[m].spec.bidiIsolate,v;if(O==null&&(O=Cee(e.text,d,h)),u>0&&g.length&&(v=g[g.length-1]).to==d&&v.direction==O)v.to=h,g=v.inner;else{let x={from:d,to:h,direction:O,inner:[]};g.push(x),g=x.inner}}}}),i}const jz=Re.define();function Iz(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(jz)){let a=s(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(i=Math.max(i,a.bottom)))}return{left:e,right:n,top:r,bottom:i}}const vd=Re.define();class Ii{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new Ii(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,s=0,a=0;;){let l=i<e.length?e[i].fromB:1e9,u=s<n.length?n[s]:1e9,d=Math.min(l,u);if(d==1e9)break;let h=d+a,g=d,m=h;for(;;)if(s<n.length&&n[s]<=g){let O=n[s+1];s+=2,g=Math.max(g,O);for(let v=i;v<e.length&&e[v].fromB<=g;v++)a=e[v].toA-e[v].toB;m=Math.max(m,O+a)}else if(i<e.length&&e[i].fromB<=g){let O=e[i++];g=Math.max(g,O.toB),m=Math.max(m,O.toA),a=O.toA-O.toB}else break;r.push(new Ii(h,m,d,g))}return r}}class oO{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=qn.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,a,l,u)=>i.push(new Ii(s,a,l,u))),this.changedRanges=i}static create(e,n,r){return new oO(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const Eee=[];class Rn{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Eee}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&lee(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let r=Za(this.dom),i=this.length?e>0:n>0;return new os(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Ty)return e;return null}static get(e){return e.cmTile}}class Cy extends Rn{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,r=null,i,s=(e==null?void 0:e.node)==n?e:null,a=0;for(let l of this.children){if(l.sync(e),a+=l.length+l.breakAfter,i=r?r.nextSibling:n.firstChild,s&&i!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;i&&i!=l.dom;)i=jP(i);else n.insertBefore(l.dom,i);r=l.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=jP(i);this.length=a}}function jP(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Ty extends Cy{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Rn.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&s++,i=n.pop()}else{let a=r.children[i++];if(a instanceof _a)n.push(i),r=a,i=0;else{let l=s+a.length,u=e(a,s);if(u!==void 0)return u;s=l+a.breakAfter}}}resolveBlock(e,n){let r,i=-1,s,a=-1;if(this.blockTiles((l,u)=>{let d=u+l.length;if(e>=u&&e<=d){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(r=void 0)}(u<e||e==d&&(n<-1?l.length:l.covers(1)))&&(!r||!l.isWidget()&&r.isWidget())&&(r=l,i=e-u),(d>e||e==u&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,a=e-u)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:a}}}class _a extends Cy{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let r=new _a(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class xu extends Cy{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new xu(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,s=-1,a=null,l=-1;function u(h,g){for(let m=0,O=0;m<h.children.length&&O<=g;m++){let v=h.children[m],x=O+v.length;x>=g&&(v.isComposite()?u(v,g-O):(!a||a.isHidden&&(n>0||r&&Aee(a,v)))&&(x>g||v.flags&32)?(a=v,l=g-O):(O<g||v.flags&16&&!v.isHidden)&&(i=v,s=g-O)),O=x}}u(this,e);let d=(n<0?i:a)||i||a;return d?{tile:d,offset:d==i?s:l}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):Ree(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new os(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:n);let a=r.tile.parent,l=!1;for(let u of a.children){if(l)return new os(u.dom,0);u==r.tile&&(l=!0)}}return new os(this.dom,0)}}function Ree(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Om(e);return n[n.length-1]||null}function Aee(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class Xr extends Cy{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new Xr(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class kl extends Rn{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,s=e,a=0;e==0&&n<0||e==r&&n>=0?xe.chrome||xe.gecko||(e?(i--,a=1):s<r&&(s++,a=-1)):n<0?i--:s<r&&s++;let l=rh(this.dom,i,s).getClientRects();if(!l.length)return null;let u=l[(a?a<0:n>=0)?0:l.length-1];return xe.safari&&!a&&u.width==0&&(u=Array.prototype.find.call(l,d=>d.width)||u),a?sO(u,a<0):u||null}static of(e,n){let r=new kl(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class Xl extends Rn{constructor(e,n,r,i){super(e,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return sO(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let u=l?s.length-1:0;a=s[u],!(e>0?u==0:u==s.length-1||a.top<a.bottom);u+=l?-1:1);return sO(a,!l)}}get overrideDOMText(){if(!this.length)return pt.empty;let{root:e}=this;if(!e)return pt.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,i,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new Xl(s,r,e,i)}}class aO extends Rn{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return pt.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class Pee{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:s,beforeBreak:a,parents:l}=this;for(;e||n>0;)if(i.isComposite())if(a){if(!e)break;r&&r.break(),e--,a=!1}else if(s==i.children.length){if(!e&&!l.length)break;r&&r.leave(i),a=!!i.breakAfter,{tile:i,index:s}=l.pop(),s++}else{let u=i.children[s],d=u.breakAfter;(n>0?u.length<=e:u.length<e)&&(!r||r.skip(u,0,u.length)!==!1||!u.isComposite)?(a=!!d,s++,e-=u.length):(l.push({tile:i,index:s}),i=u,s=0,r&&u.isComposite()&&r.enter(u))}else if(s==i.length)a=!!i.breakAfter,{tile:i,index:s}=l.pop(),s++;else if(e){let u=Math.min(e,i.length-s);r&&r.skip(i,s,s+u),e-=u,s+=u}else break;return this.tile=i,this.index=s,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class _ee{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class $ee{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var s;this.flushBuffer();let a=this.ensureMarks(n,r),l=a.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let u=a.children[a.children.length-1]=new kl(l.dom,l.text+e);u.parent=a}else a.append(i||kl.of(e,(s=this.cache.find(kl))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?sx(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let l=n.marks.length-1;l>=0;l--){let u=n.marks[l],d=i.lastChild;if(d instanceof Xr&&d.mark.eq(u.mark))d.dom!=u.dom&&d.setDOM(sx(u.dom)),i=d;else{if(this.cache.reused.get(u)){let g=Rn.get(u.dom);g&&g.setDOM(sx(u.dom))}let h=Xr.of(u.mark,u.dom);i.append(h),i=h}this.cache.reused.set(u,2)}let s=Rn.get(e.text);s&&this.cache.reused.set(s,2);let a=new kl(e.text,e.text.nodeValue);a.flags|=8,i.append(a)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(n,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=Zz);let i=xu.start(e,n||((r=this.cache.find(xu))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let a=e[s],l;if(n>0&&(l=i.lastChild)&&l instanceof Xr&&l.mark.eq(a))i=l,n--;else{let u=Xr.of(a,(r=this.cache.find(Xr,d=>d.mark.eq(a)))===null||r===void 0?void 0:r.dom);i.append(u),i=u,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!IP(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(xe.ios&&IP(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(ox,0,32)||new Xl(ox.toDOM(),0,ox,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new _ee(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof _a&&i.wrapper.eq(r.wrapper))n=i;else{let s=_a.of(r.wrapper,(e=this.cache.find(_a,a=>a.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(aO,void 0,1);return r&&(r.flags=n),r||new aO(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Mee{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=i;let l=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,l)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const lO=[Xl,xu,kl,Xr,aO,_a,Ty];for(let t=0;t<lO.length;t++)lO[t].bucket=t;class Dee{constructor(e){this.view=e,this.buckets=lO.map(()=>[]),this.index=lO.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,s=this.buckets[i],a=this.index[i];for(let l=s.length-1;l>=0;l--){let u=(l+a)%s.length,d=s[u];if((!n||n(d))&&!this.reused.has(d))return s.splice(u,1),u<a&&this.index[i]--,this.reused.set(d,r),d}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let s=0,a=0;;s++){if(s==i.length){if(a)return null;a=1,s=0}let l=i[s];if(!this.reused.has(l)&&(a==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==n&&(l.flags&497)==r?(this.reused.set(l,1),l):(this.reused.set(l,2),new Xl(l.dom,n,e,l.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class Nee{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new Dee(e),this.text=new Mee(e.state.doc),this.builder=new $ee(this.cache,new Ty(e,e.contentDOM),at.iter(r)),this.cache.reused.set(n,2),this.old=new Pee(n),this.reuseWalker={skip:(a,l,u)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,s=0,a=0;;){let l=a<e.length?e[a++]:null,u=l?l.fromA:this.old.root.length;if(u>i){let d=u-i;this.preserve(d,!a,!l),i=u,s+=d}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,l.toA),this.emit(n.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,i=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=jee(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(a,l,u)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(u-l);else{let d=u>0||l<a.length?Xl.of(a.widget,this.view,u-l,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,i,s),s=i.length)}else if(a.isText())this.builder.ensureLine(null),!l&&u==a.length?this.builder.addText(a.text,i,s,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(l,u),i,s)),s=i.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof aO)this.cache.add(a);else if(a instanceof Xr)this.builder.ensureLine(null),this.builder.addMark(a,i,s),this.cache.reused.set(a,1),s=i.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof Xr&&i.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?i.length&&(i.length=s=0):a instanceof Xr&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,s=0,a=at.spans(this.decorations,e,n,{point:(l,u,d,h,g,m)=>{if(d instanceof Il){if(this.disallowBlockEffectsFor[m]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(u>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=h.length,g>h.length)i.continueWidget(u-l);else{let O=d.widget||(d.block?Su.block:Su.inline),v=Lee(d),x=this.cache.findWidget(O,u-l,v)||Xl.of(O,this.view,u-l,v);d.block?(d.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(x)):(i.ensureLine(r),i.addInlineWidget(x,h,g))}r=null}else r=zee(r,d);u>l&&this.text.skip(u-l)},span:(l,u,d,h)=>{for(let g=l;g<u;){let m=this.text.next(Math.min(512,u-g));m==null?(i.addLineStartIfNotCovered(r),i.addBreak(),g++):(i.ensureLine(r),i.addText(m,d,g==l?h:d.length),g+=m.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=a>s,this.openMarks=a}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=Rn.get(i);if(i==this.view.contentDOM)break;s instanceof Xr?n.push(s):s!=null&&s.isLine()?r=s:i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new xu(i,Zz):n.push(Xr.of(new Ih({tagName:i.nodeName.toLowerCase(),attributes:cee(i)}),i))}return{line:r,marks:n}}}function IP(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function Lee(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const Zz={class:"cm-line"};function zee(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&tk(n,t),r&&(t.class+=" "+r)),t}function jee(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof Xr&&e.push(r.mark)}return e}function sx(t){let e=Rn.get(t);return e&&e.setDOM(t.cloneNode()),t}class Su extends qu{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Su.inline=new Su("span");Su.block=new Su("div");const ox=new class extends qu{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class ZP{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=At.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Ty(e,e.contentDOM),this.updateInner([new Ii(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:h,toA:g})=>g<this.minWidthFrom||h>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!Gee(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?Zee(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:g}=this.hasComposition;r=new Ii(h,g,e.changes.mapPos(h,-1),e.changes.mapPos(g,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(xe.ie||xe.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,l=this.blockWrappers;this.updateDeco();let u=Uee(a,this.decorations,e.changes);u.length&&(r=Ii.extendWithRanges(r,u));let d=qee(l,this.blockWrappers,e.changes);return d.length&&(r=Ii.extendWithRanges(r,d)),s&&!r.some(h=>h.fromA<=s.range.fromA&&h.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let a=this.tile,l=new Nee(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=l.run(e,n),YS(a,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=xe.chrome||xe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof ax&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(Dz)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,a=!s&&!(this.view.state.facet(ko)||r.tabIndex>-1)&&$d(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||a))return;let l=this.forceSelection;this.forceSelection=!1;let u=this.view.state.selection.main,d,h;if(u.empty?h=d=this.inlineDOMNearPos(u.anchor,u.assoc||1):(h=this.inlineDOMNearPos(u.head,u.head==u.from?1:-1),d=this.inlineDOMNearPos(u.anchor,u.anchor==u.from?1:-1)),xe.gecko&&u.empty&&!this.hasComposition&&Iee(d)){let m=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(m,d.node.childNodes[d.offset]||null)),d=h=new os(m,0),l=!0}let g=this.view.observer.selectionRange;(l||!g.focusNode||(!Md(d.node,d.offset,g.anchorNode,g.anchorOffset)||!Md(h.node,h.offset,g.focusNode,g.focusOffset))&&!this.suppressWidgetCursorChange(g,u))&&(this.view.observer.ignore(()=>{xe.android&&xe.chrome&&r.contains(g.focusNode)&&Yee(g.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let m=vu(this.view.root);if(m)if(u.empty){if(xe.gecko){let O=Xee(d.node,d.offset);if(O&&O!=3){let v=(O==1?vz:xz)(d.node,d.offset);v&&(d=new os(v.node,v.offset))}}m.collapse(d.node,d.offset),u.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=u.bidiLevel)}else if(m.extend){m.collapse(d.node,d.offset);try{m.extend(h.node,h.offset)}catch{}}else{let O=document.createRange();u.anchor>u.head&&([d,h]=[h,d]),O.setEnd(h.node,h.offset),O.setStart(d.node,d.offset),m.removeAllRanges(),m.addRange(O)}a&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(d,h)),this.impreciseAnchor=d.precise?null:new os(g.anchorNode,g.anchorOffset),this.impreciseHead=h.precise?null:new os(g.focusNode,g.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Md(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=vu(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let l=a.posAtStart;if(n.head==l||n.head==l+a.length)return;let u=this.coordsAt(n.head,-1),d=this.coordsAt(n.head,1);if(!u||!d||u.bottom>d.top)return;let h=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(h.node,h.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let g=e.observer.selectionRange;e.docView.posFromDOM(g.anchorNode,g.anchorOffset)!=n.from&&r.collapse(i,s)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[n];else{let a=zo(e)==0?0:n==0?-1:1;for(;;){let l=e.parentNode;if(l==r.dom)break;a==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?a=-1:a=1),e=l}a<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!Rn.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let a=0,l=i;;a++){let u=r.children[a];if(u.dom==s)return l;l+=u.length+u.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,s=!1,a,l=-1,u=!1;return this.tile.blockTiles((d,h)=>{if(d.isWidget()){if(d.flags&32&&h>=e)return!0;d.flags&16&&(s=!0)}else{let g=h+d.length;if(h<=e&&(r=d,i=e-h,s=g<e),g>=e&&!a&&(a=d,l=e-h,u=h>e),h>e&&a)return!0}}),!r&&!a?this.domAtPos(e,n):(s&&a?r=null:u&&r&&(a=null),r&&n<0||!a?r.domIn(i,n):a.domIn(l,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof ax?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(s,a){if(s.isComposite())for(let l of s.children){if(l.length>=a){let u=i(l,a);if(u)return u}if(a-=l.length,a<0)break}else if(s.isText()&&a<s.length){let l=sr(s.text,a);if(l==a)return null;let u=rh(s.dom,a,l).getClientRects();for(let d=0;d<u.length;d++){let h=u[d];if(d==u.length-1||h.top<h.bottom&&h.left<h.right)return h}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,a=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,u=this.view.textDirection==xn.LTR,d=0,h=(g,m,O)=>{for(let v=0;v<g.children.length&&!(m>i);v++){let x=g.children[v],k=m+x.length,C=x.dom.getBoundingClientRect(),{height:Q}=C;if(O&&!v&&(d+=C.top-O.top),x instanceof _a)k>r&&h(x,m,C);else if(m>=r&&(d>0&&n.push(-d),n.push(Q+d),d=0,a)){let R=x.dom.lastChild,E=R?Om(R):[];if(E.length){let P=E[E.length-1],$=u?P.right-C.left:C.right-P.left;$>l&&(l=$,this.minWidth=s,this.minWidthFrom=m,this.minWidthTo=k)}}O&&v==g.children.length-1&&(d+=O.bottom-C.bottom),m=k+x.breakAfter}};return h(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?xn.RTL:xn.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let l=0,u;for(let d of a.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let h=Om(d.dom);if(h.length!=1)return;l+=h[0].width,u=h[0].height}if(l)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:l/a.length,textHeight:u}}});if(e)return e;let n=document.createElement("div"),r,i,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=Om(n.firstChild)[0];r=n.getBoundingClientRect().height,i=a&&a.width?a.width/27:7,s=a&&a.height?a.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],a=s?s.from-1:this.view.state.doc.length;if(a>r){let l=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(At.replace({widget:new ax(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!s)break;r=s.to+1}return At.set(e)}updateDeco(){let e=1,n=this.view.state.facet(ky).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(ak).map((s,a)=>{let l=typeof s=="function";return l&&(r=!0),l?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(at.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(Lz).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet(Mz))try{if(d(this.view,e.range,e))return!0}catch(h){Is(this.view.state,h,"scroll handler")}let{range:n}=e,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let s=Iz(this.view),a={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:l,offsetHeight:u}=this.view.scrollDOM;dee(this.view.scrollDOM,a,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,u),-u),this.view.textDirection==xn.LTR)}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){YS(this.tile)}}function YS(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)YS(r,e)}}function Iee(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function Xz(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=vz(n.focusNode,n.focusOffset),i=xz(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let l=Rn.get(i.node);if(!l||l.isText()&&l.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let u=Rn.get(r.node);!u||u.isText()&&u.text!=r.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=r,!s)return null;let a=e-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function Zee(t,e,n){let r=Xz(t,n);if(!r)return null;let{node:i,from:s,to:a}=r,l=i.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(r.from,r.to)!=l)return null;let u=e.invertedDesc;return{range:new Ii(u.mapPos(s),u.mapPos(a),s,a),text:i}}function Xee(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let Bee=class{constructor(){this.changes=[]}compareRange(e,n){iu(e,n,this.changes)}comparePoint(e,n){iu(e,n,this.changes)}boundChange(e){iu(e,e,this.changes)}};function Uee(t,e,n){let r=new Bee;return at.compare(t,e,n,r),r.changes}class Vee{constructor(){this.changes=[]}compareRange(e,n){iu(e,n,this.changes)}comparePoint(){}boundChange(e){iu(e,e,this.changes)}}function qee(t,e,n){let r=new Vee;return at.compare(t,e,n,r),r.changes}function Yee(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function Gee(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class ax extends qu{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function Wee(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return le.cursor(e);s==0?n=1:s==i.length&&(n=-1);let a=s,l=s;n<0?a=sr(i.text,s,!1):l=sr(i.text,s);let u=r(i.text.slice(a,l));for(;a>0;){let d=sr(i.text,a,!1);if(r(i.text.slice(d,a))!=u)break;a=d}for(;l<i.length;){let d=sr(i.text,l);if(r(i.text.slice(l,d))!=u)break;l=d}return le.range(a+i.from,l+i.from)}function Fee(t,e,n,r,i){let s=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,u=Math.floor((i-n.top-(t.defaultLineHeight-l)*.5)/l);s+=u*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+BJ(a,s,t.state.tabSize)}function Hee(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==Vr.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function Kee(t,e,n,r){let i=Hee(t,e.head,e.assoc||-1),s=!r||i.type!=Vr.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let a=t.dom.getBoundingClientRect(),l=t.textDirectionAt(i.from),u=t.posAtCoords({x:n==(l==xn.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(u!=null)return le.cursor(u,n?-1:1)}return le.cursor(n?i.to:i.from,n?-1:1)}function XP(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),a=t.textDirectionAt(i.from);for(let l=e,u=null;;){let d=kee(i,s,a,l,n),h=Tz;if(!d){if(i.number==(n?t.state.doc.lines:1))return l;h=`
295
+ `,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),d=t.visualLineSide(i,!n)}if(u){if(!u(h))return l}else{if(!r)return d;u=r(h)}l=d}}function Jee(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let a=r(s);return i==Qo.Space&&(i=a),i==a}}function ete(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return le.cursor(i,e.assoc);let a=e.goalColumn,l,u=t.contentDOM.getBoundingClientRect(),d=t.coordsAtPos(i,(e.empty?e.assoc:0)||(n?1:-1)),h=t.documentTop;if(d)a==null&&(a=d.left-u.left),l=s<0?d.top:d.bottom;else{let v=t.viewState.lineBlockAt(i);a==null&&(a=Math.min(u.right-u.left,t.defaultCharacterWidth*(i-v.from))),l=(s<0?v.top:v.bottom)+h}let g=u.left+a,m=r??t.viewState.heightOracle.textHeight>>1,O=GS(t,{x:g,y:l+m*s},!1,s);return le.cursor(O.pos,O.assoc,void 0,a)}function Dd(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(s,a,l)=>{if(e>s&&e<a){let u=r||n||(e-s<a-e?-1:1);e=u<0?s:a,r=u}});if(!r)return e}}function Bz(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let a=Dd(t,i.from,0);a!=i.from&&(s=le.cursor(a,-1))}else{let a=Dd(t,i.from,-1),l=Dd(t,i.to,1);(a!=i.from||l!=i.to)&&(s=le.range(i.from==i.anchor?a:l,i.from==i.head?a:l))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?le.create(n,e.mainIndex):e}function lx(t,e,n){let r=Dd(t.state.facet(Xh).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:le.cursor(r,r<n.from?1:-1)}class Ls{constructor(e,n){this.pos=e,this.assoc=n}}function GS(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),s=i.top+t.viewState.paddingTop,{x:a,y:l}=e,u=l-s,d;for(;;){if(u<0)return new Ls(0,1);if(u>t.viewState.docHeight)return new Ls(t.state.doc.length,-1);if(d=t.elementAtHeight(u),r==null)break;if(d.type==Vr.Text){if(r<0?d.to<t.viewport.from:d.from>t.viewport.to)break;let m=t.docView.coordsAt(r<0?d.from:d.to,r>0?-1:1);if(m&&(r<0?m.top<=u+s:m.bottom>=u+s))break}let g=t.viewState.heightOracle.textHeight/2;u=r>0?d.bottom+g:d.top-g}if(t.viewport.from>=d.to||t.viewport.to<=d.from){if(n)return null;if(d.type==Vr.Text){let g=Fee(t,i,d,a,l);return new Ls(g,g==d.from?1:-1)}}if(d.type!=Vr.Text)return u<(d.top+d.bottom)/2?new Ls(d.from,1):new Ls(d.to,-1);let h=t.docView.lineAt(d.from,2);return(!h||h.length!=d.length)&&(h=t.docView.lineAt(d.from,-2)),Uz(t,h,d.from,a,l)}function Uz(t,e,n,r,i){let s=-1,a=null,l=1e9,u=1e9,d=i,h=i,g=(m,O)=>{for(let v=0;v<m.length;v++){let x=m[v];if(x.top==x.bottom)continue;let k=x.left>r?x.left-r:x.right<r?r-x.right:0,C=x.top>i?x.top-i:x.bottom<i?i-x.bottom:0;x.top<=h&&x.bottom>=d&&(d=Math.min(x.top,d),h=Math.max(x.bottom,h),C=0),(s<0||(C-u||k-l)<0)&&(s>=0&&u&&l<k&&a.top<=h-2&&a.bottom>=d+2?u=0:(s=O,l=k,u=C,a=x))}};if(e.isText()){for(let O=0;O<e.length;){let v=sr(e.text,O);if(g(rh(e.dom,O,v).getClientRects(),O),!l&&!u)break;O=v}return r>(a.left+a.right)/2==(BP(t,s+n)==xn.LTR)?new Ls(n+sr(e.text,s),-1):new Ls(n+s,1)}else{if(!e.length)return new Ls(n,1);for(let x=0;x<e.children.length;x++){let k=e.children[x];if(k.flags&48)continue;let C=(k.dom.nodeType==1?k.dom:rh(k.dom,0,k.length)).getClientRects();if(g(C,x),!l&&!u)break}let m=e.children[s],O=e.posBefore(m,n);return m.isComposite()||m.isText()?Uz(t,m,O,Math.max(a.left,Math.min(a.right,r)),i):r>(a.left+a.right)/2==(BP(t,s+n)==xn.LTR)?new Ls(O+m.length,-1):new Ls(O,1)}}function BP(t,e){let n=t.state.doc.lineAt(e);return t.bidiSpans(n)[Eo.find(t.bidiSpans(n),e-n.from,-1,1)].dir}const xd="￿";class tte{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(wt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=xd}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let a=Rn.get(i),l=i.nextSibling;if(l==n){a!=null&&a.breakAfter&&!l&&r!=this.view.contentDOM&&this.lineBreak();break}let u=Rn.get(l);(a&&u?a.breakAfter:(a?a.breakAfter:iO(i))||iO(l)&&(i.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>s)&&!rte(l,n)&&this.lineBreak(),i=l}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(l=i.exec(n))&&(s=l.index,a=l[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=a-1);r=s+a}}readNode(e){let n=Rn.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(nte(e,r.node,r.offset)?n:0))}}function nte(t,e,n){for(;;){if(!e||n<zo(e))return!1;if(e==t)return!0;n=Za(e)+1,e=e.parentNode}}function rte(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=Rn.get(t);if(!(r!=null&&r.isWidget()))return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i!=null&&i.length)return!1}return!0}class UP{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class ite{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=Vz(e.docView.tile,n,r,0))){let l=s||a?[]:ote(e),u=new tte(l,e);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=ate(l,this.bounds.from)}else{let l=e.observer.selectionRange,u=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!XS(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),d=a&&a.node==l.anchorNode&&a.offset==l.anchorOffset||!XS(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((xe.ios||xe.chrome)&&e.state.selection.main.empty&&u!=d&&(h.from>0||h.to<e.state.doc.length)){let g=Math.min(u,d),m=Math.max(u,d),O=h.from-g,v=h.to-m;(O==0||O==1||g==0)&&(v==0||v==-1||m==e.state.doc.length)&&(u=0,d=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(le.range(d,u)):this.newSel=le.single(d,u)}}}function Vz(t,e,n,r){if(t.isComposite()){let i=-1,s=-1,a=-1,l=-1;for(let u=0,d=r,h=r;u<t.children.length;u++){let g=t.children[u],m=d+g.length;if(d<e&&m>n)return Vz(g,e,n,d);if(m>=e&&i==-1&&(i=u,s=d),d>n&&g.dom.parentNode==t.dom){a=u,l=h;break}h=m,d=m+g.breakAfter}return{from:s,to:l<0?r+t.length:l,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function qz(t,e){let n,{newSel:r}=e,i=t.state.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:l}=e.bounds,u=i.from,d=null;(s===8||xe.android&&e.text.length<l-a)&&(u=i.to,d="end");let h=Yz(t.state.doc.sliceString(a,l,xd),e.text,u-a,d);h&&(xe.chrome&&s==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==xd+xd&&h.toB--,n={from:a+h.from,to:a+h.toA,insert:pt.of(e.text.slice(h.from,h.toB).split(xd))})}else r&&(!t.hasFocus&&t.state.facet(ko)||cO(r,i))&&(r=null);if(!n&&!r)return!1;if(!n&&e.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,i.to)}:(xe.mac||xe.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=le.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:pt.of([n.insert.toString().replace("."," ")])}):n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:t.state.doc.lineAt(i.from).to<i.to&&t.docView.lineHasWidget(i.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:i.from,to:i.to,insert:t.state.toText(t.inputState.insertingText)}:xe.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
296
+ `&&t.lineWrapping&&(r&&(r=le.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:pt.of([" "])}),n)return lk(t,n,r,s);if(r&&!cO(r,i)){let a=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=Bz(t.state.facet(Xh).map(u=>u(t)),r))),t.dispatch({selection:r,scrollIntoView:a,userEvent:l}),!0}else return!1}function lk(t,e,n,r=-1){if(xe.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(xe.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&su(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&su(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&su(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,l=()=>a||(a=ste(t,e,n));return t.state.facet(Pz).some(u=>u(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function ste(t,e,n){let r,i=t.state,s=i.selection.main,a=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let u=e.from<s.from?-1:1,d=u<0?s.from:s.to,h=Dd(i.facet(Xh).map(g=>g(t)),d,u);e.from==h&&(a=h)}if(a>-1)r={changes:e,selection:le.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let u=s.from<e.from?i.sliceDoc(s.from,e.from):"",d=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(u+e.insert.sliceString(0,void 0,t.state.lineBreak)+d))}else{let u=i.changes(e),d=n&&n.main.to<=u.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let h=t.state.sliceDoc(e.from,e.to),g,m=n&&Xz(t,n.main.head);if(m){let v=e.insert.length-(e.to-e.from);g={from:m.from,to:m.to-v}}else g=t.state.doc.lineAt(s.head);let O=s.to-e.to;r=i.changeByRange(v=>{if(v.from==s.from&&v.to==s.to)return{changes:u,range:d||v.map(u)};let x=v.to-O,k=x-h.length;if(t.state.sliceDoc(k,x)!=h||x>=g.from&&k<=g.to)return{range:v};let C=i.changes({from:k,to:x,insert:e.insert}),Q=v.to-s.to;return{changes:C,range:d?le.range(Math.max(0,d.anchor+Q),Math.max(0,d.head+Q)):v.map(C)}})}else r={changes:u,selection:d&&i.selection.replaceRange(d)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:l,scrollIntoView:!0})}function Yz(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&t.length==e.length)return null;let a=t.length,l=e.length;for(;a>0&&l>0&&t.charCodeAt(a-1)==e.charCodeAt(l-1);)a--,l--;if(r=="end"){let u=Math.max(0,s-Math.min(a,l));n-=a+u-s}if(a<s&&t.length<e.length){let u=n<=s&&n>=a?s-n:0;s-=u,l=s+(l-a),a=s}else if(l<s){let u=n<=s&&n>=l?s-n:0;s-=u,a=s+(a-l),l=s}return{from:s,toA:a,toB:l}}function ote(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new UP(n,r)),(i!=n||s!=r)&&e.push(new UP(i,s))),e}function ate(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?le.single(n+e,r+e):null}function cO(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class lte{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,xe.safari&&e.contentDOM.addEventListener("input",()=>null),xe.gecko&&wte(e.contentDOM.ownerDocument)}handleEvent(e){!mte(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=cte(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let a=!n[s].handlers.length,l=r[s];l&&a!=!l.handlers.length&&(i.removeEventListener(s,this.handleEvent),l=null),l||i.addEventListener(s,this.handleEvent,{passive:a})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Wz.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),xe.android&&xe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return xe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=Gz.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||ute.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,su(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:xe.safari&&!xe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function VP(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Is(n.state,i)}}}function cte(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,a=i&&i.plugin.domEventObservers;if(s)for(let l in s){let u=s[l];u&&n(l).handlers.push(VP(r.value,u))}if(a)for(let l in a){let u=a[l];u&&n(l).observers.push(VP(r.value,u))}}for(let r in ds)n(r).handlers.push(ds[r]);for(let r in qi)n(r).observers.push(qi[r]);return e}const Gz=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ute="dthko",Wz=[16,17,18,20,91,92,224,225],zg=6;function jg(t){return Math.max(0,t)*.7+8}function fte(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class dte{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=hee(e.contentDOM),this.atoms=e.state.facet(Xh).map(a=>a(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(wt.allowMultipleSelections)&&hte(e,n),this.dragging=gte(e,n)&&Kz(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&fte(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let u=Iz(this.view);e.clientX-u.left<=i+zg?n=-jg(i-e.clientX):e.clientX+u.right>=a-zg&&(n=jg(e.clientX-a)),e.clientY-u.top<=s+zg?r=-jg(s-e.clientY):e.clientY+u.bottom>=l-zg&&(r=jg(e.clientY-l)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=Bz(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function hte(t,e){let n=t.state.facet(Qz);return n.length?n[0](e):xe.mac?e.metaKey:e.ctrlKey}function pte(t,e){let n=t.state.facet(Ez);return n.length?n[0](e):xe.mac?!e.altKey:!e.ctrlKey}function gte(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=vu(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let a=i[s];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function mte(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Rn.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const ds=Object.create(null),qi=Object.create(null),Fz=xe.ie&&xe.ie_version<15||xe.ios&&xe.webkit_version<604;function Ote(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),Hz(t,n.value)},50)}function Qy(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function Hz(t,e){e=Qy(t.state,ik,e);let{state:n}=t,r,i=1,s=n.toText(e),a=s.lines==n.selection.ranges.length;if(WS!=null&&n.selection.ranges.every(u=>u.empty)&&WS==s.toString()){let u=-1;r=n.changeByRange(d=>{let h=n.doc.lineAt(d.from);if(h.from==u)return{range:d};u=h.from;let g=n.toText((a?s.line(i++).text:e)+n.lineBreak);return{changes:{from:h.from,insert:g},range:le.cursor(d.from+g.length)}})}else a?r=n.changeByRange(u=>{let d=s.line(i++);return{changes:{from:u.from,to:u.to,insert:d.text},range:le.cursor(u.from+d.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}qi.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};ds.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);qi.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};qi.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};ds.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(Rz))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=bte(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new dte(t,e,n,r)),r&&t.observer.ignore(()=>{yz(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function qP(t,e,n,r){if(r==1)return le.cursor(e,n);if(r==2)return Wee(t.state,e,n);{let i=t.docView.lineAt(e,n),s=t.state.doc.lineAt(i?i.posAtEnd:e),a=i?i.posAtStart:s.from,l=i?i.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,le.range(a,l)}}const yte=xe.ie&&xe.ie_version<=11;let YP=null,GP=0,WP=0;function Kz(t){if(!yte)return t.detail;let e=YP,n=WP;return YP=t,WP=Date.now(),GP=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(GP+1)%3:1}function bte(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=Kz(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,a,l){let u=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),d,h=qP(t,u.pos,u.assoc,r);if(n.pos!=u.pos&&!a){let g=qP(t,n.pos,n.assoc,r),m=Math.min(g.from,h.from),O=Math.max(g.to,h.to);h=m<h.from?le.range(m,O):le.range(O,m)}return a?i.replaceRange(i.main.extend(h.from,h.to)):l&&r==1&&i.ranges.length>1&&(d=vte(i,u.pos))?d:l?i.addRange(h):le.create([h])}}}function vte(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return le.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}ds.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,a=s+i.length;(s>=n.to||a<=n.from)&&(n=le.range(s,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Qy(t.state,sk,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ds.dragend=t=>(t.inputState.draggedContent=null,!1);function FP(t,e,n,r){if(n=Qy(t.state,ik,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,a=r&&s&&pte(t,e)?{from:s.from,to:s.to}:null,l={from:i,insert:n},u=t.state.changes(a?[a,l]:l);t.focus(),t.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}ds.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&FP(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a<n.length;a++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(r[a]=l.result),s()},l.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return FP(t,e,r,!0),!0}return!1};ds.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=Fz?null:e.clipboardData;return n?(Hz(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(Ote(t),!1)};function xte(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function Ste(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let a=t.doc.lineAt(s);a.number>i&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),i=a.number}r=!0}return{text:Qy(t,sk,e.join(t.lineBreak)),ranges:n,linewise:r}}let WS=null;ds.copy=ds.cut=(t,e)=>{let n=vu(t.root);if(n&&!$d(t.contentDOM,n))return!1;let{text:r,ranges:i,linewise:s}=Ste(t.state);if(!r&&!s)return!1;WS=s?r:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let a=Fz?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",r),!0):(xte(t,r),!1)};const Jz=Xo.define();function ej(t,e){let n=[];for(let r of t.facet(_z)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:Jz.of(!0)}):null}function tj(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=ej(t.state,e);n?t.dispatch(n):t.update([])}},10)}qi.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),tj(t)};qi.blur=t=>{t.observer.clearSelectionRange(),tj(t)};qi.compositionstart=qi.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};qi.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,xe.chrome&&xe.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};qi.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};ds.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(s&&a.length){let l=a[0],u=t.posAtDOM(l.startContainer,l.startOffset),d=t.posAtDOM(l.endContainer,l.endOffset);return lk(t,{from:u,to:d,insert:t.state.toText(s)},null),!0}}let i;if(xe.chrome&&xe.android&&(i=Gz.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return xe.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),xe.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>qi.compositionend(t,e),20),!1};const HP=new Set;function wte(t){HP.has(t)||(HP.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const KP=["pre-wrap","normal","pre-line","break-spaces"];let wu=!1;function JP(){wu=!1}class kte{constructor(e){this.lineWrapping=e,this.doc=pt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return KP.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,s,a){let l=KP.indexOf(e)>-1,u=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,u){this.heightSamples={};for(let d=0;d<a.length;d++){let h=a[d];h<0?d++:this.heightSamples[Math.floor(h*10)]=!0}}return u}}class Cte{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class is{constructor(e,n,r,i,s){this.from=e,this.length=n,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?Vr.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Il?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new is(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Ft=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Ft||(Ft={}));const ym=.001;class Tr{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ym&&(wu=!0),this.height=e)}replace(e,n,r){return Tr.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,a=r.doc;for(let l=i.length-1;l>=0;l--){let{fromA:u,toA:d,fromB:h,toB:g}=i[l],m=s.lineAt(u,Ft.ByPosNoHeight,r.setDoc(n),0,0),O=m.to>=d?m:s.lineAt(d,Ft.ByPosNoHeight,r,0,0);for(g+=O.to-d,d=O.to;l>0&&m.from<=i[l-1].toA;)u=i[l-1].fromA,h=i[l-1].fromB,l--,u<m.from&&(m=s.lineAt(u,Ft.ByPosNoHeight,r,0,0));h+=m.from-u,u=m.from;let v=ck.build(r.setDoc(a),e,h,g);s=uO(s,s.replace(u,d,v))}return s.updateHeight(r,0)}static empty(){return new ai(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,s=0;for(;;)if(n==r)if(i>s*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),r+=1+l.break,i-=l.size}else if(s>i*2){let l=e[r];l.break?e.splice(r,1,l.left,null,l.right):e.splice(r,1,l.left,l.right),r+=2+l.break,s-=l.size}else break;else if(i<s){let l=e[n++];l&&(i+=l.size)}else{let l=e[--r];l&&(s+=l.size)}let a=0;return e[n-1]==null?(a=1,n--):e[n]==null&&(a=1,r++),new Qte(Tr.of(e.slice(0,n)),a,Tr.of(e.slice(r)))}}function uO(t,e){return t==e?t:(t.constructor!=e.constructor&&(wu=!0),e)}Tr.prototype.size=1;const Tte=At.replace({});class nj extends Tr{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new is(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new is(i,0,r,this.spaceAbove,Tte):this.mainBlock(r,i)}lineAt(e,n,r,i,s){let a=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(a):a}forEachLine(e,n,r,i,s,a){e<=s+this.length&&n>=s&&a(this.lineAt(0,Ft.ByPos,r,i,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ai extends nj{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new is(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof ai||i instanceof rr&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof rr?i=new ai(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Tr.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class rr extends Tr{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,a,l=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*s);a=u/s,this.length>s+1&&(l=(this.height-u)/(this.length-s-1))}else a=this.height/s;return{firstLine:r,lastLine:i,perLine:a,perChar:l}}blockAt(e,n,r,i){let{firstLine:s,lastLine:a,perLine:l,perChar:u}=this.heightMetrics(n,i);if(n.lineWrapping){let d=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),h=n.doc.lineAt(d),g=l+h.length*u,m=Math.max(r,e-g/2);return new is(h.from,h.length,m,g,0)}else{let d=Math.max(0,Math.min(a-s,Math.floor((e-r)/l))),{from:h,length:g}=n.doc.line(s+d);return new is(h,g,r+l*d,l,0)}}lineAt(e,n,r,i,s){if(n==Ft.ByHeight)return this.blockAt(e,r,i,s);if(n==Ft.ByPosNoHeight){let{from:O,to:v}=r.doc.lineAt(e);return new is(O,v-O,0,0,0)}let{firstLine:a,perLine:l,perChar:u}=this.heightMetrics(r,s),d=r.doc.lineAt(e),h=l+d.length*u,g=d.number-a,m=i+l*g+u*(d.from-s-g);return new is(d.from,d.length,Math.max(i,Math.min(m,i+this.height-h)),h,0)}forEachLine(e,n,r,i,s,a){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:l,perLine:u,perChar:d}=this.heightMetrics(r,s);for(let h=e,g=i;h<=n;){let m=r.doc.lineAt(h);if(h==e){let v=m.number-l;g+=u*v+d*(e-s-v)}let O=u+d*m.length;a(new is(m.from,m.length,g,O,0)),g+=O,h=m.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let s=r[r.length-1];s instanceof rr?r[r.length-1]=new rr(s.length+i):r.push(null,new rr(i-1))}if(e>0){let s=r[0];s instanceof rr?r[0]=new rr(e+s.length):r.unshift(new rr(e-1),null)}return Tr.of(r)}decomposeLeft(e,n){n.push(new rr(e-1),null)}decomposeRight(e,n){n.push(null,new rr(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let a=[],l=Math.max(n,i.from),u=-1;for(i.from>n&&a.push(new rr(i.from-n-1).updateHeight(e,n));l<=s&&i.more;){let h=e.doc.lineAt(l).length;a.length&&a.push(null);let g=i.heights[i.index++],m=0;g<0&&(m=-g,g=i.heights[i.index++]),u==-1?u=g:Math.abs(g-u)>=ym&&(u=-2);let O=new ai(h,g,m);O.outdated=!1,a.push(O),l+=h+1}l<=s&&a.push(null,new rr(s-l).updateHeight(e,l));let d=Tr.of(a);return(u<0||Math.abs(d.height-this.height)>=ym||Math.abs(u-this.heightMetrics(e,n).perLine)>=ym)&&(wu=!0),uO(this,d)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Qte extends Tr{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,s,i+this.left.length+this.break)}lineAt(e,n,r,i,s){let a=i+this.left.height,l=s+this.left.length+this.break,u=n==Ft.ByHeight?e<a:e<l,d=u?this.left.lineAt(e,n,r,i,s):this.right.lineAt(e,n,r,a,l);if(this.break||(u?d.to<l:d.from>l))return d;let h=n==Ft.ByPosNoHeight?Ft.ByPosNoHeight:Ft.ByPos;return u?d.join(this.right.lineAt(l,h,r,a,l)):this.left.lineAt(l,h,r,i,s).join(d)}forEachLine(e,n,r,i,s,a){let l=i+this.left.height,u=s+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,n,r,i,s,a),n>=u&&this.right.forEachLine(e,n,r,l,u,a);else{let d=this.lineAt(u,Ft.ByPos,r,i,s);e<d.from&&this.left.forEachLine(e,d.from-1,r,i,s,a),d.to>=e&&d.from<=n&&a(d),n>d.to&&this.right.forEachLine(d.to+1,n,r,l,u,a)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let a=s.length;for(let l of r)s.push(l);if(e>0&&e_(s,a-1),n<this.length){let l=s.length;this.decomposeRight(n,s),e_(s,l)}return Tr.of(s)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?Tr.of(this.break?[e,null,n]:[e,n]):(this.left=uO(this.left,e),this.right=uO(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:s,right:a}=this,l=n+s.length+this.break,u=null;return i&&i.from<=n+s.length&&i.more?u=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=l+a.length&&i.more?u=a=a.updateHeight(e,l,r,i):a.updateHeight(e,l,r),u?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function e_(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof rr&&(r=t[e+1])instanceof rr&&t.splice(e-1,3,new rr(n.length+1+r.length))}const Ete=5;class ck{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof ai?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new ai(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let a=n-e;r.block?this.addBlock(new nj(a,i,r)):(a||s||i>=Ete)&&this.addLineDeco(i,s,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new ai(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new rr(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ai)return e;let n=new ai(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof ai)&&!this.isCovered?this.nodes.push(new ai(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof ai&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new ck(r,e);return at.spans(n,r,i,s,0),s.finish(r)}}function Rte(t,e,n){let r=new Ate;return at.compare(t,e,n,r,0),r.changes}class Ate{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&iu(e,n,this.changes,5)}}function Pte(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,s=Math.max(0,n.left),a=Math.min(i.innerWidth,n.right),l=Math.max(0,n.top),u=Math.min(i.innerHeight,n.bottom);for(let d=t.parentNode;d&&d!=r.body;)if(d.nodeType==1){let h=d,g=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&g.overflow!="visible"){let m=h.getBoundingClientRect();s=Math.max(s,m.left),a=Math.min(a,m.right),l=Math.max(l,m.top),u=Math.min(d==t.parentNode?i.innerHeight:u,m.bottom)}d=g.position=="absolute"||g.position=="fixed"?h.offsetParent:h.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:s-n.left,right:Math.max(s,a)-n.left,top:l-(n.top+e),bottom:Math.max(l,u)-(n.top+e)}}function _te(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function $te(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class cx{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=n[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,n){return At.replace({widget:new Mte(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class Mte extends qu{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class t_{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=n_,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=xn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(ok).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new kte(n),this.stateDeco=r_(e),this.heightMap=Tr.empty().applyChanges(this.stateDeco,pt.empty,this.heightOracle.setDoc(e.doc),[new Ii(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=At.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:a})=>i>=s&&i<=a)){let{from:s,to:a}=this.lineBlockAt(i);e.push(new Ig(s,a))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?n_:new uk(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Sd(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=r_(this.state);let i=e.changedRanges,s=Ii.extendWithRanges(i,Rte(r,this.stateDeco,e?e.changes:qn.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);JP(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||wu)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let u=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<u.from||n.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,n));let d=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Tee)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?xn.RTL:xn.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent,l=n.getBoundingClientRect(),u=a||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let d=0,h=0;if(l.width&&l.height){let{scaleX:E,scaleY:P}=Oz(n,l);(E>.005&&Math.abs(this.scaleX-E)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=E,this.scaleY=P,d|=16,a=u=!0)}let g=(parseInt(r.paddingTop)||0)*this.scaleY,m=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=g||this.paddingBottom!=m)&&(this.paddingTop=g,this.paddingBottom=m,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let O=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=O&&(this.scrollAnchorHeight=-1,this.scrollTop=O),this.scrolledToBottom=bz(e.scrollDOM);let v=(this.printing?$te:Pte)(n,this.paddingTop),x=v.top-this.pixelViewport.top,k=v.bottom-this.pixelViewport.bottom;this.pixelViewport=v;let C=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(C!=this.inView&&(this.inView=C,C&&(u=!0)),!this.inView&&!this.scrollTarget&&!_te(e.dom))return 0;let Q=l.width;if((this.contentDOMWidth!=Q||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),u){let E=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(E)&&(a=!0),a||i.lineWrapping&&Math.abs(Q-this.contentDOMWidth)>i.charWidth){let{lineHeight:P,charWidth:$,textHeight:_}=e.docView.measureTextSize();a=P>0&&i.refresh(s,P,$,_,Math.max(5,Q/$),E),a&&(e.docView.minWidth=0,d|=16)}x>0&&k>0?h=Math.max(x,k):x<0&&k<0&&(h=Math.min(x,k)),JP();for(let P of this.viewports){let $=P.from==this.viewport.from?E:e.docView.measureVisibleLineHeights(P);this.heightMap=(a?Tr.empty().applyChanges(this.stateDeco,pt.empty,this.heightOracle,[new Ii(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new Cte(P.from,$))}wu&&(d|=2)}let R=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return R&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(d&2||R)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:l}=this,u=new Ig(i.lineAt(a-r*1e3,Ft.ByHeight,s,0,0).from,i.lineAt(l+(1-r)*1e3,Ft.ByHeight,s,0,0).to);if(n){let{head:d}=n.range;if(d<u.from||d>u.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),g=i.lineAt(d,Ft.ByPos,s,0,0),m;n.y=="center"?m=(g.top+g.bottom)/2-h/2:n.y=="start"||n.y=="nearest"&&d<u.from?m=g.top:m=g.bottom-h,u=new Ig(i.lineAt(m-1e3/2,Ft.ByHeight,s,0,0).from,i.lineAt(m+h+1e3/2,Ft.ByHeight,s,0,0).to)}}return u}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new Ig(this.heightMap.lineAt(r,Ft.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Ft.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,Ft.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,Ft.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:l}=this;return(e==0||i<=a-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(r,250)))&&i>a-2*1e3&&s<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new cx(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,a=i<<1;if(this.defaultTextDirection!=xn.LTR&&!r)return[];let l=[],u=(h,g,m,O)=>{if(g-h<s)return;let v=this.state.selection.main,x=[v.from];v.empty||x.push(v.to);for(let C of x)if(C>h&&C<g){u(h,C-10,m,O),u(C+10,g,m,O);return}let k=Nte(e,C=>C.from>=m.from&&C.to<=m.to&&Math.abs(C.from-h)<s&&Math.abs(C.to-g)<s&&!x.some(Q=>C.from<Q&&C.to>Q));if(!k){if(g<m.to&&n&&r&&n.visibleRanges.some(R=>R.from<=g&&R.to>=g)){let R=n.moveToLineBoundary(le.cursor(g),!1,!0).head;R>h&&(g=R)}let C=this.gapSize(m,h,g,O),Q=r||C<2e6?C:2e6;k=new cx(h,g,C,Q)}l.push(k)},d=h=>{if(h.length<a||h.type!=Vr.Text)return;let g=Dte(h.from,h.to,this.stateDeco);if(g.total<a)return;let m=this.scrollTarget?this.scrollTarget.range.head:null,O,v;if(r){let x=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,k,C;if(m!=null){let Q=Xg(g,m),R=((this.visibleBottom-this.visibleTop)/2+x)/h.height;k=Q-R,C=Q+R}else k=(this.visibleTop-h.top-x)/h.height,C=(this.visibleBottom-h.top+x)/h.height;O=Zg(g,k),v=Zg(g,C)}else{let x=g.total*this.heightOracle.charWidth,k=i*this.heightOracle.charWidth,C=0;if(x>2e6)for(let $ of e)$.from>=h.from&&$.from<h.to&&$.size!=$.displaySize&&$.from*this.heightOracle.charWidth+C<this.pixelViewport.left&&(C=$.size-$.displaySize);let Q=this.pixelViewport.left+C,R=this.pixelViewport.right+C,E,P;if(m!=null){let $=Xg(g,m),_=((R-Q)/2+k)/x;E=$-_,P=$+_}else E=(Q-k)/x,P=(R+k)/x;O=Zg(g,E),v=Zg(g,P)}O>h.from&&u(h.from,O,h,g),v<h.to&&u(v,h.to,h,g)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(d):d(h);return l}gapSize(e,n,r,i){let s=Xg(i,r)-Xg(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){cx.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=At.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];at.spans(n,this.viewport.from,this.viewport.to,{span(s,a){r.push({from:s,to:a})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let a=this.visibleRanges[s],l=r[s];(a.from!=l.from||a.to!=l.to)&&(i|=4,e&&e.mapPos(a.from,-1)==l.from&&e.mapPos(a.to,1)==l.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Sd(this.heightMap.lineAt(e,Ft.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Sd(this.heightMap.lineAt(this.scaler.fromDOM(e),Ft.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Sd(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ig{constructor(e,n){this.from=e,this.to=n}}function Dte(t,e,n){let r=[],i=t,s=0;return at.spans(n,t,e,{span(){},point(a,l){a>i&&(r.push({from:i,to:a}),s+=a-i),i=l}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function Zg({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:a}=e[i],l=a-s;if(r<=l)return s+r;r-=l}}function Xg(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function Nte(t,e){for(let n of t)if(e(n))return n}const n_={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function r_(t){let e=t.facet(ky).filter(r=>typeof r!="function"),n=t.facet(ak).filter(r=>typeof r!="function");return n.length&&e.push(at.join(n)),e}class uk{constructor(e,n,r){let i=0,s=0,a=0;this.viewports=r.map(({from:l,to:u})=>{let d=n.lineAt(l,Ft.ByPos,e,0,0).top,h=n.lineAt(u,Ft.ByPos,e,0,0).bottom;return i+=h-d,{from:l,to:u,top:d,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let l of this.viewports)l.domTop=a+(l.top-s)*this.scale,a=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof uk?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Sd(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new is(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Sd(i,e)):t._content)}const Bg=Re.define({combine:t=>t.join(" ")}),FS=Re.define({combine:t=>t.indexOf(!0)>-1}),HS=ja.newName(),rj=ja.newName(),ij=ja.newName(),sj={"&light":"."+rj,"&dark":"."+ij};function KS(t,e,n){return new ja(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const Lte=KS("."+HS,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},sj),zte={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ux=xe.ie&&xe.ie_version<=11;class jte{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new pee,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(xe.ie&&xe.ie_version<=11||xe.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&xe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(xe.chrome&&xe.chrome_version<126)&&(this.editContext=new Zte(e),e.state.facet(ko)&&(e.contentDOM.editContext=this.editContext.editContext)),ux&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(ko)?r.root.activeElement!=this.dom:!$d(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(xe.ie&&xe.ie_version<=11||xe.android&&xe.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Md(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=vu(e.root);if(!n)return!1;let r=xe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Ite(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=$d(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&mee(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,zte),ux&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),ux&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&su(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let a=this.readMutation(s);a&&(a.typeOver&&(i=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&$d(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new ite(this.view,e,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=qz(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!cO(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=i_(n,e.previousSibling||e.target.previousSibling,-1),i=i_(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(ko)!=e.state.facet(ko)&&(e.view.contentDOM.editContext=e.state.facet(ko)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function i_(t,e,n){for(;e;){let r=Rn.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function s_(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor,1);return Md(a.node,a.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function Ite(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return s_(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?s_(t,n):null}class Zte{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:a}=i,l=this.toEditorPos(r.updateRangeStart),u=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:l,drifted:!1});let d=u-l>r.text.length;l==this.from&&s<this.from?l=s:u==this.to&&s>this.to&&(u=s);let h=Yz(e.state.sliceDoc(l,u),r.text,(d?i.from:i.to)-l,d?"end":null);if(!h){let m=le.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));cO(m,i)||e.dispatch({selection:m,userEvent:"select"});return}let g={from:h.from+l,to:h.toA+l,insert:pt.of(r.text.slice(h.from,h.toB).split(`
297
+ `))};if((xe.mac||xe.android)&&g.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(g={from:l,to:u,insert:pt.of([r.text.replace("."," ")])}),this.pendingContextChange=g,!e.state.readOnly){let m=this.to-this.from+(g.to-g.from+g.insert.length);lk(e,g,le.single(this.toEditorPos(r.selectionStart,m),this.toEditorPos(r.selectionEnd,m)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),g.from<g.to&&!g.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let a=this.toEditorPos(r.rangeStart),l=this.toEditorPos(r.rangeEnd);a<l;a++){let u=e.coordsForChar(a);s=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.top)||s||new DOMRect,i.push(s)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let a=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(l)){let u=this.toEditorPos(s.rangeStart),d=this.toEditorPos(s.rangeEnd);if(u<d){let h=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;i.push(At.mark({attributes:{style:h}}).range(u,d))}}}e.dispatch({effects:Dz.of(At.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=vu(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,a,l,u,d)=>{if(r)return;let h=d.length-(a-s);if(i&&a>=i.to)if(i.from==s&&i.to==a&&i.insert.eq(d)){i=this.pendingContextChange=null,n+=h,this.to+=h;return}else i=null,this.revertPending(e.state);if(s+=n,a+=n,a<=this.from)this.from+=h,this.to+=h;else if(s<this.to){if(s<this.from||a>this.to||this.to-this.from+d.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),d.toString()),this.to+=h}n+=h}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Me{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||gee(e.parent)||document,this.viewState=new t_(e.state||wt.create(e)),e.scrollTo&&e.scrollTo.is(Lg)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(qc).map(i=>new ix(i));for(let i of this.plugins)i.update(this);this.observer=new jte(this),this.inputState=new lte(this),this.inputState.ensureHandlers(this.plugins),this.docView=new ZP(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=!0,this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof Bi?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let m of e){if(m.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=m.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,l=0,u=null;e.some(m=>m.annotation(Jz))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,u=ej(s,a),u||(l=1));let d=this.observer.delayedAndroidKey,h=null;if(d?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(wt.phrases)!=this.state.facet(wt.phrases))return this.setState(s);i=oO.create(this,s,e),i.flags|=l;let g=this.viewState.scrollTarget;try{this.updateState=2;for(let m of e){if(g&&(g=g.map(m.changes)),m.scrollIntoView){let{main:O}=m.state.selection;g=new ou(O.empty?O:le.cursor(O.head,O.head>O.anchor?-1:1))}for(let O of m.effects)O.is(Lg)&&(g=O.value.clip(this.state))}this.viewState.update(i,g),this.bidiCache=fO.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(vd)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(m=>m.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Bg)!=i.state.facet(Bg)&&(this.viewState.mustMeasureContent=!0),(n||r||g||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let m of this.state.facet(qS))try{m(i)}catch(O){Is(this.state,O,"update listener")}(u||h)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),h&&!qz(this,h)&&d.force&&su(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new t_(e),this.plugins=e.facet(qc).map(r=>new ix(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new ZP(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(qc),r=e.state.facet(qc);if(n!=r){let i=[];for(let s of r){let a=n.indexOf(s);if(a<0)i.push(new ix(s));else{let l=this.plugins[a];l.mustUpdate=e,i.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Is(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(a<0)if(bz(r))s=-1,a=this.viewState.heightMap.height;else{let O=this.viewState.scrollAnchorAt(i);s=O.from,a=O.top}this.updateState=1;let u=this.viewState.measure(this);if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];u&4||([this.measureRequests,d]=[d,this.measureRequests]);let h=d.map(O=>{try{return O.read(this)}catch(v){return Is(this.state,v),o_}}),g=oO.create(this,this.state,[]),m=!1;g.flags|=u,n?n.flags|=u:n=g,this.updateState=2,g.empty||(this.updatePlugins(g),this.inputState.update(g),this.updateAttrs(),m=this.docView.update(g),m&&this.docViewUpdate());for(let O=0;O<d.length;O++)if(h[O]!=o_)try{let v=d[O];v.write&&v.write(h[O],this)}catch(v){Is(this.state,v)}if(m&&this.docView.updateSelection(!0),!g.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let v=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-a;if(v>1||v<-1){i=i+v,r.scrollTop=i/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(qS))l(n)}get themeClasses(){return HS+" "+(this.state.facet(FS)?ij:rj)+" "+this.state.facet(Bg)}updateAttrs(){let e=a_(this,Nz,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(ko)?"true":"false",class:"cm-content",style:`${xe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),a_(this,ok,n);let r=this.observer.ignore(()=>{let i=DP(this.contentDOM,this.contentAttrs,n),s=DP(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(Me.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(vd);let e=this.state.facet(Me.cspNonce);ja.mount(this.root,this.styleModules.concat(Lte).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return lx(this,e,XP(this,e,n,r))}moveByGroup(e,n){return lx(this,e,XP(this,e,n,r=>Jee(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return le.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return Kee(this,e,n,r)}moveVertically(e,n,r){return lx(this,e,ete(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=GS(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),GS(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),a=s[Eo.find(s,e-i.from,-1,n)];return sO(r,a.dir==xn.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet($z)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Xte)return Cz(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||kz(s.isolates,r=zP(this,e))))return s.order;r||(r=zP(this,e));let i=wee(e.text,n,r);return this.bidiCache.push(new fO(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||xe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{yz(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return Lg.of(new ou(typeof e=="number"?le.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Lg.of(new ou(le.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Vi.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Vi.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=ja.newName(),i=[Bg.of(r),vd.of(KS(`.${r}`,e))];return n&&n.dark&&i.push(FS.of(!0)),i}static baseTheme(e){return Lh.lowest(vd.of(KS("."+HS,e,sj)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Rn.get(r)||Rn.get(e);return((n=i==null?void 0:i.root)===null||n===void 0?void 0:n.view)||null}}Me.styleModule=vd;Me.inputHandler=Pz;Me.clipboardInputFilter=ik;Me.clipboardOutputFilter=sk;Me.scrollHandler=Mz;Me.focusChangeEffect=_z;Me.perLineTextDirection=$z;Me.exceptionSink=Az;Me.updateListener=qS;Me.editable=ko;Me.mouseSelectionStyle=Rz;Me.dragMovesSelection=Ez;Me.clickAddsSelectionRange=Qz;Me.decorations=ky;Me.blockWrappers=Lz;Me.outerDecorations=ak;Me.atomicRanges=Xh;Me.bidiIsolatedRanges=zz;Me.scrollMargins=jz;Me.darkTheme=FS;Me.cspNonce=Re.define({combine:t=>t.length?t[0]:""});Me.contentAttributes=ok;Me.editorAttributes=Nz;Me.lineWrapping=Me.contentAttributes.of({class:"cm-lineWrapping"});Me.announce=hn.define();const Xte=4096,o_={};class fO{constructor(e,n,r,i,s,a){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=a}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:xn.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let a=e[s];a.dir==i&&!n.touchesRange(a.from,a.to)&&r.push(new fO(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return r}}function a_(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],a=typeof s=="function"?s(t):s;a&&tk(a,n)}return n}const Bte=xe.mac?"mac":xe.windows?"win":xe.linux?"linux":"key";function Ute(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,a,l;for(let u=0;u<n.length-1;++u){const d=n[u];if(/^(cmd|meta|m)$/i.test(d))l=!0;else if(/^a(lt)?$/i.test(d))i=!0;else if(/^(c|ctrl|control)$/i.test(d))s=!0;else if(/^s(hift)?$/i.test(d))a=!0;else if(/^mod$/i.test(d))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+d)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),l&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function Ug(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const Vte=Lh.default(Me.domEventHandlers({keydown(t,e){return Wte(qte(e.state),t,e,"editor")}})),Ey=Re.define({enables:Vte}),l_=new WeakMap;function qte(t){let e=t.facet(Ey),n=l_.get(e);return n||l_.set(e,n=Gte(e.reduce((r,i)=>r.concat(i),[]))),n}let wa=null;const Yte=4e3;function Gte(t,e=Bte){let n=Object.create(null),r=Object.create(null),i=(a,l)=>{let u=r[a];if(u==null)r[a]=l;else if(u!=l)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,l,u,d,h)=>{var g,m;let O=n[a]||(n[a]=Object.create(null)),v=l.split(/ (?!$)/).map(C=>Ute(C,e));for(let C=1;C<v.length;C++){let Q=v.slice(0,C).join(" ");i(Q,!0),O[Q]||(O[Q]={preventDefault:!0,stopPropagation:!1,run:[R=>{let E=wa={view:R,prefix:Q,scope:a};return setTimeout(()=>{wa==E&&(wa=null)},Yte),!0}]})}let x=v.join(" ");i(x,!1);let k=O[x]||(O[x]={preventDefault:!1,stopPropagation:!1,run:((m=(g=O._any)===null||g===void 0?void 0:g.run)===null||m===void 0?void 0:m.slice())||[]});u&&k.run.push(u),d&&(k.preventDefault=!0),h&&(k.stopPropagation=!0)};for(let a of t){let l=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of l){let h=n[d]||(n[d]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:g}=a;for(let m in h)h[m].run.push(O=>g(O,JS))}let u=a[e]||a.key;if(u)for(let d of l)s(d,u,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(d,"Shift-"+u,a.shift,a.preventDefault,a.stopPropagation)}return n}let JS=null;function Wte(t,e,n,r){JS=e;let i=oee(e),s=EJ(i,0),a=RJ(s)==i.length&&i!=" ",l="",u=!1,d=!1,h=!1;wa&&wa.view==n&&wa.scope==r&&(l=wa.prefix+" ",Wz.indexOf(e.keyCode)<0&&(d=!0,wa=null));let g=new Set,m=k=>{if(k){for(let C of k.run)if(!g.has(C)&&(g.add(C),C(n)))return k.stopPropagation&&(h=!0),!0;k.preventDefault&&(k.stopPropagation&&(h=!0),d=!0)}return!1},O=t[r],v,x;return O&&(m(O[l+Ug(i,e,!a)])?u=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(xe.windows&&e.ctrlKey&&e.altKey)&&!(xe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(v=Ia[e.keyCode])&&v!=i?(m(O[l+Ug(v,e,!0)])||e.shiftKey&&(x=th[e.keyCode])!=i&&x!=v&&m(O[l+Ug(x,e,!1)]))&&(u=!0):a&&e.shiftKey&&m(O[l+Ug(i,e,!0)])&&(u=!0),!u&&m(O._any)&&(u=!0)),d&&(u=!0),u&&h&&e.stopPropagation(),JS=null,u}function Fte(){return Kte}const Hte=At.line({class:"cm-activeLine"}),Kte=Vi.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(Hte.range(i.from)),e=i.from)}return At.set(n)}},{decorations:t=>t.decorations});class jo extends La{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}jo.prototype.elementClass="";jo.prototype.toDOM=void 0;jo.prototype.mapMode=Sr.TrackBefore;jo.prototype.startSide=jo.prototype.endSide=-1;jo.prototype.point=!0;const bm=Re.define(),Jte=Re.define(),ene={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>at.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Nd=Re.define();function tne(t){return[oj(),Nd.of({...ene,...t})]}const c_=Re.define({combine:t=>t.some(e=>e)});function oj(t){return[nne]}const nne=Vi.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Nd).map(e=>new f_(t,e)),this.fixed=!t.state.facet(c_);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(c_)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=at.iter(this.view.state.facet(bm),this.view.viewport.from),r=[],i=this.gutters.map(s=>new rne(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let a=!0;for(let l of s.type)if(l.type==Vr.Text&&a){ew(n,r,l.from);for(let u of i)u.line(this.view,l,r);a=!1}else if(l.widget)for(let u of i)u.widget(this.view,l)}else if(s.type==Vr.Text){ew(n,r,s.from);for(let a of i)a.line(this.view,s,r)}else if(s.widget)for(let a of i)a.widget(this.view,s);for(let s of i)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Nd),n=t.state.facet(Nd),r=t.docChanged||t.heightChanged||t.viewportChanged||!at.eq(t.startState.facet(bm),t.state.facet(bm),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let s of n){let a=e.indexOf(s);a<0?i.push(new f_(this.view,s)):(this.gutters[a].update(t),i.push(this.gutters[a]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>Me.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==xn.LTR?{left:r,right:i}:{right:r,left:i}})});function u_(t){return Array.isArray(t)?t:[t]}function ew(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class rne{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=at.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,s=(n.top-this.height)/e.scaleY,a=n.height/e.scaleY;if(this.i==i.elements.length){let l=new aj(e,a,s,r);i.elements.push(l),i.dom.appendChild(l.dom)}else i.elements[this.i].update(e,a,s,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];ew(this.cursor,i,n.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,n,i);s&&i.unshift(s);let a=this.gutter;i.length==0&&!a.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let s of e.state.facet(Jte)){let a=s(e,n.widget,n);a&&(i||(i=[])).push(a)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class f_{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let s=i.target,a;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let u=s.getBoundingClientRect();a=(u.top+u.bottom)/2}else a=i.clientY;let l=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,l,i)&&i.preventDefault()});this.markers=u_(n.markers(e)),n.initialSpacer&&(this.spacer=new aj(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=u_(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!at.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class aj{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),ine(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,a=0;;){let l=a,u=s<n.length?n[s++]:null,d=!1;if(u){let h=u.elementClass;h&&(r+=" "+h);for(let g=a;g<this.markers.length;g++)if(this.markers[g].compare(u)){l=g,d=!0;break}}else l=this.markers.length;for(;a<l;){let h=this.markers[a++];if(h.toDOM){h.destroy(i);let g=i.nextSibling;i.remove(),i=g}}if(!u)break;u.toDOM&&(d?i=i.nextSibling:this.dom.insertBefore(u.toDOM(e),i)),d&&a++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function ine(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const sne=Re.define(),one=Re.define(),Yc=Re.define({combine(t){return ZJ(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let i in n){let s=r[i],a=n[i];r[i]=s?(l,u,d)=>s(l,u,d)||a(l,u,d):a}return r}})}});class fx extends jo{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function dx(t,e){return t.state.facet(Yc).formatNumber(e,t.state)}const ane=Nd.compute([Yc],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(sne)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new fx(dx(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(one)){let s=i(e,n,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Yc)!=e.state.facet(Yc),initialSpacer(e){return new fx(dx(e,d_(e.state.doc.lines)))},updateSpacer(e,n){let r=dx(n.view,d_(n.view.state.doc.lines));return r==e.number?e:new fx(r)},domEventHandlers:t.facet(Yc).domEventHandlers,side:"before"}));function lne(t={}){return[Yc.of(t),oj(),ane]}function d_(t){let e=9;for(;e<t;)e=e*10+9;return e}const cne=new class extends jo{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},une=bm.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(cne.range(i)))}return at.of(e)});function fne(){return une}let dne=0;class fi{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=dne++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof fi&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new fi(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new dO(e);return r=>r.modified.indexOf(n)>-1?r:dO.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let hne=0;class dO{constructor(e){this.name=e,this.instances=[],this.id=hne++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(l=>l.base==e&&pne(n,l.modified));if(r)return r;let i=[],s=new fi(e.name,i,e,n);for(let l of n)l.instances.push(s);let a=gne(n);for(let l of e.set)if(!l.modified.length)for(let u of a)i.push(dO.get(l,u));return s}}function pne(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function gne(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function Yu(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],a=2,l=i;for(let g=0;;){if(l=="..."&&g>0&&g+3==i.length){a=1;break}let m=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!m)throw new RangeError("Invalid path: "+i);if(s.push(m[0]=="*"?"":m[0][0]=='"'?JSON.parse(m[0]):m[0]),g+=m[0].length,g==i.length)break;let O=i[g++];if(g==i.length&&O=="!"){a=0;break}if(O!="/")throw new RangeError("Invalid path: "+i);l=i.slice(g)}let u=s.length-1,d=s[u];if(!d)throw new RangeError("Invalid path: "+i);let h=new ih(r,a,u>0?s.slice(0,u):null);e[d]=h.sort(e[d])}}return lj.add(e)}const lj=new Le({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new ih(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class ih{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}ih.empty=new ih([],2,null);function cj(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let a of s.tag)n[a.id]=s.class;let{scope:r,all:i=null}=e||{};return{style:s=>{let a=i;for(let l of s)for(let u of l.set){let d=n[u.id];if(d){a=a?a+" "+d:d;break}}return a},scope:r}}function mne(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function One(t,e,n,r=0,i=t.length){let s=new yne(r,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),r,i,"",s.highlighters),s.flush(i)}class yne{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,s){let{type:a,from:l,to:u}=e;if(l>=r||u<=n)return;a.isTop&&(s=this.highlighters.filter(O=>!O.scope||O.scope(a)));let d=i,h=bne(e)||ih.empty,g=mne(s,h.tags);if(g&&(d&&(d+=" "),d+=g,h.mode==1&&(i+=(i?" ":"")+g)),this.startSpan(Math.max(n,l),d),h.opaque)return;let m=e.tree&&e.tree.prop(Le.mounted);if(m&&m.overlay){let O=e.node.enter(m.overlay[0].from+l,1),v=this.highlighters.filter(k=>!k.scope||k.scope(m.tree.type)),x=e.firstChild();for(let k=0,C=l;;k++){let Q=k<m.overlay.length?m.overlay[k]:null,R=Q?Q.from+l:u,E=Math.max(n,C),P=Math.min(r,R);if(E<P&&x)for(;e.from<P&&(this.highlightRange(e,E,P,i,s),this.startSpan(Math.min(P,e.to),d),!(e.to>=R||!e.nextSibling())););if(!Q||R>r)break;C=Q.to+l,C>n&&(this.highlightRange(O.cursor(),Math.max(n,Q.from+l),Math.min(r,C),"",v),this.startSpan(Math.min(r,C),d))}x&&e.parent()}else if(e.firstChild()){m&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,s),this.startSpan(Math.min(r,e.to),d)}while(e.nextSibling());e.parent()}}}function bne(t){let e=t.type.prop(lj);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const pe=fi.define,Vg=pe(),va=pe(),h_=pe(va),p_=pe(va),xa=pe(),qg=pe(xa),hx=pe(xa),Rs=pe(),pl=pe(Rs),Cs=pe(),Ts=pe(),tw=pe(),cd=pe(tw),Yg=pe(),j={comment:Vg,lineComment:pe(Vg),blockComment:pe(Vg),docComment:pe(Vg),name:va,variableName:pe(va),typeName:h_,tagName:pe(h_),propertyName:p_,attributeName:pe(p_),className:pe(va),labelName:pe(va),namespace:pe(va),macroName:pe(va),literal:xa,string:qg,docString:pe(qg),character:pe(qg),attributeValue:pe(qg),number:hx,integer:pe(hx),float:pe(hx),bool:pe(xa),regexp:pe(xa),escape:pe(xa),color:pe(xa),url:pe(xa),keyword:Cs,self:pe(Cs),null:pe(Cs),atom:pe(Cs),unit:pe(Cs),modifier:pe(Cs),operatorKeyword:pe(Cs),controlKeyword:pe(Cs),definitionKeyword:pe(Cs),moduleKeyword:pe(Cs),operator:Ts,derefOperator:pe(Ts),arithmeticOperator:pe(Ts),logicOperator:pe(Ts),bitwiseOperator:pe(Ts),compareOperator:pe(Ts),updateOperator:pe(Ts),definitionOperator:pe(Ts),typeOperator:pe(Ts),controlOperator:pe(Ts),punctuation:tw,separator:pe(tw),bracket:cd,angleBracket:pe(cd),squareBracket:pe(cd),paren:pe(cd),brace:pe(cd),content:Rs,heading:pl,heading1:pe(pl),heading2:pe(pl),heading3:pe(pl),heading4:pe(pl),heading5:pe(pl),heading6:pe(pl),contentSeparator:pe(Rs),list:pe(Rs),quote:pe(Rs),emphasis:pe(Rs),strong:pe(Rs),link:pe(Rs),monospace:pe(Rs),strikethrough:pe(Rs),inserted:pe(),deleted:pe(),changed:pe(),invalid:pe(),meta:Yg,documentMeta:pe(Yg),annotation:pe(Yg),processingInstruction:pe(Yg),definition:fi.defineModifier("definition"),constant:fi.defineModifier("constant"),function:fi.defineModifier("function"),standard:fi.defineModifier("standard"),local:fi.defineModifier("local"),special:fi.defineModifier("special")};for(let t in j){let e=j[t];e instanceof fi&&(e.name=t)}cj([{tag:j.link,class:"tok-link"},{tag:j.heading,class:"tok-heading"},{tag:j.emphasis,class:"tok-emphasis"},{tag:j.strong,class:"tok-strong"},{tag:j.keyword,class:"tok-keyword"},{tag:j.atom,class:"tok-atom"},{tag:j.bool,class:"tok-bool"},{tag:j.url,class:"tok-url"},{tag:j.labelName,class:"tok-labelName"},{tag:j.inserted,class:"tok-inserted"},{tag:j.deleted,class:"tok-deleted"},{tag:j.literal,class:"tok-literal"},{tag:j.string,class:"tok-string"},{tag:j.number,class:"tok-number"},{tag:[j.regexp,j.escape,j.special(j.string)],class:"tok-string2"},{tag:j.variableName,class:"tok-variableName"},{tag:j.local(j.variableName),class:"tok-variableName tok-local"},{tag:j.definition(j.variableName),class:"tok-variableName tok-definition"},{tag:j.special(j.variableName),class:"tok-variableName2"},{tag:j.definition(j.propertyName),class:"tok-propertyName tok-definition"},{tag:j.typeName,class:"tok-typeName"},{tag:j.namespace,class:"tok-namespace"},{tag:j.className,class:"tok-className"},{tag:j.macroName,class:"tok-macroName"},{tag:j.propertyName,class:"tok-propertyName"},{tag:j.operator,class:"tok-operator"},{tag:j.comment,class:"tok-comment"},{tag:j.meta,class:"tok-meta"},{tag:j.invalid,class:"tok-invalid"},{tag:j.punctuation,class:"tok-punctuation"}]);var px;const Cl=new Le;function fk(t){return Re.define({combine:t?e=>e.concat(t):void 0})}const dk=new Le;class Zi{constructor(e,n,r=[],i=""){this.data=e,this.name=i,wt.prototype.hasOwnProperty("tree")||Object.defineProperty(wt.prototype,"tree",{get(){return pn(this)}}),this.parser=n,this.extension=[Tu.of(this),wt.languageData.of((s,a,l)=>{let u=g_(s,a,l),d=u.type.prop(Cl);if(!d)return[];let h=s.facet(d),g=u.type.prop(dk);if(g){let m=u.resolve(a-u.from,l);for(let O of g)if(O.test(m,s)){let v=s.facet(O.facet);return O.type=="replace"?v:v.concat(h)}}return h})].concat(r)}isActiveAt(e,n,r=-1){return g_(e,n,r).type.prop(Cl)==this.data}findRegions(e){let n=e.facet(Tu);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,a)=>{if(s.prop(Cl)==this.data){r.push({from:a,to:a+s.length});return}let l=s.prop(Le.mounted);if(l){if(l.tree.prop(Cl)==this.data){if(l.overlay)for(let u of l.overlay)r.push({from:u.from+a,to:u.to+a});else r.push({from:a,to:a+s.length});return}else if(l.overlay){let u=r.length;if(i(l.tree,l.overlay[0].from+a),r.length>u)return}}for(let u=0;u<s.children.length;u++){let d=s.children[u];d instanceof kt&&i(d,s.positions[u]+a)}};return i(pn(e),0),r}get allowsNesting(){return!0}}Zi.setState=hn.define();function g_(t,e,n){let r=t.facet(Tu),i=pn(t).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,n,Rt.ExcludeBuffers|Rt.EnterBracketed))s.type.isTop&&(i=s);return i}class ku extends Zi{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=fk(e.languageData);return new ku(n,e.parser.configure({props:[Cl.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new ku(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function pn(t){let e=t.field(Zi.state,!1);return e?e.tree:kt.empty}class vne{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let ud=null;class sh{constructor(e,n,r=[],i,s,a,l,u){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=a,this.skipped=l,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new sh(e,n,[],kt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new vne(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=kt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Po.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Po.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=ud;ud=this;try{return e()}finally{ud=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=m_(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:a,skipped:l}=this;if(this.takeTree(),!e.empty){let u=[];if(e.iterChangedRanges((d,h,g,m)=>u.push({fromA:d,toA:h,fromB:g,toB:m})),r=Po.applyChanges(r,u),i=kt.empty,s=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){l=[];for(let d of this.skipped){let h=e.mapPos(d.from,1),g=e.mapPos(d.to,-1);h<g&&l.push({from:h,to:g})}}}return new sh(this.parser,n,r,i,s,a,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=m_(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends ek{createParse(n,r,i){let s=i[0].from,a=i[i.length-1].to;return{parsedPos:s,advance(){let u=ud;if(u){for(let d of i)u.tempSkipped.push(d);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=a,new kt(Ln.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return ud}}function m_(t,e,n){return Po.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Cu{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Cu(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=sh.create(e.facet(Tu).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Cu(r)}}Zi.state=qa.define({create:Cu.init,update(t,e){for(let n of e.effects)if(n.is(Zi.setState))return n.value;return e.startState.facet(Tu)!=e.state.facet(Tu)?Cu.init(e.state):t.apply(e)}});let uj=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(uj=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const gx=typeof navigator<"u"&&(!((px=navigator.scheduling)===null||px===void 0)&&px.isInputPending)?()=>navigator.scheduling.isInputPending():null,xne=Vi.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Zi.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Zi.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=uj(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(Zi.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!gx?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<i&&r.doc.length>i+1e3,u=s.context.work(()=>gx&&gx()||Date.now()>a,i+(l?0:1e5));this.chunkBudget-=Date.now()-n,(u||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Zi.setState.of(new Cu(s.context))})),this.chunkBudget>0&&!(u&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Is(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Tu=Re.define({combine(t){return t.length?t[0]:null},enables:t=>[Zi.state,xne,Me.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class oh{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class hO{constructor(e,n,r,i,s,a=void 0){this.name=e,this.alias=n,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=a,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:r}=e;if(!n){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(r)}return new hO(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,n,r)}static matchFilename(e,n){for(let i of e)if(i.filename&&i.filename.test(n))return i;let r=/\.([^.]+)$/.exec(n);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,n,r=!0){n=n.toLowerCase();for(let i of e)if(i.alias.some(s=>s==n))return i;if(r)for(let i of e)for(let s of i.alias){let a=n.indexOf(s);if(a>-1&&(s.length>2||!/\w/.test(n[a-1])&&!/\w/.test(n[a+s.length])))return i}return null}}const Sne=Re.define(),Bh=Re.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function pO(t){let e=t.facet(Bh);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function gO(t,e){let n="",r=t.tabSize,i=t.facet(Bh)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s<e;s++)n+=i;return n}function fj(t,e){t instanceof wt&&(t=new Ry(t));for(let r of t.state.facet(Sne)){let i=r(t,e);if(i!==void 0)return i}let n=pn(t.state);return n.length>=e?wne(t,n,e):null}class Ry{constructor(e,n={}){this.state=e,this.options=n,this.unit=pO(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.countColumn(r,e-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(s+=a-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return Lo(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let a=s(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Uh=new Le;function wne(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let a=i;a&&!(a.from<r.node.from||a.to>r.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)r={node:s[a],next:r}}return dj(r,t,n)}function dj(t,e,n){for(let r=t;r;r=r.next){let i=Cne(r.node);if(i)return i(hk.create(e,n,r))}return 0}function kne(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Cne(t){let e=t.type.prop(Uh);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Le.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return a=>hj(a,!0,1,void 0,s&&!kne(a)?i.from:void 0)}return t.parent==null?Tne:null}function Tne(){return 0}class hk extends Ry{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new hk(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Qne(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return dj(this.context.next,this.base,this.pos)}}function Qne(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Ene(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),a=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let l=n.to;;){let u=e.childAfter(l);if(!u||u==r)return null;if(!u.type.isSkipped){if(u.from>=a)return null;let d=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+d}}l=u.to}}function Rne({closing:t,align:e=!0,units:n=1}){return r=>hj(r,e,n,t)}function hj(t,e,n,r,i){let s=t.textAfter,a=s.match(/^\s*/)[0].length,l=r&&s.slice(a,a+r.length)==r||i==t.pos+a,u=e?Ene(t):null;return u?l?t.column(u.from):t.column(u.to):t.baseIndent+(l?0:t.unit*n)}const Ane=t=>t.baseIndent;function vm({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const Pne=Re.define(),Vh=new Le;function pj(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}class Ay{constructor(e,n){this.specs=e;let r;function i(l){let u=ja.newName();return(r||(r=Object.create(null)))["."+u]=l,u}const s=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,a=n.scope;this.scope=a instanceof Zi?l=>l.prop(Cl)==a.data:a?l=>l==a:void 0,this.style=cj(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=r?new ja(r):null,this.themeType=n.themeType}static define(e,n){return new Ay(e,n||{})}}const nw=Re.define(),_ne=Re.define({combine(t){return t.length?[t[0]]:null}});function mx(t){let e=t.facet(nw);return e.length?e:t.facet(_ne)}function $ne(t,e){let n=[Dne],r;return t instanceof Ay&&(t.module&&n.push(Me.styleModule.of(t.module)),r=t.themeType),r?n.push(nw.computeN([Me.darkTheme],i=>i.facet(Me.darkTheme)==(r=="dark")?[t]:[])):n.push(nw.of(t)),n}class Mne{constructor(e){this.markCache=Object.create(null),this.tree=pn(e.state),this.decorations=this.buildDeco(e,mx(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=pn(e.state),r=mx(e.state),i=r!=mx(e.startState),{viewport:s}=e.view,a=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!i&&n.type==this.tree.type&&a>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return At.none;let r=new Kd;for(let{from:i,to:s}of e.visibleRanges)One(this.tree,n,(a,l,u)=>{r.add(a,l,this.markCache[u]||(this.markCache[u]=At.mark({class:u})))},i,s);return r.finish()}}const Dne=Lh.high(Vi.fromClass(Mne,{decorations:t=>t.decorations})),Nne=Ay.define([{tag:j.meta,color:"#404740"},{tag:j.link,textDecoration:"underline"},{tag:j.heading,textDecoration:"underline",fontWeight:"bold"},{tag:j.emphasis,fontStyle:"italic"},{tag:j.strong,fontWeight:"bold"},{tag:j.strikethrough,textDecoration:"line-through"},{tag:j.keyword,color:"#708"},{tag:[j.atom,j.bool,j.url,j.contentSeparator,j.labelName],color:"#219"},{tag:[j.literal,j.inserted],color:"#164"},{tag:[j.string,j.deleted],color:"#a11"},{tag:[j.regexp,j.escape,j.special(j.string)],color:"#e40"},{tag:j.definition(j.variableName),color:"#00f"},{tag:j.local(j.variableName),color:"#30a"},{tag:[j.typeName,j.namespace],color:"#085"},{tag:j.className,color:"#167"},{tag:[j.special(j.variableName),j.macroName],color:"#256"},{tag:j.definition(j.propertyName),color:"#00c"},{tag:j.comment,color:"#940"},{tag:j.invalid,color:"#f00"}]),Lne=1e4,zne="()[]{}",gj=new Le;function rw(t,e,n){let r=t.prop(e<0?Le.openedBy:Le.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function iw(t){let e=t.type.prop(gj);return e?e(t.node):t}function Gc(t,e,n,r={}){let i=r.maxScanDistance||Lne,s=r.brackets||zne,a=pn(t),l=a.resolveInner(e,n);for(let u=l;u;u=u.parent){let d=rw(u.type,n,s);if(d&&u.from<u.to){let h=iw(u);if(h&&(n>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return jne(t,e,n,u,h,d,s)}}return Ine(t,e,n,a,l.type,i,s)}function jne(t,e,n,r,i,s,a){let l=r.parent,u={from:i.from,to:i.to},d=0,h=l==null?void 0:l.cursor();if(h&&(n<0?h.childBefore(r.from):h.childAfter(r.to)))do if(n<0?h.to<=r.from:h.from>=r.to){if(d==0&&s.indexOf(h.type.name)>-1&&h.from<h.to){let g=iw(h);return{start:u,end:g?{from:g.from,to:g.to}:void 0,matched:!0}}else if(rw(h.type,n,a))d++;else if(rw(h.type,-n,a)){if(d==0){let g=iw(h);return{start:u,end:g&&g.from<g.to?{from:g.from,to:g.to}:void 0,matched:!1}}d--}}while(n<0?h.prevSibling():h.nextSibling());return{start:u,matched:!1}}function Ine(t,e,n,r,i,s,a){let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),u=a.indexOf(l);if(u<0||u%2==0!=n>0)return null;let d={from:n<0?e-1:e,to:n>0?e+1:e},h=t.doc.iterRange(e,n>0?t.doc.length:0),g=0;for(let m=0;!h.next().done&&m<=s;){let O=h.value;n<0&&(m+=O.length);let v=e+m*n;for(let x=n>0?0:O.length-1,k=n>0?O.length:-1;x!=k;x+=n){let C=a.indexOf(O[x]);if(!(C<0||r.resolveInner(v+x,1).type!=i))if(C%2==0==n>0)g++;else{if(g==1)return{start:d,end:{from:v+x,to:v+x+1},matched:C>>1==u>>1};g--}}n>0&&(m+=O.length)}return h.done?{start:d,matched:!1}:null}const Zne=Object.create(null),O_=[Ln.none],y_=[],b_=Object.create(null),Xne=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Xne[t]=Bne(Zne,e);function Ox(t,e){y_.indexOf(t)>-1||(y_.push(t),console.warn(e))}function Bne(t,e){let n=[];for(let l of e.split(" ")){let u=[];for(let d of l.split(".")){let h=t[d]||j[d];h?typeof h=="function"?u.length?u=u.map(h):Ox(d,`Modifier ${d} used at start of tag`):u.length?Ox(d,`Tag ${d} used as modifier`):u=Array.isArray(h)?h:[h]:Ox(d,`Unknown highlighting tag ${d}`)}for(let d of u)n.push(d)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(l=>l.id),s=b_[i];if(s)return s.id;let a=b_[i]=Ln.define({id:O_.length,name:r,props:[Yu({[r]:n})]});return O_.push(a),a.id}xn.RTL,xn.LTR;const Une=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=gk(t.state,n.from);return r.line?Vne(t):r.block?Yne(t):!1};function pk(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const Vne=pk(Fne,0),qne=pk(mj,0),Yne=pk((t,e)=>mj(t,e,Wne(e)),0);function gk(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const fd=50;function Gne(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-fd,r),a=t.sliceDoc(i,i+fd),l=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(a)[0].length,d=s.length-l;if(s.slice(d-e.length,d)==e&&a.slice(u,u+n.length)==n)return{open:{pos:r-l,margin:l&&1},close:{pos:i+u,margin:u&&1}};let h,g;i-r<=2*fd?h=g=t.sliceDoc(r,i):(h=t.sliceDoc(r,r+fd),g=t.sliceDoc(i-fd,i));let m=/^\s*/.exec(h)[0].length,O=/\s*$/.exec(g)[0].length,v=g.length-O-n.length;return h.slice(m,m+e.length)==e&&g.slice(v,v+n.length)==n?{open:{pos:r+m+e.length,margin:/\s/.test(h.charAt(m+e.length))?1:0},close:{pos:i-O-n.length,margin:/\s/.test(g.charAt(v-1))?1:0}}:null}function Wne(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function mj(t,e,n=e.selection.ranges){let r=n.map(s=>gk(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,a)=>Gne(e,r[a],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,a)=>i[a]?[]:[{from:s.from,insert:r[a].open+" "},{from:s.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let a=0,l;a<i.length;a++)if(l=i[a]){let u=r[a],{open:d,close:h}=l;s.push({from:d.pos-u.open.length,to:d.pos+d.margin},{from:h.pos-h.margin,to:h.pos+u.close.length})}return{changes:s}}return null}function Fne(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:a}of n){let l=r.length,u=1e9,d;for(let h=s;h<=a;){let g=e.doc.lineAt(h);if(d==null&&(d=gk(e,g.from).line,!d))continue e;if(g.from>i&&(s==a||a>g.from)){i=g.from;let m=/^\s*/.exec(g.text)[0].length,O=m==g.length,v=g.text.slice(m,m+d.length)==d?m:-1;m<g.text.length&&m<u&&(u=m),r.push({line:g,comment:v,token:d,indent:m,empty:O,single:!1})}h=g.to+1}if(u<1e9)for(let h=l;h<r.length;h++)r[h].indent<r[h].line.text.length&&(r[h].indent=u);r.length==l+1&&(r[l].single=!0)}if(t!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:u,indent:d,empty:h,single:g}of r)(g||!h)&&s.push({from:l.from+d,insert:u+" "});let a=e.changes(s);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:l,token:u}of r)if(l>=0){let d=a.from+l,h=d+u.length;a.text[h-a.from]==" "&&h++,s.push({from:d,to:h})}return{changes:s}}return null}function Gu(t,e){return le.create(t.ranges.map(e),t.mainIndex)}function Os(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function ys({state:t,dispatch:e},n){let r=Gu(t.selection,n);return r.eq(t.selection,!0)?!1:(e(Os(t,r)),!0)}function Py(t,e){return le.cursor(e?t.to:t.from)}function Oj(t,e){return ys(t,n=>n.empty?t.moveByChar(n,e):Py(n,e))}function hr(t){return t.textDirectionAt(t.state.selection.main.head)==xn.LTR}const yj=t=>Oj(t,!hr(t)),bj=t=>Oj(t,hr(t));function vj(t,e){return ys(t,n=>n.empty?t.moveByGroup(n,e):Py(n,e))}const Hne=t=>vj(t,!hr(t)),Kne=t=>vj(t,hr(t));function Jne(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function _y(t,e,n){let r=pn(t).resolveInner(e.head),i=n?Le.closedBy:Le.openedBy;for(let u=e.head;;){let d=n?r.childAfter(u):r.childBefore(u);if(!d)break;Jne(t,d,i)?r=d:u=n?d.to:d.from}let s=r.type.prop(i),a,l;return s&&(a=n?Gc(t,r.from,1):Gc(t,r.to,-1))&&a.matched?l=n?a.end.to:a.end.from:l=n?r.to:r.from,le.cursor(l,n?-1:1)}const ere=t=>ys(t,e=>_y(t.state,e,!hr(t))),tre=t=>ys(t,e=>_y(t.state,e,hr(t)));function xj(t,e){return ys(t,n=>{if(!n.empty)return Py(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const Sj=t=>xj(t,!1),wj=t=>xj(t,!0);function kj(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let s of t.state.facet(Me.scrollMargins)){let a=s(t);a!=null&&a.top&&(n=Math.max(a==null?void 0:a.top,n)),a!=null&&a.bottom&&(r=Math.max(a==null?void 0:a.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function Cj(t,e){let n=kj(t),{state:r}=t,i=Gu(r.selection,a=>a.empty?t.moveVertically(a,e,n.height):Py(a,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),u=l.top+n.marginTop,d=l.bottom-n.marginBottom;a&&a.top>u&&a.bottom<d&&(s=Me.scrollIntoView(i.main.head,{y:"start",yMargin:a.top-u}))}return t.dispatch(Os(r,i),{effects:s}),!0}const v_=t=>Cj(t,!1),sw=t=>Cj(t,!0);function Ya(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=le.cursor(r.from+s))}return i}const nre=t=>ys(t,e=>Ya(t,e,!0)),rre=t=>ys(t,e=>Ya(t,e,!1)),ire=t=>ys(t,e=>Ya(t,e,!hr(t))),sre=t=>ys(t,e=>Ya(t,e,hr(t))),ore=t=>ys(t,e=>le.cursor(t.lineBlockAt(e.head).from,1)),are=t=>ys(t,e=>le.cursor(t.lineBlockAt(e.head).to,-1));function lre(t,e,n){let r=!1,i=Gu(t.selection,s=>{let a=Gc(t,s.head,-1)||Gc(t,s.head,1)||s.head>0&&Gc(t,s.head-1,1)||s.head<t.doc.length&&Gc(t,s.head+1,-1);if(!a||!a.end)return s;r=!0;let l=a.start.from==s.head?a.end.to:a.end.from;return le.cursor(l)});return r?(e(Os(t,i)),!0):!1}const cre=({state:t,dispatch:e})=>lre(t,e);function Yi(t,e){let n=Gu(t.state.selection,r=>{let i=e(r);return le.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Os(t.state,n)),!0)}function Tj(t,e){return Yi(t,n=>t.moveByChar(n,e))}const Qj=t=>Tj(t,!hr(t)),Ej=t=>Tj(t,hr(t));function Rj(t,e){return Yi(t,n=>t.moveByGroup(n,e))}const ure=t=>Rj(t,!hr(t)),fre=t=>Rj(t,hr(t)),dre=t=>Yi(t,e=>_y(t.state,e,!hr(t))),hre=t=>Yi(t,e=>_y(t.state,e,hr(t)));function Aj(t,e){return Yi(t,n=>t.moveVertically(n,e))}const Pj=t=>Aj(t,!1),_j=t=>Aj(t,!0);function $j(t,e){return Yi(t,n=>t.moveVertically(n,e,kj(t).height))}const x_=t=>$j(t,!1),S_=t=>$j(t,!0),pre=t=>Yi(t,e=>Ya(t,e,!0)),gre=t=>Yi(t,e=>Ya(t,e,!1)),mre=t=>Yi(t,e=>Ya(t,e,!hr(t))),Ore=t=>Yi(t,e=>Ya(t,e,hr(t))),yre=t=>Yi(t,e=>le.cursor(t.lineBlockAt(e.head).from)),bre=t=>Yi(t,e=>le.cursor(t.lineBlockAt(e.head).to)),w_=({state:t,dispatch:e})=>(e(Os(t,{anchor:0})),!0),k_=({state:t,dispatch:e})=>(e(Os(t,{anchor:t.doc.length})),!0),C_=({state:t,dispatch:e})=>(e(Os(t,{anchor:t.selection.main.anchor,head:0})),!0),T_=({state:t,dispatch:e})=>(e(Os(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),vre=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),xre=({state:t,dispatch:e})=>{let n=$y(t).map(({from:r,to:i})=>le.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:le.create(n),userEvent:"select"})),!0},Sre=({state:t,dispatch:e})=>{let n=Gu(t.selection,r=>{let i=pn(t),s=i.resolveStack(r.from,1);if(r.empty){let a=i.resolveStack(r.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:l}=a;if((l.from<r.from&&l.to>=r.to||l.to>r.to&&l.from<=r.from)&&a.next)return le.range(l.to,l.from)}return r});return n.eq(t.selection)?!1:(e(Os(t,n)),!0)};function Mj(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let a=n.doc.lineAt(s.head);if(e?a.to<t.state.doc.length:a.from>0)for(let l=s;;){let u=t.moveVertically(l,e);if(u.head<a.from||u.head>a.to){i.some(d=>d.head==u.head)||i.push(u);break}else{if(u.head==l.head)break;l=u}}}return i.length==r.ranges.length?!1:(t.dispatch(Os(n,le.create(i,i.length-1))),!0)}const wre=t=>Mj(t,!1),kre=t=>Mj(t,!0),Cre=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=le.create([n.main]):n.main.empty||(r=le.create([le.cursor(n.main.head)])),r?(e(Os(t,r)),!0):!1};function qh(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:a,to:l}=s;if(a==l){let u=e(s);u<a?(n="delete.backward",u=Gg(t,u,!1)):u>a&&(n="delete.forward",u=Gg(t,u,!0)),a=Math.min(a,u),l=Math.max(l,u)}else a=Gg(t,a,!1),l=Gg(t,l,!0);return a==l?{range:s}:{changes:{from:a,to:l},range:le.cursor(a,a<s.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Me.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Gg(t,e,n){if(t instanceof Me)for(let r of t.state.facet(Me.atomicRanges).map(i=>i(t)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=n?s:i)});return e}const Dj=(t,e,n)=>qh(t,r=>{let i=r.from,{state:s}=t,a=s.doc.lineAt(i),l,u;if(n&&!e&&i>a.from&&i<a.from+200&&!/[^ \t]/.test(l=a.text.slice(0,i-a.from))){if(l[l.length-1]==" ")return i-1;let d=Lo(l,s.tabSize),h=d%pO(s)||pO(s);for(let g=0;g<h&&l[l.length-1-g]==" ";g++)i--;u=i}else u=sr(a.text,i-a.from,e,e)+a.from,u==i&&a.number!=(e?s.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(u-a.from,i-a.from))&&(u=sr(a.text,u-a.from,!1,!1)+a.from);return u}),ow=t=>Dj(t,!1,!0),Nj=t=>Dj(t,!0,!1),Lj=(t,e)=>qh(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),a=i.charCategorizer(r);for(let l=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let u=sr(s.text,r-s.from,e)+s.from,d=s.text.slice(Math.min(r,u)-s.from,Math.max(r,u)-s.from),h=a(d);if(l!=null&&h!=l)break;(d!=" "||r!=n.head)&&(l=h),r=u}return r}),zj=t=>Lj(t,!1),Tre=t=>Lj(t,!0),Qre=t=>qh(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Ere=t=>qh(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),Rre=t=>qh(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),Are=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:pt.of(["",""])},range:le.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Pre=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),a=i==s.from?i-1:sr(s.text,i-s.from,!1)+s.from,l=i==s.to?i+1:sr(s.text,i-s.from,!0)+s.from;return{changes:{from:a,to:l,insert:t.doc.slice(i,l).append(t.doc.slice(a,i))},range:le.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function $y(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=s.to,a.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function jj(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of $y(t)){if(n?s.to==t.doc.length:s.from==0)continue;let a=t.doc.lineAt(n?s.to+1:s.from-1),l=a.length+1;if(n){r.push({from:s.to,to:a.to},{from:s.from,insert:a.text+t.lineBreak});for(let u of s.ranges)i.push(le.range(Math.min(t.doc.length,u.anchor+l),Math.min(t.doc.length,u.head+l)))}else{r.push({from:a.from,to:s.from},{from:s.to,insert:t.lineBreak+a.text});for(let u of s.ranges)i.push(le.range(u.anchor-l,u.head-l))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:le.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const _re=({state:t,dispatch:e})=>jj(t,e,!1),$re=({state:t,dispatch:e})=>jj(t,e,!0);function Ij(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of $y(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Mre=({state:t,dispatch:e})=>Ij(t,e,!1),Dre=({state:t,dispatch:e})=>Ij(t,e,!0),Nre=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes($y(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=Gu(e.selection,i=>{let s;if(t.lineWrapping){let a=t.lineBlockAt(i.head),l=t.coordsAtPos(i.head,i.assoc||1);l&&(s=a.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Lre(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=pn(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(Le.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const Q_=Zj(!1),zre=Zj(!0);function Zj(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:a}=i,l=e.doc.lineAt(s),u=!t&&s==a&&Lre(e,s);t&&(s=a=(a<=l.to?l:e.doc.lineAt(a)).to);let d=new Ry(e,{simulateBreak:s,simulateDoubleBreak:!!u}),h=fj(d,s);for(h==null&&(h=Lo(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));a<l.to&&/\s/.test(l.text[a-l.from]);)a++;u?{from:s,to:a}=u:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let g=["",gO(e,h)];return u&&g.push(gO(e,d.lineIndent(l.from,-1))),{changes:{from:s,to:a,insert:pt.of(g)},range:le.cursor(s+1+g[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function mk(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let l=t.doc.lineAt(a);l.number>n&&(r.empty||r.to>l.from)&&(e(l,i,r),n=l.number),a=l.to+1}let s=t.changes(i);return{changes:i,range:le.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const jre=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new Ry(t,{overrideIndentation:s=>{let a=n[s];return a??-1}}),i=mk(t,(s,a,l)=>{let u=fj(r,s.from);if(u==null)return;/\S/.test(s.text)||(u=0);let d=/^\s*/.exec(s.text)[0],h=gO(t,u);(d!=h||l.from<s.from+d.length)&&(n[s.from]=u,a.push({from:s.from,to:s.from+d.length,insert:h}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},Ire=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(mk(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Bh)})}),{userEvent:"input.indent"})),!0),Zre=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(mk(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=Lo(i,t.tabSize),a=0,l=gO(t,Math.max(0,s-pO(t)));for(;a<i.length&&a<l.length&&i.charCodeAt(a)==l.charCodeAt(a);)a++;r.push({from:n.from+a,to:n.from+i.length,insert:l.slice(a)})}),{userEvent:"delete.dedent"})),!0),Xre=t=>(t.setTabFocusMode(),!0),Bre=[{key:"Ctrl-b",run:yj,shift:Qj,preventDefault:!0},{key:"Ctrl-f",run:bj,shift:Ej},{key:"Ctrl-p",run:Sj,shift:Pj},{key:"Ctrl-n",run:wj,shift:_j},{key:"Ctrl-a",run:ore,shift:yre},{key:"Ctrl-e",run:are,shift:bre},{key:"Ctrl-d",run:Nj},{key:"Ctrl-h",run:ow},{key:"Ctrl-k",run:Qre},{key:"Ctrl-Alt-h",run:zj},{key:"Ctrl-o",run:Are},{key:"Ctrl-t",run:Pre},{key:"Ctrl-v",run:sw}],Ure=[{key:"ArrowLeft",run:yj,shift:Qj,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Hne,shift:ure,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:ire,shift:mre,preventDefault:!0},{key:"ArrowRight",run:bj,shift:Ej,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Kne,shift:fre,preventDefault:!0},{mac:"Cmd-ArrowRight",run:sre,shift:Ore,preventDefault:!0},{key:"ArrowUp",run:Sj,shift:Pj,preventDefault:!0},{mac:"Cmd-ArrowUp",run:w_,shift:C_},{mac:"Ctrl-ArrowUp",run:v_,shift:x_},{key:"ArrowDown",run:wj,shift:_j,preventDefault:!0},{mac:"Cmd-ArrowDown",run:k_,shift:T_},{mac:"Ctrl-ArrowDown",run:sw,shift:S_},{key:"PageUp",run:v_,shift:x_},{key:"PageDown",run:sw,shift:S_},{key:"Home",run:rre,shift:gre,preventDefault:!0},{key:"Mod-Home",run:w_,shift:C_},{key:"End",run:nre,shift:pre,preventDefault:!0},{key:"Mod-End",run:k_,shift:T_},{key:"Enter",run:Q_,shift:Q_},{key:"Mod-a",run:vre},{key:"Backspace",run:ow,shift:ow,preventDefault:!0},{key:"Delete",run:Nj,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:zj,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Tre,preventDefault:!0},{mac:"Mod-Backspace",run:Ere,preventDefault:!0},{mac:"Mod-Delete",run:Rre,preventDefault:!0}].concat(Bre.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Vre=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ere,shift:dre},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:tre,shift:hre},{key:"Alt-ArrowUp",run:_re},{key:"Shift-Alt-ArrowUp",run:Mre},{key:"Alt-ArrowDown",run:$re},{key:"Shift-Alt-ArrowDown",run:Dre},{key:"Mod-Alt-ArrowUp",run:wre},{key:"Mod-Alt-ArrowDown",run:kre},{key:"Escape",run:Cre},{key:"Mod-Enter",run:zre},{key:"Alt-l",mac:"Ctrl-l",run:xre},{key:"Mod-i",run:Sre,preventDefault:!0},{key:"Mod-[",run:Zre},{key:"Mod-]",run:Ire},{key:"Mod-Alt-\\",run:jre},{key:"Shift-Mod-k",run:Nre},{key:"Shift-Mod-\\",run:cre},{key:"Mod-/",run:Une},{key:"Alt-A",run:qne},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Xre}].concat(Ure);class qre{constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=pn(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),s=i.search(Fre(e));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function E_(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Yre(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let s=1;s<i.length;s++)n[i[s]]=!0}let r=E_(e)+E_(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function Gre(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:Yre(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:n}:null}}function Wre(t,e){return n=>{for(let r=pn(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}function Fre(t,e){var n;let{source:r}=t,i=r[r.length-1]!="$";return i?new RegExp(`(?:${r})${i?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":""):t}const Hre=Xo.define(),Kre=Me.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Jre{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class Ok{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Sr.TrackDel),r=e.mapPos(this.to,1,Sr.TrackDel);return n==null||r==null?null:new Ok(this.field,n,r)}}class yk{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],s=e.doc.lineAt(n),a=/^\s*/.exec(s.text)[0];for(let u of this.lines){if(r.length){let d=a,h=/^\t*/.exec(u)[0].length;for(let g=0;g<h;g++)d+=e.facet(Bh);i.push(n+d.length-h),u=d+u.slice(h)}r.push(u),n+=u.length+1}let l=this.fieldPositions.map(u=>new Ok(u.field,i[u.line]+u.from,i[u.line]+u.to));return{text:r,ranges:l}}static parse(e){let n=[],r=[],i=[],s;for(let a of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let l=s[1]?+s[1]:null,u=s[2]||s[3]||"",d=-1,h=u.replace(/\\[{}]/g,g=>g[1]);for(let g=0;g<n.length;g++)(l!=null?n[g].seq==l:h&&n[g].name==h)&&(d=g);if(d<0){let g=0;for(;g<n.length&&(l==null||n[g].seq!=null&&n[g].seq<l);)g++;n.splice(g,0,{seq:l,name:h}),d=g;for(let m of i)m.field>=d&&m.field++}for(let g of i)if(g.line==r.length&&g.from>s.index){let m=s[2]?3+(s[1]||"").length:2;g.from-=m,g.to-=m}i.push(new Jre(d,r.length,s.index,s.index+h.length)),a=a.slice(0,s.index)+u+a.slice(s.index+s[0].length)}a=a.replace(/\\([{}])/g,(l,u,d)=>{for(let h of i)h.line==r.length&&h.from>d&&(h.from--,h.to--);return u}),r.push(a)}return new yk(r,i)}}let eie=At.widget({widget:new class extends qu{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),tie=At.mark({class:"cm-snippetField"});class Wu{constructor(e,n){this.ranges=e,this.active=n,this.deco=At.set(e.map(r=>(r.from==r.to?eie:tie).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new Wu(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const Yh=hn.define({map(t,e){return t&&t.map(e)}}),nie=hn.define(),ah=qa.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Yh))return n.value;if(n.is(nie)&&t)return new Wu(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>Me.decorations.from(t,e=>e?e.deco:At.none)});function bk(t,e){return le.create(t.filter(n=>n.field==e).map(n=>le.range(n.from,n.to)))}function rie(t){let e=yk.parse(t);return(n,r,i,s)=>{let{text:a,ranges:l}=e.instantiate(n.state,i),{main:u}=n.state.selection,d={changes:{from:i,to:s==u.from?u.to:s,insert:pt.of(a)},scrollIntoView:!0,annotations:r?[Hre.of(r),Bi.userEvent.of("input.complete")]:void 0};if(l.length&&(d.selection=bk(l,0)),l.some(h=>h.field>0)){let h=new Wu(l,0),g=d.effects=[Yh.of(h)];n.state.field(ah,!1)===void 0&&g.push(hn.appendConfig.of([ah,lie,cie,Kre]))}n.dispatch(n.state.update(d))}}function Xj(t){return({state:e,dispatch:n})=>{let r=e.field(ah,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,s=t>0&&!r.ranges.some(a=>a.field==i+t);return n(e.update({selection:bk(r.ranges,i),effects:Yh.of(s?null:new Wu(r.ranges,i)),scrollIntoView:!0})),!0}}const iie=({state:t,dispatch:e})=>t.field(ah,!1)?(e(t.update({effects:Yh.of(null)})),!0):!1,sie=Xj(1),oie=Xj(-1),aie=[{key:"Tab",run:sie,shift:oie},{key:"Escape",run:iie}],R_=Re.define({combine(t){return t.length?t[0]:aie}}),lie=Lh.highest(Ey.compute([R_],t=>t.facet(R_)));function Ir(t,e){return{...e,apply:rie(t)}}const cie=Me.domEventHandlers({mousedown(t,e){let n=e.state.field(ah,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:bk(n.ranges,i.field),effects:Yh.of(n.ranges.some(s=>s.field>i.field)?new Wu(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Bj=new class extends La{};Bj.startSide=1;Bj.endSide=-1;class mO{static create(e,n,r,i,s){let a=i+(i<<8)+e+(n<<4)|0;return new mO(e,n,r,a,s,[],[])}constructor(e,n,r,i,s,a,l){this.type=e,this.value=n,this.from=r,this.hash=i,this.end=s,this.children=a,this.positions=l,this.hashProp=[[Le.contextHash,i]]}addChild(e,n){e.prop(Le.contextHash)!=this.hash&&(e=new kt(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(n)}toTree(e,n=this.end){let r=this.children.length-1;return r>=0&&(n=Math.max(n,this.positions[r]+this.children[r].length+this.from)),new kt(e.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(i,s,a)=>new kt(Ln.none,i,s,a,this.hashProp)})}}var de;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(de||(de={}));class uie{constructor(e,n){this.start=e,this.content=n,this.marks=[],this.parsers=[]}}class fie{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return Ld(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,n=0,r=0){for(let i=n;i<e;i++)r+=this.text.charCodeAt(i)==9?4-r%4:1;return r}findColumn(e){let n=0;for(let r=0;n<this.text.length&&r<e;n++)r+=this.text.charCodeAt(n)==9?4-r%4:1;return n}scrub(){if(!this.baseIndent)return this.text;let e="";for(let n=0;n<this.basePos;n++)e+=" ";return e+this.text.slice(this.basePos)}}function A_(t,e,n){if(n.pos==n.text.length||t!=e.block&&n.indent>=e.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(t.type==de.OrderedList?Sk:xk)(n,e,!1);return r>0&&(t.type!=de.BulletList||vk(n,e,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==t.value}const Uj={[de.Blockquote](t,e,n){return n.next!=62?!1:(n.markers.push(dt(de.QuoteMark,e.lineStart+n.pos,e.lineStart+n.pos+1)),n.moveBase(n.pos+(Gi(n.text.charCodeAt(n.pos+1))?2:1)),t.end=e.lineStart+n.text.length,!0)},[de.ListItem](t,e,n){return n.indent<n.baseIndent+t.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+t.value),!0)},[de.OrderedList]:A_,[de.BulletList]:A_,[de.Document](){return!0}};function Gi(t){return t==32||t==9||t==10||t==13}function Ld(t,e=0){for(;e<t.length&&Gi(t.charCodeAt(e));)e++;return e}function P_(t,e,n){for(;e>n&&Gi(t.charCodeAt(e-1));)e--;return e}function Vj(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let n=e;n<t.text.length;n++)if(t.text.charCodeAt(n)==96)return-1}return e}function qj(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function vk(t,e,n){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let r=1;for(let i=t.pos+1;i<t.text.length;i++){let s=t.text.charCodeAt(i);if(s==t.next)r++;else if(!Gi(s))return-1}return n&&t.next==45&&Wj(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(Jj.SetextHeading)>-1||r<3?-1:1}function Yj(t,e){for(let n=t.stack.length-1;n>=0;n--)if(t.stack[n].type==e)return!0;return!1}function xk(t,e,n){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||Gi(t.text.charCodeAt(t.pos+1)))&&(!n||Yj(e,de.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function Sk(t,e,n){let r=t.pos,i=t.next;for(;i>=48&&i<=57;){r++;if(r==t.text.length)return-1;i=t.text.charCodeAt(r)}return r==t.pos||r>t.pos+9||i!=46&&i!=41||r<t.text.length-1&&!Gi(t.text.charCodeAt(r+1))||n&&!Yj(e,de.OrderedList)&&(t.skipSpace(r+1)==t.text.length||r>t.pos+1||t.next!=49)?-1:r+1-t.pos}function Gj(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let n=e-t.pos;return n>6?-1:n}function Wj(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let n=e;for(;e<t.text.length&&Gi(t.text.charCodeAt(e));)e++;return e==t.text.length?n:-1}const aw=/^[ \t]*$/,Fj=/-->/,Hj=/\?>/,lw=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Fj],[/^\s*<\?/,Hj],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,aw],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,aw]];function Kj(t,e,n){if(t.next!=60)return-1;let r=t.text.slice(t.pos);for(let i=0,s=lw.length-(n?1:0);i<s;i++)if(lw[i][0].test(r))return i;return-1}function __(t,e){let n=t.countIndent(e,t.pos,t.indent),r=t.countIndent(t.skipSpace(e),e,n);return r>=n+5?n+1:r}function ga(t,e,n){let r=t.length-1;r>=0&&t[r].to==e&&t[r].type==de.CodeText?t[r].to=n:t.push(dt(de.CodeText,e,n))}const Wg={LinkReference:void 0,IndentedCode(t,e){let n=e.baseIndent+4;if(e.indent<n)return!1;let r=e.findColumn(n),i=t.lineStart+r,s=t.lineStart+e.text.length,a=[],l=[];for(ga(a,i,s);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){ga(l,t.lineStart-1,t.lineStart);for(let u of e.markers)l.push(u)}else{if(e.indent<n)break;{if(l.length){for(let d of l)d.type==de.CodeText?ga(a,d.from,d.to):a.push(d);l=[]}ga(a,t.lineStart-1,t.lineStart);for(let d of e.markers)a.push(d);s=t.lineStart+e.text.length;let u=t.lineStart+e.findColumn(e.baseIndent+4);u<s&&ga(a,u,s)}}return l.length&&(l=l.filter(u=>u.type!=de.CodeText),l.length&&(e.markers=l.concat(e.markers))),t.addNode(t.buffer.writeElements(a,-i).finish(de.CodeBlock,s-i),i),!0},FencedCode(t,e){let n=Vj(e);if(n<0)return!1;let r=t.lineStart+e.pos,i=e.next,s=n-e.pos,a=e.skipSpace(n),l=P_(e.text,e.text.length,a),u=[dt(de.CodeMark,r,r+s)];a<l&&u.push(dt(de.CodeInfo,t.lineStart+a,t.lineStart+l));for(let d=!0,h=!0,g=!1;t.nextLine()&&e.depth>=t.stack.length;d=!1){let m=e.pos;if(e.indent-e.baseIndent<4)for(;m<e.text.length&&e.text.charCodeAt(m)==i;)m++;if(m-e.pos>=s&&e.skipSpace(m)==e.text.length){for(let O of e.markers)u.push(O);h&&g&&ga(u,t.lineStart-1,t.lineStart),u.push(dt(de.CodeMark,t.lineStart+e.pos,t.lineStart+m)),t.nextLine();break}else{g=!0,d||(ga(u,t.lineStart-1,t.lineStart),h=!1);for(let x of e.markers)u.push(x);let O=t.lineStart+e.basePos,v=t.lineStart+e.text.length;O<v&&(ga(u,O,v),h=!1)}}return t.addNode(t.buffer.writeElements(u,-r).finish(de.FencedCode,t.prevLineEnd()-r),r),!0},Blockquote(t,e){let n=qj(e);return n<0?!1:(t.startContext(de.Blockquote,e.pos),t.addNode(de.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+n),null)},HorizontalRule(t,e){if(vk(e,t,!1)<0)return!1;let n=t.lineStart+e.pos;return t.nextLine(),t.addNode(de.HorizontalRule,n),!0},BulletList(t,e){let n=xk(e,t,!1);if(n<0)return!1;t.block.type!=de.BulletList&&t.startContext(de.BulletList,e.basePos,e.next);let r=__(e,e.pos+1);return t.startContext(de.ListItem,e.basePos,r-e.baseIndent),t.addNode(de.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},OrderedList(t,e){let n=Sk(e,t,!1);if(n<0)return!1;t.block.type!=de.OrderedList&&t.startContext(de.OrderedList,e.basePos,e.text.charCodeAt(e.pos+n-1));let r=__(e,e.pos+n);return t.startContext(de.ListItem,e.basePos,r-e.baseIndent),t.addNode(de.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},ATXHeading(t,e){let n=Gj(e);if(n<0)return!1;let r=e.pos,i=t.lineStart+r,s=P_(e.text,e.text.length,r),a=s;for(;a>r&&e.text.charCodeAt(a-1)==e.next;)a--;(a==s||a==r||!Gi(e.text.charCodeAt(a-1)))&&(a=e.text.length);let l=t.buffer.write(de.HeaderMark,0,n).writeElements(t.parser.parseInline(e.text.slice(r+n+1,a),i+n+1),-i);a<e.text.length&&l.write(de.HeaderMark,a-r,s-r);let u=l.finish(de.ATXHeading1-1+n,e.text.length-r);return t.nextLine(),t.addNode(u,i),!0},HTMLBlock(t,e){let n=Kj(e,t,!1);if(n<0)return!1;let r=t.lineStart+e.pos,i=lw[n][1],s=[],a=i!=aw;for(;!i.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){a=!1;break}for(let d of e.markers)s.push(d)}a&&t.nextLine();let l=i==Fj?de.CommentBlock:i==Hj?de.ProcessingInstructionBlock:de.HTMLBlock,u=t.prevLineEnd();return t.addNode(t.buffer.writeElements(s,-r).finish(l,u-r),r),!0},SetextHeading:void 0};class die{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,n,r){if(this.stage==-1)return!1;let i=r.content+`
298
+ `+n.scrub(),s=this.advance(i);return s>-1&&s<i.length?this.complete(e,r,s):!1}finish(e,n){return(this.stage==2||this.stage==3)&&Ld(n.content,this.pos)==n.content.length?this.complete(e,n,n.content.length):!1}complete(e,n,r){return e.addLeafElement(n,dt(de.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(l5(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(dt(de.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(o5(e,Ld(e,this.pos),this.start)))return-1}else if(this.stage==2){let n=Ld(e,this.pos),r=0;if(n>this.pos){let i=a5(e,n,this.start);if(i){let s=yx(e,i.to-this.start);s>0&&(this.nextStage(i),r=s)}}return r||(r=yx(e,this.pos)),r>0&&r<e.length?r:-1}else return yx(e,this.pos)}}}function yx(t,e){for(;e<t.length;e++){let n=t.charCodeAt(e);if(n==10)break;if(!Gi(n))return-1}return e}class hie{nextLine(e,n,r){let i=n.depth<e.stack.length?-1:Wj(n),s=n.next;if(i<0)return!1;let a=dt(de.HeaderMark,e.lineStart+n.pos,e.lineStart+i);return e.nextLine(),e.addLeafElement(r,dt(s==61?de.SetextHeading1:de.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),a])),!0}finish(){return!1}}const Jj={LinkReference(t,e){return e.content.charCodeAt(0)==91?new die(e):null},SetextHeading(){return new hie}},pie=[(t,e)=>Gj(e)>=0,(t,e)=>Vj(e)>=0,(t,e)=>qj(e)>=0,(t,e)=>xk(e,t,!0)>=0,(t,e)=>Sk(e,t,!0)>=0,(t,e)=>vk(e,t,!0)>=0,(t,e)=>Kj(e,t,!0)>=0],gie={text:"",end:0};class mie{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.line=new fie,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=mO.create(de.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new bie(r,n):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let i=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!i||e.markers[r].from<i.end);){let s=e.markers[r++];this.addNode(s.type,s.from,s.to)}if(!i)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let i=r(this,e);if(i!=!1){if(i==!0)return null;e.forward();continue e}}break}let n=new uie(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let i=r(this,n);i&&n.parsers.push(i)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,n))break e}for(let r of n.parsers)if(r.nextLine(this,e,n))return null;n.content+=`
299
+ `+e.scrub();for(let r of e.markers)n.marks.push(r)}return this.finishLeaf(n),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let n=this.fragments.takeNodes(this);return n?(this.absoluteLineStart+=n,this.lineStart=c5(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let n=gie;if(n.end=e,e>=this.to)n.text="";else if(n.text=this.lineChunkAt(e),n.end+=n.text.length,this.ranges.length>1){let r=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<n.end;){i++;let s=this.ranges[i].from,a=this.lineChunkAt(s);n.end=s+a.length,n.text=n.text.slice(0,this.ranges[i-1].to-r)+a,r=n.end-n.text.length}}return n}readLine(){let{line:e}=this,{text:n,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(n);e.depth<this.stack.length;e.depth++){let i=this.stack[e.depth],s=this.parser.skipContextMarkup[i.type];if(!s)throw new Error("Unhandled block context "+de[i.type]);let a=this.line.markers.length;if(!s(i,this,e)){this.line.markers.length>a&&(i.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let n=this.input.chunk(e),r;if(this.input.lineChunks)r=n==`
300
+ `?"":n;else{let i=n.indexOf(`
301
+ `);r=i<0?n:n.slice(0,i)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,n,r=0){this.block=mO.create(e,r,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,n,r=0){this.startContext(this.parser.getNodeType(e),n,r)}addNode(e,n,r){typeof e=="number"&&(e=new kt(this.parser.nodeSet.types[e],Qu,Qu,(r??this.prevLineEnd())-n)),this.block.addChild(e,n-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,n){this.addNode(this.buffer.writeElements(uw(n.children,e.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let e=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(e.toTree(this.parser.nodeSet),e.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?e5(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let n=uw(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(n,-e.start).finish(de.Paragraph,e.content.length),e.start)}elt(e,n,r,i){return typeof e=="string"?dt(this.parser.getNodeType(e),n,r,i):new r5(e,n)}get buffer(){return new n5(this.parser.nodeSet)}}function e5(t,e,n,r,i){let s=t[e].to,a=[],l=[],u=n.from+r;function d(h,g){for(;g?h>=s:h>s;){let m=t[e+1].from-s;r+=m,h+=m,e++,s=t[e].to}}for(let h=n.firstChild;h;h=h.nextSibling){d(h.from+r,!0);let g=h.from+r,m,O=i.get(h.tree);O?m=O:h.to+r>s?(m=e5(t,e,h,r,i),d(h.to+r,!1)):m=h.toTree(),a.push(m),l.push(g-u)}return d(n.to+r,!1),new kt(n.type,a,l,n.to+r-u,n.tree?n.tree.propValues:void 0)}class My extends ek{constructor(e,n,r,i,s,a,l,u,d){super(),this.nodeSet=e,this.blockParsers=n,this.leafBlockParsers=r,this.blockNames=i,this.endLeafBlock=s,this.skipContextMarkup=a,this.inlineParsers=l,this.inlineNames=u,this.wrappers=d,this.nodeTypes=Object.create(null);for(let h of e.types)this.nodeTypes[h.name]=h.id}createParse(e,n,r){let i=new mie(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}configure(e){let n=cw(e);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,s=this.blockParsers.slice(),a=this.leafBlockParsers.slice(),l=this.blockNames.slice(),u=this.inlineParsers.slice(),d=this.inlineNames.slice(),h=this.endLeafBlock.slice(),g=this.wrappers;if(dd(n.defineNodes)){i=Object.assign({},i);let m=r.types.slice(),O;for(let v of n.defineNodes){let{name:x,block:k,composite:C,style:Q}=typeof v=="string"?{name:v}:v;if(m.some(P=>P.name==x))continue;C&&(i[m.length]=(P,$,_)=>C($,_,P.value));let R=m.length,E=C?["Block","BlockContext"]:k?R>=de.ATXHeading1&&R<=de.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;m.push(Ln.define({id:R,name:x,props:E&&[[Le.group,E]]})),Q&&(O||(O={}),Array.isArray(Q)||Q instanceof fi?O[x]=Q:Object.assign(O,Q))}r=new jh(m),O&&(r=r.extend(Yu(O)))}if(dd(n.props)&&(r=r.extend(...n.props)),dd(n.remove))for(let m of n.remove){let O=this.blockNames.indexOf(m),v=this.inlineNames.indexOf(m);O>-1&&(s[O]=a[O]=void 0),v>-1&&(u[v]=void 0)}if(dd(n.parseBlock))for(let m of n.parseBlock){let O=l.indexOf(m.name);if(O>-1)s[O]=m.parse,a[O]=m.leaf;else{let v=m.before?Fg(l,m.before):m.after?Fg(l,m.after)+1:l.length-1;s.splice(v,0,m.parse),a.splice(v,0,m.leaf),l.splice(v,0,m.name)}m.endLeaf&&h.push(m.endLeaf)}if(dd(n.parseInline))for(let m of n.parseInline){let O=d.indexOf(m.name);if(O>-1)u[O]=m.parse;else{let v=m.before?Fg(d,m.before):m.after?Fg(d,m.after)+1:d.length-1;u.splice(v,0,m.parse),d.splice(v,0,m.name)}}return n.wrap&&(g=g.concat(n.wrap)),new My(r,s,a,l,h,i,u,d,g)}getNodeType(e){let n=this.nodeTypes[e];if(n==null)throw new RangeError(`Unknown node type '${e}'`);return n}parseInline(e,n){let r=new wk(this,e,n);e:for(let i=n;i<r.end;){let s=r.char(i);for(let a of this.inlineParsers)if(a){let l=a(r,s,i);if(l>=0){i=l;continue e}}i++}return r.resolveMarkers(0)}}function dd(t){return t!=null&&t.length>0}function cw(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=cw(t[0]);if(t.length==1)return e;let n=cw(t.slice(1));if(!n||!e)return e||n;let r=(a,l)=>(a||Qu).concat(l||Qu),i=e.wrap,s=n.wrap;return{props:r(e.props,n.props),defineNodes:r(e.defineNodes,n.defineNodes),parseBlock:r(e.parseBlock,n.parseBlock),parseInline:r(e.parseInline,n.parseInline),remove:r(e.remove,n.remove),wrap:i?s?(a,l,u,d)=>i(s(a,l,u,d),l,u,d):i:s}}function Fg(t,e){let n=t.indexOf(e);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return n}let t5=[Ln.none];for(let t=1,e;e=de[t];t++)t5[t]=Ln.define({id:t,name:e,props:t>=de.Escape?[]:[[Le.group,t in Uj?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const Qu=[];let n5=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,n,r,i=0){return this.content.push(e,n,r,4+i*4),this}writeElements(e,n=0){for(let r of e)r.writeTo(this,n);return this}finish(e,n){return kt.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:n})}},lh=class{constructor(e,n,r,i=Qu){this.type=e,this.from=n,this.to=r,this.children=i}writeTo(e,n){let r=e.content.length;e.writeElements(this.children,n),e.content.push(this.type,this.from+n,this.to+n,e.content.length+4-r)}toTree(e){return new n5(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class r5{constructor(e,n){this.tree=e,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Qu}writeTo(e,n){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function dt(t,e,n,r){return new lh(t,e,n,r)}const i5={resolve:"Emphasis",mark:"EmphasisMark"},s5={resolve:"Emphasis",mark:"EmphasisMark"},vl={},OO={};class li{constructor(e,n,r,i){this.type=e,this.from=n,this.to=r,this.side=i}}const $_="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let ch=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{ch=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const bx={Escape(t,e,n){if(e!=92||n==t.end-1)return-1;let r=t.char(n+1);for(let i=0;i<$_.length;i++)if($_.charCodeAt(i)==r)return t.append(dt(de.Escape,n,n+2));return-1},Entity(t,e,n){if(e!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(n+1,n+31));return r?t.append(dt(de.Entity,n,n+1+r[0].length)):-1},InlineCode(t,e,n){if(e!=96||n&&t.char(n-1)==96)return-1;let r=n+1;for(;r<t.end&&t.char(r)==96;)r++;let i=r-n,s=0;for(;r<t.end;r++)if(t.char(r)==96){if(s++,s==i&&t.char(r+1)!=96)return t.append(dt(de.InlineCode,n,r+1,[dt(de.CodeMark,n,n+i),dt(de.CodeMark,r+1-i,r+1)]))}else s=0;return-1},HTMLTag(t,e,n){if(e!=60||n==t.end-1)return-1;let r=t.slice(n+1,t.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return t.append(dt(de.Autolink,n,n+1+i[0].length,[dt(de.LinkMark,n,n+1),dt(de.URL,n+1,n+i[0].length),dt(de.LinkMark,n+i[0].length,n+1+i[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(s)return t.append(dt(de.Comment,n,n+1+s[0].length));let a=/^\?[^]*?\?>/.exec(r);if(a)return t.append(dt(de.ProcessingInstruction,n,n+1+a[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return l?t.append(dt(de.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(t,e,n){if(e!=95&&e!=42)return-1;let r=n+1;for(;t.char(r)==e;)r++;let i=t.slice(n-1,n),s=t.slice(r,r+1),a=ch.test(i),l=ch.test(s),u=/\s|^$/.test(i),d=/\s|^$/.test(s),h=!d&&(!l||u||a),g=!u&&(!a||d||l),m=h&&(e==42||!g||a),O=g&&(e==42||!h||l);return t.append(new li(e==95?i5:s5,n,r,(m?1:0)|(O?2:0)))},HardBreak(t,e,n){if(e==92&&t.char(n+1)==10)return t.append(dt(de.HardBreak,n,n+2));if(e==32){let r=n+1;for(;t.char(r)==32;)r++;if(t.char(r)==10&&r>=n+2)return t.append(dt(de.HardBreak,n,r+1))}return-1},Link(t,e,n){return e==91?t.append(new li(vl,n,n+1,1)):-1},Image(t,e,n){return e==33&&t.char(n+1)==91?t.append(new li(OO,n,n+2,1)):-1},LinkEnd(t,e,n){if(e!=93)return-1;for(let r=t.parts.length-1;r>=0;r--){let i=t.parts[r];if(i instanceof li&&(i.type==vl||i.type==OO)){if(!i.side||t.skipSpace(i.to)==n&&!/[(\[]/.test(t.slice(n+1,n+2)))return t.parts[r]=null,-1;let s=t.takeContent(r),a=t.parts[r]=Oie(t,s,i.type==vl?de.Link:de.Image,i.from,n+1);if(i.type==vl)for(let l=0;l<r;l++){let u=t.parts[l];u instanceof li&&u.type==vl&&(u.side=0)}return a.to}}return-1}};function Oie(t,e,n,r,i){let{text:s}=t,a=t.char(i),l=i;if(e.unshift(dt(de.LinkMark,r,r+(n==de.Image?2:1))),e.push(dt(de.LinkMark,i-1,i)),a==40){let u=t.skipSpace(i+1),d=o5(s,u-t.offset,t.offset),h;d&&(u=t.skipSpace(d.to),u!=d.to&&(h=a5(s,u-t.offset,t.offset),h&&(u=t.skipSpace(h.to)))),t.char(u)==41&&(e.push(dt(de.LinkMark,i,i+1)),l=u+1,d&&e.push(d),h&&e.push(h),e.push(dt(de.LinkMark,u,l)))}else if(a==91){let u=l5(s,i-t.offset,t.offset,!1);u&&(e.push(u),l=u.to)}return dt(n,r,l,e)}function o5(t,e,n){if(t.charCodeAt(e)==60){for(let i=e+1;i<t.length;i++){let s=t.charCodeAt(i);if(s==62)return dt(de.URL,e+n,i+1+n);if(s==60||s==10)return!1}return null}else{let i=0,s=e;for(let a=!1;s<t.length;s++){let l=t.charCodeAt(s);if(Gi(l))break;if(a)a=!1;else if(l==40)i++;else if(l==41){if(!i)break;i--}else l==92&&(a=!0)}return s>e?dt(de.URL,e+n,s+n):s==t.length?null:!1}}function a5(t,e,n){let r=t.charCodeAt(e);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let s=e+1,a=!1;s<t.length;s++){let l=t.charCodeAt(s);if(a)a=!1;else{if(l==i)return dt(de.LinkTitle,e+n,s+1+n);l==92&&(a=!0)}}return null}function l5(t,e,n,r){for(let i=!1,s=e+1,a=Math.min(t.length,s+999);s<a;s++){let l=t.charCodeAt(s);if(i)i=!1;else{if(l==93)return r?!1:dt(de.LinkLabel,e+n,s+1+n);if(r&&!Gi(l)&&(r=!1),l==91)return!1;l==92&&(i=!0)}}return null}class wk{constructor(e,n,r){this.parser=e,this.text=n,this.offset=r,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,n){return this.text.slice(e-this.offset,n-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,n,r,i,s){return this.append(new li(e,n,r,(i?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let n=this.parts[e];if(n instanceof li&&(n.type==vl||n.type==OO))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let r=e;r<this.parts.length;r++){let i=this.parts[r];if(!(i instanceof li&&i.type.resolve&&i.side&2))continue;let s=i.type==i5||i.type==s5,a=i.to-i.from,l,u=r-1;for(;u>=e;u--){let x=this.parts[u];if(x instanceof li&&x.side&1&&x.type==i.type&&!(s&&(i.side&1||x.side&2)&&(x.to-x.from+a)%3==0&&((x.to-x.from)%3||a%3))){l=x;break}}if(!l)continue;let d=i.type.resolve,h=[],g=l.from,m=i.to;if(s){let x=Math.min(2,l.to-l.from,a);g=l.to-x,m=i.from+x,d=x==1?"Emphasis":"StrongEmphasis"}l.type.mark&&h.push(this.elt(l.type.mark,g,l.to));for(let x=u+1;x<r;x++)this.parts[x]instanceof lh&&h.push(this.parts[x]),this.parts[x]=null;i.type.mark&&h.push(this.elt(i.type.mark,i.from,m));let O=this.elt(d,g,m,h);this.parts[u]=s&&l.from!=g?new li(l.type,l.from,g,l.side):null,(this.parts[r]=s&&i.to!=m?new li(i.type,m,i.to,i.side):null)?this.parts.splice(r,0,O):this.parts[r]=O}let n=[];for(let r=e;r<this.parts.length;r++){let i=this.parts[r];i instanceof lh&&n.push(i)}return n}findOpeningDelimiter(e){for(let n=this.parts.length-1;n>=0;n--){let r=this.parts[n];if(r instanceof li&&r.type==e&&r.side&1)return n}return null}takeContent(e){let n=this.resolveMarkers(e);return this.parts.length=e,n}getDelimiterAt(e){let n=this.parts[e];return n instanceof li?n:null}skipSpace(e){return Ld(this.text,e-this.offset)+this.offset}elt(e,n,r,i){return typeof e=="string"?dt(this.parser.getNodeType(e),n,r,i):new r5(e,n)}}wk.linkStart=vl;wk.imageStart=OO;function uw(t,e){if(!e.length)return t;if(!t.length)return e;let n=t.slice(),r=0;for(let i of e){for(;r<n.length&&n[r].to<i.to;)r++;if(r<n.length&&n[r].from<i.from){let s=n[r];s instanceof lh&&(n[r]=new lh(s.type,s.from,s.to,uw(s.children,[i])))}else n.splice(r++,0,i)}return n}const yie=[de.CodeBlock,de.ListItem,de.OrderedList,de.BulletList];let bie=class{constructor(e,n){this.fragments=e,this.input=n,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,n){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`
302
+ `;)s--;this.fragmentEnd=s?s-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let i=e+this.fragment.offset;for(;r.to<=i;)if(!r.parent())return!1;for(;;){if(r.from>=i)return this.fragment.from<=n;if(!r.childAfter(i))return!1}}matches(e){let n=this.cursor.tree;return n&&n.prop(Le.contextHash)==e}takeNodes(e){let n=this.cursor,r=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,a=s,l=e.block.children.length,u=a,d=l;for(;;){if(n.to-r>i){if(n.type.isAnonymous&&n.firstChild())continue;break}let h=c5(n.from-r,e.ranges);if(n.to-r<=e.ranges[e.rangeI].to)e.addNode(n.tree,h);else{let g=new kt(e.parser.nodeSet.types[de.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(g,n.tree),e.addNode(g,h)}if(n.type.is("Block")&&(yie.indexOf(n.type.id)<0?(a=n.to-r,l=e.block.children.length):(a=u,l=d),u=n.to-r,d=e.block.children.length),!n.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return a-s}};function c5(t,e){let n=t;for(let r=1;r<e.length;r++){let i=e[r-1].to,s=e[r].from;i<t&&(n-=s-i)}return n}const vie=Yu({"Blockquote/...":j.quote,HorizontalRule:j.contentSeparator,"ATXHeading1/... SetextHeading1/...":j.heading1,"ATXHeading2/... SetextHeading2/...":j.heading2,"ATXHeading3/...":j.heading3,"ATXHeading4/...":j.heading4,"ATXHeading5/...":j.heading5,"ATXHeading6/...":j.heading6,"Comment CommentBlock":j.comment,Escape:j.escape,Entity:j.character,"Emphasis/...":j.emphasis,"StrongEmphasis/...":j.strong,"Link/... Image/...":j.link,"OrderedList/... BulletList/...":j.list,"BlockQuote/...":j.quote,"InlineCode CodeText":j.monospace,"URL Autolink":j.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":j.processingInstruction,"CodeInfo LinkLabel":j.labelName,LinkTitle:j.string,Paragraph:j.content}),xie=new My(new jh(t5).extend(vie),Object.keys(Wg).map(t=>Wg[t]),Object.keys(Wg).map(t=>Jj[t]),Object.keys(Wg),pie,Uj,Object.keys(bx).map(t=>bx[t]),Object.keys(bx),[]);function Sie(t,e,n){let r=[];for(let i=t.firstChild,s=e;;i=i.nextSibling){let a=i?i.from:n;if(a>s&&r.push({from:s,to:a}),!i)break;s=i.to}return r}function wie(t){let{codeParser:e,htmlParser:n}=t;return{wrap:pz((i,s)=>{let a=i.type.id;if(e&&(a==de.CodeBlock||a==de.FencedCode)){let l="";if(a==de.FencedCode){let d=i.node.getChild(de.CodeInfo);d&&(l=s.read(d.from,d.to))}let u=e(l);if(u)return{parser:u,overlay:d=>d.type.id==de.CodeText,bracketed:a==de.FencedCode}}else if(n&&(a==de.HTMLBlock||a==de.HTMLTag||a==de.CommentBlock))return{parser:n,overlay:Sie(i.node,i.from,i.to)};return null})}}const kie={resolve:"Strikethrough",mark:"StrikethroughMark"},Cie={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":j.strikethrough}},{name:"StrikethroughMark",style:j.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,n){if(e!=126||t.char(n+1)!=126||t.char(n+2)==126)return-1;let r=t.slice(n-1,n),i=t.slice(n+2,n+3),s=/\s|^$/.test(r),a=/\s|^$/.test(i),l=ch.test(r),u=ch.test(i);return t.addDelimiter(kie,n,n+2,!a&&(!u||s||l),!s&&(!l||a||u))},after:"Emphasis"}]};function zd(t,e,n=0,r,i=0){let s=0,a=!0,l=-1,u=-1,d=!1,h=()=>{r.push(t.elt("TableCell",i+l,i+u,t.parser.parseInline(e.slice(l,u),i+l)))};for(let g=n;g<e.length;g++){let m=e.charCodeAt(g);m==124&&!d?((!a||l>-1)&&s++,a=!1,r&&(l>-1&&h(),r.push(t.elt("TableDelimiter",g+i,g+i+1))),l=u=-1):(d||m!=32&&m!=9)&&(l<0&&(l=g),u=g+1),d=!d&&m==92}return l>-1&&(s++,r&&h()),s}function M_(t,e){for(let n=e;n<t.length;n++){let r=t.charCodeAt(n);if(r==124)return!0;r==92&&n++}return!1}const u5=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class D_{constructor(){this.rows=null}nextLine(e,n,r){if(this.rows==null){this.rows=!1;let i;if((n.next==45||n.next==58||n.next==124)&&u5.test(i=n.text.slice(n.pos))){let s=[];zd(e,r.content,0,s,r.start)==zd(e,i,n.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,s),e.elt("TableDelimiter",e.lineStart+n.pos,e.lineStart+n.text.length)])}}else if(this.rows){let i=[];zd(e,n.text,n.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+n.pos,e.lineStart+n.text.length,i))}return!1}finish(e,n){return this.rows?(e.addLeafElement(n,e.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const Tie={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":j.heading}},"TableRow",{name:"TableCell",style:j.content},{name:"TableDelimiter",style:j.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return M_(e.content,0)?new D_:null},endLeaf(t,e,n){if(n.parsers.some(i=>i instanceof D_)||!M_(e.text,e.basePos))return!1;let r=t.peekLine();return u5.test(r)&&zd(t,e.text,e.basePos)==zd(t,r,e.basePos)},before:"SetextHeading"}]};class Qie{nextLine(){return!1}finish(e,n){return e.addLeafElement(n,e.elt("Task",n.start,n.start+n.content.length,[e.elt("TaskMarker",n.start,n.start+3),...e.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const Eie={defineNodes:[{name:"Task",block:!0,style:j.list},{name:"TaskMarker",style:j.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new Qie:null},after:"SetextHeading"}]},N_=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,L_=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,Rie=/[\w-]+\.[\w-]+($|\/)/,z_=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,j_=/\/[a-zA-Z\d@.]+/gy;function I_(t,e,n,r){let i=0;for(let s=e;s<n;s++)t[s]==r&&i++;return i}function Aie(t,e){L_.lastIndex=e;let n=L_.exec(t);if(!n||Rie.exec(n[0])[0].indexOf("_")>-1)return-1;let r=e+n[0].length;for(;;){let i=t[r-1],s;if(/[?!.,:*_~]/.test(i)||i==")"&&I_(t,e,r,")")>I_(t,e,r,"("))r--;else if(i==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,r))))r=e+s.index;else break}return r}function Z_(t,e){z_.lastIndex=e;let n=z_.exec(t);if(!n)return-1;let r=n[0][n[0].length-1];return r=="_"||r=="-"?-1:e+n[0].length-(r=="."?1:0)}const Pie={parseInline:[{name:"Autolink",parse(t,e,n){let r=n-t.offset;if(r&&/\w/.test(t.text[r-1]))return-1;N_.lastIndex=r;let i=N_.exec(t.text),s=-1;if(!i)return-1;if(i[1]||i[2]){if(s=Aie(t.text,r+i[0].length),s>-1&&t.hasOpenLink){let a=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(r,s));s=r+a[0].length}}else i[3]?s=Z_(t.text,r):(s=Z_(t.text,r+i[0].length),s>-1&&i[0]=="xmpp:"&&(j_.lastIndex=s,i=j_.exec(t.text),i&&(s=i.index+i[0].length)));return s<0?-1:(t.addElement(t.elt("URL",n,s+t.offset)),s+t.offset)}}]},_ie=[Tie,Eie,Cie,Pie];function f5(t,e,n){return(r,i,s)=>{if(i!=t||r.char(s+1)==t)return-1;let a=[r.elt(n,s,s+1)];for(let l=s+1;l<r.end;l++){let u=r.char(l);if(u==t)return r.addElement(r.elt(e,s,l+1,a.concat(r.elt(n,l,l+1))));if(u==92&&a.push(r.elt("Escape",l,l+++2)),Gi(u))break}return-1}}const $ie={defineNodes:[{name:"Superscript",style:j.special(j.content)},{name:"SuperscriptMark",style:j.processingInstruction}],parseInline:[{name:"Superscript",parse:f5(94,"Superscript","SuperscriptMark")}]},Mie={defineNodes:[{name:"Subscript",style:j.special(j.content)},{name:"SubscriptMark",style:j.processingInstruction}],parseInline:[{name:"Subscript",parse:f5(126,"Subscript","SubscriptMark")}]},Die={defineNodes:[{name:"Emoji",style:j.character}],parseInline:[{name:"Emoji",parse(t,e,n){let r;return e!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(t.slice(n+1,t.end)))?-1:t.addElement(t.elt("Emoji",n,n+1+r[0].length))}}]};var X_={};class yO{constructor(e,n,r,i,s,a,l,u,d,h=0,g){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=s,this.score=a,this.buffer=l,this.bufferBase=u,this.curContext=d,this.lookAhead=h,this.parent=g}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new yO(e,[],n,r,r,0,[],0,i?new B_(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:s}=this.p,a=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(i);if(l&&(this.score+=l),r==0){this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i<s.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,a?8:4,!0),this.reduceContext(i,this.reducePos);return}let u=this.stack.length-(r-1)*3-(e&262144?6:0),d=u?this.stack[u-2]:this.p.ranges[0].from,h=this.reducePos-d;h>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(d==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSize<h&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=d,this.p.lastBigReductionSize=h));let g=u?this.stack[u-1]:0,m=this.bufferBase+this.buffer.length-g;if(i<s.minRepeatTerm||e&131072){let O=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,d,O,m+4,!0)}if(e&262144)this.state=this.stack[u];else{let O=this.stack[u-3];this.state=s.getGoto(O,i,!0)}for(;this.stack.length>u;)this.stack.pop();this.reduceContext(i,d)}storeNode(e,n,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let a=this,l=this.buffer.length;if(l==0&&a.parent&&(l=a.bufferBase-a.parent.bufferBase,a=a.parent),l>0&&a.buffer[l-4]==0&&a.buffer[l-1]>-1){if(n==r)return;if(a.buffer[l-2]>=n){a.buffer[l-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,n,r,i);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let l=!1;for(let u=a;u>0&&this.buffer[u-2]>r;u-=4)if(this.buffer[u-1]>=0){l=!0;break}if(l)for(;a>0&&this.buffer[a-2]>r;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,i>4&&(i-=4)}this.buffer[a]=e,this.buffer[a+1]=n,this.buffer[a+2]=r,this.buffer[a+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:a}=this.p;this.pos=i;let l=a.stateFlag(s,1);!l&&(i>r||n<=a.maxNode)&&(this.reducePos=i),this.pushState(s,l?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=a.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new yO(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new Nie(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let s=0,a;s<n.length;s+=2)(a=n[s+1])!=this.state&&this.p.parser.hasAction(a,e)&&i.push(n[s],a);if(this.stack.length<120)for(let s=0;i.length<8&&s<n.length;s+=2){let a=n[s+1];i.some((l,u)=>u&1&&l==a)||i.push(n[s],a)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let s=n[i+1];if(s==this.state)continue;let a=this.split();a.pushState(s,this.pos),a.storeNode(0,a.pos,a.pos,4,!0),a.shiftContext(n[i],this.pos),a.reducePos=this.pos,a.score-=200,r.push(a)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;n=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,s)=>{if(!n.includes(i))return n.push(i),e.allActions(i,a=>{if(!(a&393216))if(a&65536){let l=(a>>19)-s;if(l>1){let u=a&65535,d=this.stack.length-l*3;if(d>=0&&e.getGoto(this.stack[d],u,!1)>=0)return l<<19|65536|u}}else{let l=r(a,s+1);if(l!=null)return l}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new B_(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class B_{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Nie{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class bO{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new bO(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new bO(this.stack,this.pos,this.index)}}function wd(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let s=0;for(;;){let a=t.charCodeAt(r++),l=!1;if(a==126){s=65535;break}a>=92&&a--,a>=34&&a--;let u=a-32;if(u>=46&&(u-=46,l=!0),s+=u,l)break;s*=46}n?n[i++]=s:n=new e(s)}return n}class xm{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const U_=new xm;class Lie{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=U_,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;s<r.from;){if(!i)return null;let a=this.ranges[--i];s-=r.from-a.to,r=a}for(;n<0?s>r.to:s>=r.to;){if(i==this.ranges.length-1)return null;let a=this.ranges[++i];s+=a.from-r.to,r=a}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(r=s,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let a=this.rangeIndex,l=this.range;for(;l.to<=r;)l=this.ranges[++a];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=U_,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class au{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;d5(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}au.prototype.contextual=au.prototype.fallback=au.prototype.extend=!1;class vO{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?wd(e):e}token(e,n){let r=e.pos,i=0;for(;;){let s=e.next<0,a=e.resolveOffset(1,1);if(d5(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,a==null)break;e.reset(a,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}vO.prototype.contextual=au.prototype.fallback=au.prototype.extend=!1;class yi{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function d5(t,e,n,r,i,s){let a=0,l=1<<r,{dialect:u}=n.p.parser;e:for(;(l&t[a])!=0;){let d=t[a+1];for(let O=a+3;O<d;O+=2)if((t[O+1]&l)>0){let v=t[O];if(u.allows(v)&&(e.token.value==-1||e.token.value==v||zie(v,e.token.value,i,s))){e.acceptToken(v);break}}let h=e.next,g=0,m=t[a+2];if(e.next<0&&m>g&&t[d+m*3-3]==65535){a=t[d+m*3-1];continue e}for(;g<m;){let O=g+m>>1,v=d+O+(O<<1),x=t[v],k=t[v+1]||65536;if(h<x)m=O;else if(h>=k)g=O+1;else{a=t[v+2],e.advance();continue e}}break}}function V_(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function zie(t,e,n,r){let i=V_(n,r,e);return i<0||V_(n,r,t)<i}const ri=typeof process<"u"&&X_&&/\bparse\b/.test(X_.LOG);let vx=null;function q_(t,e,n){let r=t.cursor(Rt.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class jie{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?q_(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?q_(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=r.children[i],a=this.start[n]+r.positions[i];if(a>e)return this.nextStart=a,null;if(s instanceof kt){if(a==e){if(a<this.safeFrom)return null;let l=a+s.length;if(l<=this.safeTo){let u=s.prop(Le.lookAhead);if(!u||l+u<this.fragment.to)return s}}this.index[n]++,a+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(a),this.index.push(0))}else this.index[n]++,this.nextStart=a+s.length}}}class Iie{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new xm)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,a=i.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,u=0;for(let d=0;d<s.length;d++){if((1<<d&a)==0)continue;let h=s[d],g=this.tokens[d];if(!(r&&!h.fallback)&&((h.contextual||g.start!=e.pos||g.mask!=a||g.context!=l)&&(this.updateCachedToken(g,h,e),g.mask=a,g.context=l),g.lookAhead>g.end+25&&(u=Math.max(g.lookAhead,u)),g.value!=0)){let m=n;if(g.extended>-1&&(n=this.addActions(e,g.extended,g.end,n)),n=this.addActions(e,g.value,g.end,n),!h.extend&&(r=g,n>m))break}}for(;this.actions.length>n;)this.actions.pop();return u&&e.setLookAhead(u),!r&&e.pos==this.stream.end&&(r=new xm,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new xm,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let a=0;a<s.specialized.length;a++)if(s.specialized[a]==e.value){let l=s.specializers[a](this.stream.read(e.start,e.end),r);if(l>=0&&r.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let s=0;s<i;s+=3)if(this.actions[s]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:s}=e,{parser:a}=e.p,{data:l}=a;for(let u=0;u<2;u++)for(let d=a.stateSlot(s,u?2:1);;d+=3){if(l[d]==65535)if(l[d+1]==1)d=wo(l,d+2);else{i==0&&l[d+1]==2&&(i=this.putAction(wo(l,d+2),n,r,i));break}l[d]==n&&(i=this.putAction(wo(l,d+1),n,r,i))}return i}}class Zie{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Lie(n,i),this.tokens=new Iie(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[yO.start(this,e.top[0],s)],this.fragments=r.length&&this.stream.end-s>e.bufferLength*4?new jie(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let l=e[a];for(;;){if(this.tokens.mainToken=null,l.pos>n)r.push(l);else{if(this.advanceStack(l,r,e))continue;{i||(i=[],s=[]),i.push(l);let u=this.tokens.getMainToken(l);s.push(u.value,u.end)}}break}}if(!r.length){let a=i&&Bie(i);if(a)return ri&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw ri&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let a=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(a)return ri&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(r.length>a)for(r.sort((l,u)=>u.score-l.score);r.length>a;)r.pop();r.some(l=>l.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a<r.length-1;a++){let l=r[a];for(let u=a+1;u<r.length;u++){let d=r[u];if(l.sameState(d)||l.buffer.length>500&&d.buffer.length>500)if((l.score-d.score||l.buffer.length-d.buffer.length)>0)r.splice(u--,1);else{r.splice(a--,1);continue e}}}r.length>12&&(r.sort((a,l)=>l.score-a.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let a=1;a<r.length;a++)r[a].pos<this.minStackPos&&(this.minStackPos=r[a].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let i=e.pos,{parser:s}=this,a=ri?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let d=e.curContext&&e.curContext.tracker.strict,h=d?e.curContext.hash:0;for(let g=this.fragments.nodeAt(i);g;){let m=this.parser.nodeSet.types[g.type.id]==g.type?s.getGoto(e.state,g.type.id):-1;if(m>-1&&g.length&&(!d||(g.prop(Le.contextHash)||0)==h))return e.useNode(g,m),ri&&console.log(a+this.stackID(e)+` (via reuse of ${s.getName(g.type.id)})`),!0;if(!(g instanceof kt)||g.children.length==0||g.positions[0]>0)break;let O=g.children[0];if(O instanceof kt&&g.positions[0]==0)g=O;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),ri&&console.log(a+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let u=this.tokens.getActions(e);for(let d=0;d<u.length;){let h=u[d++],g=u[d++],m=u[d++],O=d==u.length||!r,v=O?e:e.split(),x=this.tokens.mainToken;if(v.apply(h,g,x?x.start:v.pos,m),ri&&console.log(a+this.stackID(v)+` (via ${(h&65536)==0?"shift":`reduce of ${s.getName(h&65535)}`} for ${s.getName(g)} @ ${i}${v==e?"":", split"})`),O)return!0;v.pos>i?n.push(v):r.push(v)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return Y_(e,n),!0}}runRecovery(e,n,r){let i=null,s=!1;for(let a=0;a<e.length;a++){let l=e[a],u=n[a<<1],d=n[(a<<1)+1],h=ri?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),ri&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,r))))continue;let g=l.split(),m=h;for(let O=0;O<10&&g.forceReduce()&&(ri&&console.log(m+this.stackID(g)+" (via force-reduce)"),!this.advanceFully(g,r));O++)ri&&(m=this.stackID(g)+" -> ");for(let O of l.recoverByInsert(u))ri&&console.log(h+this.stackID(O)+" (via recover-insert)"),this.advanceFully(O,r);this.stream.end>l.pos?(d==l.pos&&(d++,u=0),l.recoverByDelete(u,d),ri&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(u)})`),Y_(l,r)):(!i||i.score<g.score)&&(i=g)}return i}stackToTree(e){return e.close(),kt.build({buffer:bO.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(vx||(vx=new WeakMap)).get(e);return n||vx.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function Y_(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class Xie{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const xx=t=>t;class h5{constructor(e){this.start=e.start,this.shift=e.shift||xx,this.reduce=e.reduce||xx,this.reuse=e.reuse||xx,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Eu extends ek{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;l<e.repeatNodeCount;l++)n.push("");let r=Object.keys(e.topRules).map(l=>e.topRules[l][1]),i=[];for(let l=0;l<n.length;l++)i.push([]);function s(l,u,d){i[l].push([u,u.deserialize(String(d))])}if(e.nodeProps)for(let l of e.nodeProps){let u=l[0];typeof u=="string"&&(u=Le[u]);for(let d=1;d<l.length;){let h=l[d++];if(h>=0)s(h,u,l[d++]);else{let g=l[d+-h];for(let m=-h;m>0;m--)s(l[d++],u,g);d++}}}this.nodeSet=new jh(n.map((l,u)=>Ln.define({name:u>=this.minRepeatTerm?void 0:l,id:u,props:i[u],top:r.indexOf(u)>-1,error:u==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(u)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=cz;let a=wd(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(G_),this.states=wd(e.states,Uint32Array),this.data=wd(e.stateData),this.goto=wd(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new au(a,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new Zie(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let s=i[n+1];;){let a=i[s++],l=a&1,u=i[s++];if(l&&r)return u;for(let d=s+(a>>1);s<d;s++)if(i[s]==e)return u;if(l)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let s=this.stateSlot(e,i?2:1),a;;s+=3){if((a=r[s])==65535)if(r[s+1]==1)a=r[s=wo(r,s+2)];else{if(r[s+1]==2)return wo(r,s+2);break}if(a==n||a==0)return wo(r,s+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=wo(this.data,s+2);else break;i=n(wo(this.data,s+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=wo(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((s,a)=>a&1&&s==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(Eu.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(l=>l.from==r.external);if(!s)return r;let a=Object.assign(Object.assign({},r),{external:s.to});return n.specializers[i]=G_(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let s of e.split(" ")){let a=n.indexOf(s);a>=0&&(r[a]=!0)}let i=null;for(let s=0;s<n.length;s++)if(!r[s])for(let a=this.dialects[n[s]],l;(l=this.data[a++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[l]=1;return new Xie(e,r,i)}static deserialize(e){return new Eu(e)}}function wo(t,e){return t[e]|t[e+1]<<16}function Bie(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function G_(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const Uie=55,Vie=1,qie=56,Yie=2,Gie=57,Wie=3,W_=4,Fie=5,kk=6,p5=7,g5=8,m5=9,O5=10,Hie=11,Kie=12,Jie=13,Sx=58,ese=14,tse=15,F_=59,y5=21,nse=23,b5=24,rse=25,fw=27,v5=28,ise=29,sse=32,ose=35,ase=37,lse=38,cse=0,use=1,fse={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},dse={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},H_={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function hse(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let K_=null,J_=null,e$=0;function dw(t,e){let n=t.pos+e;if(e$==n&&J_==t)return K_;let r=t.peek(e),i="";for(;hse(r);)i+=String.fromCharCode(r),r=t.peek(++e);return J_=t,e$=n,K_=i?i.toLowerCase():r==pse||r==gse?void 0:null}const x5=60,xO=62,Ck=47,pse=63,gse=33,mse=45;function t$(t,e){this.name=t,this.parent=e}const Ose=[kk,O5,p5,g5,m5],yse=new h5({start:null,shift(t,e,n,r){return Ose.indexOf(e)>-1?new t$(dw(r,1)||"",t):t},reduce(t,e){return e==y5&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==kk||i==ase?new t$(dw(r,1)||"",t):t},strict:!1}),bse=new yi((t,e)=>{if(t.next!=x5){t.next<0&&e.context&&t.acceptToken(Sx);return}t.advance();let n=t.next==Ck;n&&t.advance();let r=dw(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?tse:ese);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(Hie);if(i&&dse[i])return t.acceptToken(Sx,-2);if(e.dialectEnabled(cse))return t.acceptToken(Kie);for(let s=e.context;s;s=s.parent)if(s.name==r)return;t.acceptToken(Jie)}else{if(r=="script")return t.acceptToken(p5);if(r=="style")return t.acceptToken(g5);if(r=="textarea")return t.acceptToken(m5);if(fse.hasOwnProperty(r))return t.acceptToken(O5);i&&H_[i]&&H_[i][r]?t.acceptToken(Sx,-1):t.acceptToken(kk)}},{contextual:!0}),vse=new yi(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(F_);break}if(t.next==mse)e++;else if(t.next==xO&&e>=2){n>=3&&t.acceptToken(F_,-2);break}else e=0;t.advance()}});function xse(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const Sse=new yi((t,e)=>{if(t.next==Ck&&t.peek(1)==xO){let n=e.dialectEnabled(use)||xse(e.context);t.acceptToken(n?Fie:W_,2)}else t.next==xO&&t.acceptToken(W_,1)});function Tk(t,e,n){let r=2+t.length;return new yi(i=>{for(let s=0,a=0,l=0;;l++){if(i.next<0){l&&i.acceptToken(e);break}if(s==0&&i.next==x5||s==1&&i.next==Ck||s>=2&&s<r&&i.next==t.charCodeAt(s-2))s++,a++;else if(s==r&&i.next==xO){l>a?i.acceptToken(e,-a):i.acceptToken(n,-(a-2));break}else if((i.next==10||i.next==13)&&l){i.acceptToken(e,1);break}else s=a=0;i.advance()}})}const wse=Tk("script",Uie,Vie),kse=Tk("style",qie,Yie),Cse=Tk("textarea",Gie,Wie),Tse=Yu({"Text RawText IncompleteTag IncompleteCloseTag":j.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":j.angleBracket,TagName:j.tagName,"MismatchedCloseTag/TagName":[j.tagName,j.invalid],AttributeName:j.attributeName,"AttributeValue UnquotedAttributeValue":j.attributeValue,Is:j.definitionOperator,"EntityReference CharacterReference":j.character,Comment:j.blockComment,ProcessingInst:j.processingInstruction,DoctypeDecl:j.documentMeta}),Qse=Eu.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G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O~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:yse,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[Tse],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}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S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[wse,kse,Cse,Sse,bse,vse,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function S5(t,e){let n=Object.create(null);for(let r of t.getChildren(b5)){let i=r.getChild(rse),s=r.getChild(fw)||r.getChild(v5);i&&(n[e.read(i.from,i.to)]=s?s.type.id==fw?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return n}function n$(t,e){let n=t.getChild(nse);return n?e.read(n.from,n.to):" "}function wx(t,e,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||(r=S5(t.node.parent.firstChild,e))))return{parser:i.parser,bracketed:!0};return null}function w5(t=[],e=[]){let n=[],r=[],i=[],s=[];for(let l of t)(l.tag=="script"?n:l.tag=="style"?r:l.tag=="textarea"?i:s).push(l);let a=e.length?Object.create(null):null;for(let l of e)(a[l.name]||(a[l.name]=[])).push(l);return pz((l,u)=>{let d=l.type.id;if(d==ise)return wx(l,u,n);if(d==sse)return wx(l,u,r);if(d==ose)return wx(l,u,i);if(d==y5&&s.length){let h=l.node,g=h.firstChild,m=g&&n$(g,u),O;if(m){for(let v of s)if(v.tag==m&&(!v.attrs||v.attrs(O||(O=S5(g,u))))){let x=h.lastChild,k=x.type.id==lse?x.from:h.to;if(k>g.to)return{parser:v.parser,overlay:[{from:g.to,to:k}]}}}}if(a&&d==b5){let h=l.node,g;if(g=h.firstChild){let m=a[u.read(g.from,g.to)];if(m)for(let O of m){if(O.tagName&&O.tagName!=n$(h.parent,u))continue;let v=h.lastChild;if(v.type.id==fw){let x=v.from+1,k=v.lastChild,C=v.to-(k&&k.isError?0:1);if(C>x)return{parser:O.parser,overlay:[{from:x,to:C}],bracketed:!0}}else if(v.type.id==v5)return{parser:O.parser,overlay:[{from:v.from,to:v.to}]}}}}return null})}const Ese=122,r$=1,Rse=123,Ase=124,k5=2,Pse=125,_se=3,$se=4,C5=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Mse=58,Dse=40,T5=95,Nse=91,Sm=45,Lse=46,zse=35,jse=37,Ise=38,Zse=92,Xse=10,Bse=42;function uh(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function Qk(t){return t>=48&&t<=57}function i$(t){return Qk(t)||t>=97&&t<=102||t>=65&&t<=70}const Q5=(t,e,n)=>(r,i)=>{for(let s=!1,a=0,l=0;;l++){let{next:u}=r;if(uh(u)||u==Sm||u==T5||s&&Qk(u))!s&&(u!=Sm||l>0)&&(s=!0),a===l&&u==Sm&&a++,r.advance();else if(u==Zse&&r.peek(1)!=Xse){if(r.advance(),i$(r.next)){do r.advance();while(i$(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();s=!0}else{s&&r.acceptToken(a==2&&i.canShift(k5)?e:u==Dse?n:t);break}}},Use=new yi(Q5(Rse,k5,Ase)),Vse=new yi(Q5(Pse,_se,$se)),qse=new yi(t=>{if(C5.includes(t.peek(-1))){let{next:e}=t;(uh(e)||e==T5||e==zse||e==Lse||e==Bse||e==Nse||e==Mse&&uh(t.peek(1))||e==Sm||e==Ise)&&t.acceptToken(Ese)}}),Yse=new yi(t=>{if(!C5.includes(t.peek(-1))){let{next:e}=t;if(e==jse&&(t.advance(),t.acceptToken(r$)),uh(e)){do t.advance();while(uh(t.next)||Qk(t.next));t.acceptToken(r$)}}}),Gse=Yu({"AtKeyword import charset namespace keyframes media supports":j.definitionKeyword,"from to selector":j.keyword,NamespaceName:j.namespace,KeyframeName:j.labelName,KeyframeRangeName:j.operatorKeyword,TagName:j.tagName,ClassName:j.className,PseudoClassName:j.constant(j.className),IdName:j.labelName,"FeatureName PropertyName":j.propertyName,AttributeName:j.attributeName,NumberLiteral:j.number,KeywordQuery:j.keyword,UnaryQueryOp:j.operatorKeyword,"CallTag ValueName":j.atom,VariableName:j.variableName,Callee:j.operatorKeyword,Unit:j.unit,"UniversalSelector NestingSelector":j.definitionOperator,"MatchOp CompareOp":j.compareOperator,"ChildOp SiblingOp, LogicOp":j.logicOperator,BinOp:j.arithmeticOperator,Important:j.modifier,Comment:j.blockComment,ColorLiteral:j.color,"ParenthesizedContent StringLiteral":j.string,":":j.punctuation,"PseudoOp #":j.derefOperator,"; ,":j.separator,"( )":j.paren,"[ ]":j.squareBracket,"{ }":j.brace}),Wse={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},Fse={__proto__:null,or:98,and:98,not:106,only:106,layer:170},Hse={__proto__:null,selector:112,layer:166},Kse={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},Jse={__proto__:null,to:207},eoe=Eu.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|Q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UXR#WtQ{UQ!wgQ#^yQ#o!_Q$U!nQ$[!uQ$_!yQ%e$^Q&Y%aQ&]%fR&v&XSjPzQ!}kQ$c!{R%k$dZiPkz!{$dR$P!gQ%}%SR&z&mR!rdR!teR$Z!tS%a$Y%bR&t&WV%_$Y%b&WQ#PmR$g#PQ`OSkPzU!a`k$dR$d!{Q$p#aY%p$p%u&d&l'QQ%u$sQ&d%qQ&l%zR'Q&xQ#t!cQ#v!dQ#x!eV$}#t#v#xQ%X$RR&T%XQ%y$zS&k%y&yR&y&lQ%r$pR&e%rQ%n$mR&c%nQyUR#]yQ%i$aR&_%iQ!|jS$e!|$fR$f!}Q&n%}R&{&nQ#k!ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles",maxTerm:143,nodeProps:[["isolate",-2,5,36,""],["openedBy",20,"(",28,"[",31,"{"],["closedBy",21,")",29,"]",32,"}"]],propSources:[Gse],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'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S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[qse,Yse,Use,Vse,1,2,3,4,new vO("m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~",28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},specialized:[{term:124,get:t=>Wse[t]||-1},{term:125,get:t=>Fse[t]||-1},{term:4,get:t=>Hse[t]||-1},{term:25,get:t=>Kse[t]||-1},{term:123,get:t=>Jse[t]||-1}],tokenPrec:1963});let kx=null;function Cx(){if(!kx&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));kx=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return kx||[]}const s$=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),o$=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),toe=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),noe=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),xo=/^(\w[\w-]*|-\w[\w-]*|)$/,roe=/^-(-[\w-]*)?$/;function ioe(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const a$=new hz,soe=["Declaration"];function ooe(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function E5(t,e,n){if(e.to-e.from>4096){let r=a$.get(e);if(r)return r;let i=[],s=new Set,a=e.cursor(Rt.IncludeAnonymous);if(a.firstChild())do for(let l of E5(t,a.node,n))s.has(l.label)||(s.add(l.label),i.push(l));while(a.nextSibling());return a$.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(s=>{var a;if(n(s)&&s.matchContext(soe)&&((a=s.node.nextSibling)===null||a===void 0?void 0:a.name)==":"){let l=t.sliceString(s.from,s.to);i.has(l)||(i.add(l),r.push({label:l,type:"variable"}))}}),r}}const aoe=t=>e=>{let{state:n,pos:r}=e,i=pn(n).resolveInner(r,-1),s=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(s||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:Cx(),validFor:xo};if(i.name=="ValueName")return{from:i.from,options:o$,validFor:xo};if(i.name=="PseudoClassName")return{from:i.from,options:s$,validFor:xo};if(t(i)||(e.explicit||s)&&ioe(i,n.doc))return{from:t(i)||s?i.from:r,options:E5(n.doc,ooe(i),t),validFor:roe};if(i.name=="TagName"){for(let{parent:u}=i;u;u=u.parent)if(u.name=="Block")return{from:i.from,options:Cx(),validFor:xo};return{from:i.from,options:toe,validFor:xo}}if(i.name=="AtKeyword")return{from:i.from,options:noe,validFor:xo};if(!e.explicit)return null;let a=i.resolve(r),l=a.childBefore(r);return l&&l.name==":"&&a.name=="PseudoClassSelector"?{from:r,options:s$,validFor:xo}:l&&l.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:r,options:o$,validFor:xo}:a.name=="Block"||a.name=="Styles"?{from:r,options:Cx(),validFor:xo}:null},loe=aoe(t=>t.name=="VariableName"),SO=ku.define({name:"css",parser:eoe.configure({props:[Uh.add({Declaration:vm()}),Vh.add({"Block KeyframeList":pj})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function coe(){return new oh(SO,SO.data.of({autocomplete:loe}))}const uoe=316,foe=317,l$=1,doe=2,hoe=3,poe=4,goe=318,moe=320,Ooe=321,yoe=5,boe=6,voe=0,hw=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],R5=125,xoe=59,pw=47,Soe=42,woe=43,koe=45,Coe=60,Toe=44,Qoe=63,Eoe=46,Roe=91,Aoe=new h5({start:!1,shift(t,e){return e==yoe||e==boe||e==moe?t:e==Ooe},strict:!1}),Poe=new yi((t,e)=>{let{next:n}=t;(n==R5||n==-1||e.context)&&t.acceptToken(goe)},{contextual:!0,fallback:!0}),_oe=new yi((t,e)=>{let{next:n}=t,r;hw.indexOf(n)>-1||n==pw&&((r=t.peek(1))==pw||r==Soe)||n!=R5&&n!=xoe&&n!=-1&&!e.context&&t.acceptToken(uoe)},{contextual:!0}),$oe=new yi((t,e)=>{t.next==Roe&&!e.context&&t.acceptToken(foe)},{contextual:!0}),Moe=new yi((t,e)=>{let{next:n}=t;if(n==woe||n==koe){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(l$);t.acceptToken(r?l$:doe)}}else n==Qoe&&t.peek(1)==Eoe&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(hoe))},{contextual:!0});function Tx(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const Doe=new yi((t,e)=>{if(t.next!=Coe||!e.dialectEnabled(voe)||(t.advance(),t.next==pw))return;let n=0;for(;hw.indexOf(t.next)>-1;)t.advance(),n++;if(Tx(t.next,!0)){for(t.advance(),n++;Tx(t.next,!1);)t.advance(),n++;for(;hw.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==Toe)return;for(let r=0;;r++){if(r==7){if(!Tx(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(poe,-n)}),Noe=Yu({"get set async static":j.modifier,"for while do if else switch try catch finally return throw break continue default case defer":j.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":j.operatorKeyword,"let var const using function class extends":j.definitionKeyword,"import export from":j.moduleKeyword,"with debugger new":j.keyword,TemplateString:j.special(j.string),super:j.atom,BooleanLiteral:j.bool,this:j.self,null:j.null,Star:j.modifier,VariableName:j.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":j.function(j.variableName),VariableDefinition:j.definition(j.variableName),Label:j.labelName,PropertyName:j.propertyName,PrivatePropertyName:j.special(j.propertyName),"CallExpression/MemberExpression/PropertyName":j.function(j.propertyName),"FunctionDeclaration/VariableDefinition":j.function(j.definition(j.variableName)),"ClassDeclaration/VariableDefinition":j.definition(j.className),"NewExpression/VariableName":j.className,PropertyDefinition:j.definition(j.propertyName),PrivatePropertyDefinition:j.definition(j.special(j.propertyName)),UpdateOp:j.updateOperator,"LineComment Hashbang":j.lineComment,BlockComment:j.blockComment,Number:j.number,String:j.string,Escape:j.escape,ArithOp:j.arithmeticOperator,LogicOp:j.logicOperator,BitOp:j.bitwiseOperator,CompareOp:j.compareOperator,RegExp:j.regexp,Equals:j.definitionOperator,Arrow:j.function(j.punctuation),": Spread":j.punctuation,"( )":j.paren,"[ ]":j.squareBracket,"{ }":j.brace,"InterpolationStart InterpolationEnd":j.special(j.brace),".":j.derefOperator,", ;":j.separator,"@":j.meta,TypeName:j.typeName,TypeDefinition:j.definition(j.typeName),"type enum interface implements namespace module declare":j.definitionKeyword,"abstract global Privacy readonly override":j.modifier,"is keyof unique infer asserts":j.operatorKeyword,JSXAttributeValue:j.attributeValue,JSXText:j.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":j.angleBracket,"JSXIdentifier JSXNameSpacedName":j.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":j.attributeName,"JSXBuiltin/JSXIdentifier":j.standard(j.tagName)}),Loe={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},zoe={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},joe={__proto__:null,"<":193},Ioe=Eu.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?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<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:Aoe,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[Noe],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#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`I|<%lOEr",tokenizers:[_oe,$oe,Moe,Doe,2,3,4,5,6,7,8,9,10,11,12,13,14,Poe,new vO("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new vO("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>Loe[t]||-1},{term:343,get:t=>zoe[t]||-1},{term:95,get:t=>joe[t]||-1}],tokenPrec:15201}),A5=[Ir("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Ir("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Ir("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Ir("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Ir("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Ir(`try {
303
+ \${}
304
+ } catch (\${error}) {
305
+ \${}
306
+ }`,{label:"try",detail:"/ catch block",type:"keyword"}),Ir("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Ir(`if (\${}) {
307
+ \${}
308
+ } else {
309
+ \${}
310
+ }`,{label:"if",detail:"/ else block",type:"keyword"}),Ir(`class \${name} {
311
+ constructor(\${params}) {
312
+ \${}
313
+ }
314
+ }`,{label:"class",detail:"definition",type:"keyword"}),Ir('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Ir('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Zoe=A5.concat([Ir("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Ir("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Ir("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),c$=new hz,P5=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function hd(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const Xoe=["FunctionDeclaration"],Boe={FunctionDeclaration:hd("function"),ClassDeclaration:hd("class"),ClassExpression:()=>!0,EnumDeclaration:hd("constant"),TypeAliasDeclaration:hd("type"),NamespaceDeclaration:hd("namespace"),VariableDefinition(t,e){t.matchContext(Xoe)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function _5(t,e){let n=c$.get(e);if(n)return n;let r=[],i=!0;function s(a,l){let u=t.sliceString(a.from,a.to);r.push({label:u,type:l})}return e.cursor(Rt.IncludeAnonymous).iterate(a=>{if(i)i=!1;else if(a.name){let l=Boe[a.name];if(l&&l(a,s)||P5.has(a.name))return!1}else if(a.to-a.from>8192){for(let l of _5(t,a.node))r.push(l);return!1}}),c$.set(e,r),r}const u$=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,$5=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Uoe(t){let e=pn(t.state).resolveInner(t.pos,-1);if($5.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&u$.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)P5.has(i.name)&&(r=r.concat(_5(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:u$}}const Bs=ku.define({name:"javascript",parser:Ioe.configure({props:[Uh.add({IfStatement:vm({except:/^\s*({|else\b)/}),TryStatement:vm({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Ane,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:Rne({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":vm({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),Vh.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":pj,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),M5={test:t=>/^JSX/.test(t.name),facet:fk({commentTokens:{block:{open:"{/*",close:"*/}"}}})},D5=Bs.configure({dialect:"ts"},"typescript"),N5=Bs.configure({dialect:"jsx",props:[dk.add(t=>t.isTop?[M5]:void 0)]}),L5=Bs.configure({dialect:"jsx ts",props:[dk.add(t=>t.isTop?[M5]:void 0)]},"typescript");let z5=t=>({label:t,type:"keyword"});const j5="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(z5),Voe=j5.concat(["declare","implements","private","protected","public"].map(z5));function qoe(t={}){let e=t.jsx?t.typescript?L5:N5:t.typescript?D5:Bs,n=t.typescript?Zoe.concat(Voe):A5.concat(j5);return new oh(e,[Bs.data.of({autocomplete:Wre($5,Gre(n))}),Bs.data.of({autocomplete:Uoe}),t.jsx?Woe:[]])}function Yoe(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function f$(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const Goe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Woe=Me.inputHandler.of((t,e,n,r,i)=>{if((Goe?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!Bs.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:a}=s,l=a.changeByRange(u=>{var d;let{head:h}=u,g=pn(a).resolveInner(h-1,-1),m;if(g.name=="JSXStartTag"&&(g=g.parent),!(a.doc.sliceString(h-1,h)!=r||g.name=="JSXAttributeValue"&&g.to>h)){if(r==">"&&g.name=="JSXFragmentTag")return{range:u,changes:{from:h,insert:"</>"}};if(r=="/"&&g.name=="JSXStartCloseTag"){let O=g.parent,v=O.parent;if(v&&O.from==h-2&&((m=f$(a.doc,v.firstChild,h))||((d=v.firstChild)===null||d===void 0?void 0:d.name)=="JSXFragmentTag")){let x=`${m}>`;return{range:le.cursor(h+x.length,-1),changes:{from:h,insert:x}}}}else if(r==">"){let O=Yoe(g);if(O&&O.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(h,h+2))&&(m=f$(a.doc,O,h)))return{range:u,changes:{from:h,insert:`</${m}>`}}}}return{range:u}});return l.changes.empty?!1:(t.dispatch([s,a.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),pd=["_blank","_self","_top","_parent"],Qx=["ascii","utf-8","utf-16","latin1","latin1"],Ex=["get","post","put","delete"],Rx=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],ii=["true","false"],Ee={},Foe={a:{attrs:{href:null,ping:null,type:null,media:null,target:pd,hreflang:null}},abbr:Ee,address:Ee,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Ee,aside:Ee,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Ee,base:{attrs:{href:null,target:pd}},bdi:Ee,bdo:Ee,blockquote:{attrs:{cite:null}},body:Ee,br:Ee,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Rx,formmethod:Ex,formnovalidate:["novalidate"],formtarget:pd,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Ee,center:Ee,cite:Ee,code:Ee,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Ee,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Ee,div:Ee,dl:Ee,dt:Ee,em:Ee,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Ee,figure:Ee,footer:Ee,form:{attrs:{action:null,name:null,"accept-charset":Qx,autocomplete:["on","off"],enctype:Rx,method:Ex,novalidate:["novalidate"],target:pd}},h1:Ee,h2:Ee,h3:Ee,h4:Ee,h5:Ee,h6:Ee,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Ee,hgroup:Ee,hr:Ee,html:{attrs:{manifest:null}},i:Ee,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Rx,formmethod:Ex,formnovalidate:["novalidate"],formtarget:pd,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Ee,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Ee,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Ee,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Qx,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Ee,noscript:Ee,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Ee,param:{attrs:{name:null,value:null}},pre:Ee,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Ee,rt:Ee,ruby:Ee,samp:Ee,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Qx}},section:Ee,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Ee,source:{attrs:{src:null,type:null,media:null}},span:Ee,strong:Ee,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Ee,summary:Ee,sup:Ee,table:Ee,tbody:Ee,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Ee,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Ee,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Ee,time:{attrs:{datetime:null}},title:Ee,tr:Ee,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Ee,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Ee},I5={accesskey:null,class:null,contenteditable:ii,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:ii,autocorrect:ii,autocapitalize:ii,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":ii,"aria-autocomplete":["inline","list","both","none"],"aria-busy":ii,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":ii,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":ii,"aria-hidden":ii,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":ii,"aria-multiselectable":ii,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":ii,"aria-relevant":null,"aria-required":ii,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Z5="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of Z5)I5[t]=null;let fh=class{constructor(e,n){this.tags={...Foe,...e},this.globalAttrs={...I5,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};fh.default=new fh;function Ru(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function Au(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function X5(t,e,n){let r=n.tags[Ru(t,Au(e))];return(r==null?void 0:r.children)||n.allTags}function Ek(t,e){let n=[];for(let r=Au(e);r&&!r.type.isTop;r=Au(r.parent)){let i=Ru(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const B5=/^[:\-\.\w\u00b7-\uffff]*$/;function d$(t,e,n,r,i){let s=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",a=Au(n,n.name=="StartTag"||n.name=="TagName");return{from:r,to:i,options:X5(t.doc,a,e).map(l=>({label:l,type:"type"})).concat(Ek(t.doc,n).map((l,u)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function h$(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:Ek(t.doc,e).map((s,a)=>({label:s,apply:s+i,type:"type",boost:99-a})),validFor:B5}}function Hoe(t,e,n,r){let i=[],s=0;for(let a of X5(t.doc,n,e))i.push({label:"<"+a,type:"type"});for(let a of Ek(t.doc,n))i.push({label:"</"+a+">",type:"type",boost:99-s++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Koe(t,e,n,r,i){let s=Au(n),a=s?e.tags[Ru(t.doc,s)]:null,l=a&&a.attrs?Object.keys(a.attrs):[],u=a&&a.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:u.map(d=>({label:d,type:"property"})),validFor:B5}}function Joe(t,e,n,r,i){var s;let a=(s=n.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],u;if(a){let d=t.sliceDoc(a.from,a.to),h=e.globalAttrs[d];if(!h){let g=Au(n),m=g?e.tags[Ru(t.doc,g)]:null;h=(m==null?void 0:m.attrs)&&m.attrs[d]}if(h){let g=t.sliceDoc(r,i).toLowerCase(),m='"',O='"';/^['"]/.test(g)?(u=g[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",O=t.sliceDoc(i,i+1)==g[0]?"":g[0],g=g.slice(1),r++):u=/^[^\s<>='"]*$/;for(let v of h)l.push({label:v,apply:m+v+O,type:"constant"})}}return{from:r,to:i,options:l,validFor:u}}function U5(t,e){let{state:n,pos:r}=e,i=pn(n).resolveInner(r,-1),s=i.resolve(r);for(let a=r,l;s==i&&(l=i.childBefore(a));){let u=l.lastChild;if(!u||!u.type.isError||u.from<u.to)break;s=i=l,a=u.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?h$(n,i,i.from,r):d$(n,t,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?d$(n,t,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?h$(n,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?Koe(n,t,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?Joe(n,t,i,i.name=="Is"?r:i.from,r):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?Hoe(n,t,i,r):null}function eae(t){return U5(fh.default,t)}function tae(t){let{extraTags:e,extraGlobalAttributes:n}=t,r=n||e?new fh(e,n):fh.default;return i=>U5(r,i)}const nae=Bs.parser.configure({top:"SingleExpression"}),V5=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:D5.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:N5.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:L5.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:nae},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:Bs.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:SO.parser}],q5=[{name:"style",parser:SO.parser.configure({top:"Styles"})}].concat(Z5.map(t=>({name:t,parser:Bs.parser}))),Y5=ku.define({name:"html",parser:Qse.configure({props:[Uh.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e=null,n;for(let r=t.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((n=e.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),Vh.add({Element(t){let e=t.firstChild,n=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:n.name=="CloseTag"?n.from:t.to}}}),gj.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),wm=Y5.configure({wrap:w5(V5,q5)});function rae(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=w5((t.nestedLanguages||[]).concat(V5),(t.nestedAttributes||[]).concat(q5)));let r=n?Y5.configure({wrap:n,dialect:e}):e?wm.configure({dialect:e}):wm;return new oh(r,[wm.data.of({autocomplete:tae(t)}),t.autoCloseTags!==!1?iae:[],qoe().support,coe().support])}const p$=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),iae=Me.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!wm.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:a}=s,l=a.changeByRange(u=>{var d,h,g;let m=a.doc.sliceString(u.from-1,u.to)==r,{head:O}=u,v=pn(a).resolveInner(O,-1),x;if(m&&r==">"&&v.name=="EndTag"){let k=v.parent;if(((h=(d=k.parent)===null||d===void 0?void 0:d.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(x=Ru(a.doc,k.parent,O))&&!p$.has(x)){let C=O+(a.doc.sliceString(O,O+1)===">"?1:0),Q=`</${x}>`;return{range:u,changes:{from:O,to:C,insert:Q}}}}else if(m&&r=="/"&&v.name=="IncompleteCloseTag"){let k=v.parent;if(v.from==O-2&&((g=k.lastChild)===null||g===void 0?void 0:g.name)!="CloseTag"&&(x=Ru(a.doc,k,O))&&!p$.has(x)){let C=O+(a.doc.sliceString(O,O+1)===">"?1:0),Q=`${x}>`;return{range:le.cursor(O+Q.length,-1),changes:{from:O,to:C,insert:Q}}}}return{range:u}});return l.changes.empty?!1:(t.dispatch([s,a.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),G5=fk({commentTokens:{block:{open:"<!--",close:"-->"}}}),W5=new Le,F5=xie.configure({props:[Vh.add(t=>!t.is("Block")||t.is("Document")||gw(t)!=null||sae(t)?void 0:(e,n)=>({from:n.doc.lineAt(e.from).to,to:e.to})),W5.add(gw),Uh.add({Document:()=>null}),Cl.add({Document:G5})]});function gw(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function sae(t){return t.name=="OrderedList"||t.name=="BulletList"}function oae(t,e){let n=t;for(;;){let r=n.nextSibling,i;if(!r||(i=gw(r.type))!=null&&i<=e)break;n=r}return n.to}const aae=Pne.of((t,e,n)=>{for(let r=pn(t).resolveInner(n,-1);r&&!(r.from<e);r=r.parent){let i=r.type.prop(W5);if(i==null)continue;let s=oae(r,i);if(s>n)return{from:n,to:s}}return null});function Rk(t){return new Zi(G5,t,[],"markdown")}const lae=Rk(F5),cae=F5.configure([_ie,Mie,$ie,Die,{props:[Vh.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),wO=Rk(cae);function uae(t,e){return n=>{if(n&&t){let r=null;if(n=/\S*/.exec(n)[0],typeof t=="function"?r=t(n):r=hO.matchLanguageName(t,n,!0),r instanceof hO)return r.support?r.support.language.parser:sh.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}class Ax{constructor(e,n,r,i,s,a,l){this.node=e,this.from=n,this.to=r,this.spaceBefore=i,this.spaceAfter=s,this.type=a,this.item=l}blank(e,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length<e;)r+=" ";return r}else{for(let i=this.to-this.from-r.length-this.spaceAfter.length;i>0;i--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(e,n){let r=this.node.name=="OrderedList"?String(+K5(this.item,e)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function H5(t,e){let n=[],r=[];for(let i=t;i;i=i.parent){if(i.name=="FencedCode")return r;(i.name=="ListItem"||i.name=="Blockquote")&&n.push(i)}for(let i=n.length-1;i>=0;i--){let s=n[i],a,l=e.lineAt(s.from),u=s.from-l.from;if(s.name=="Blockquote"&&(a=/^ *>( ?)/.exec(l.text.slice(u))))r.push(new Ax(s,u,u+a[0].length,"",a[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(a=/^( *)\d+([.)])( *)/.exec(l.text.slice(u)))){let d=a[3],h=a[0].length;d.length>=4&&(d=d.slice(0,d.length-4),h-=4),r.push(new Ax(s.parent,u,u+h,a[1],d,a[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(u)))){let d=a[4],h=a[0].length;d.length>4&&(d=d.slice(0,d.length-4),h-=4);let g=a[2];a[3]&&(g+=a[3].replace(/[xX]/," ")),r.push(new Ax(s.parent,u,u+h,a[1],d,g,s))}}return r}function K5(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function Px(t,e,n,r=0){for(let i=-1,s=t;;){if(s.name=="ListItem"){let l=K5(s,e),u=+l[2];if(i>=0){if(u!=i+1)return;n.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(i+2+r)})}i=u}let a=s.nextSibling;if(!a)break;s=a}}function Ak(t,e){let n=/^[ \t]*/.exec(t)[0].length;if(!n||e.facet(Bh)!=" ")return t;let r=Lo(t,4,n),i="";for(let s=r;s>0;)s>=4?(i+=" ",s-=4):(i+=" ",s--);return i+t.slice(n)}const fae=(t={})=>({state:e,dispatch:n})=>{let r=pn(e),{doc:i}=e,s=null,a=e.changeByRange(l=>{if(!l.empty||!wO.isActiveAt(e,l.from,-1)&&!wO.isActiveAt(e,l.from,1))return s={range:l};let u=l.from,d=i.lineAt(u),h=H5(r.resolveInner(u,-1),i);for(;h.length&&h[h.length-1].from>u-d.from;)h.pop();if(!h.length)return s={range:l};let g=h[h.length-1];if(g.to-g.spaceAfter.length>u-d.from)return s={range:l};let m=u>=g.to-g.spaceAfter.length&&!/\S/.test(d.text.slice(g.to));if(g.item&&m){let C=g.node.firstChild,Q=g.node.getChild("ListItem","ListItem");if(C.to>=u||Q&&Q.to<u||d.from>0&&!/[^\s>]/.test(i.lineAt(d.from-1).text)||t.nonTightLists===!1){let R=h.length>1?h[h.length-2]:null,E,P="";R&&R.item?(E=d.from+R.from,P=R.marker(i,1)):E=d.from+(R?R.to:0);let $=[{from:E,to:u,insert:P}];return g.node.name=="OrderedList"&&Px(g.item,i,$,-2),R&&R.node.name=="OrderedList"&&Px(R.item,i,$),{range:le.cursor(E+P.length),changes:$}}else{let R=m$(h,e,d);return{range:le.cursor(u+R.length+1),changes:{from:d.from,insert:R+e.lineBreak}}}}if(g.node.name=="Blockquote"&&m&&d.from){let C=i.lineAt(d.from-1),Q=/>\s*$/.exec(C.text);if(Q&&Q.index==g.from){let R=e.changes([{from:C.from+Q.index,to:C.to},{from:d.from+g.from,to:d.to}]);return{range:l.map(R),changes:R}}}let O=[];g.node.name=="OrderedList"&&Px(g.item,i,O);let v=g.item&&g.item.from<d.from,x="";if(!v||/^[\s\d.)\-+*>]*/.exec(d.text)[0].length>=g.to)for(let C=0,Q=h.length-1;C<=Q;C++)x+=C==Q&&!v?h[C].marker(i,1):h[C].blank(C<Q?Lo(d.text,4,h[C+1].from)-x.length:null);let k=u;for(;k>d.from&&/\s/.test(d.text.charAt(k-d.from-1));)k--;return x=Ak(x,e),hae(g.node,e.doc)&&(x=m$(h,e,d)+e.lineBreak+x),O.push({from:k,to:u,insert:e.lineBreak+x}),{range:le.cursor(k+x.length+1),changes:O}});return s?!1:(n(e.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},dae=fae();function g$(t){return t.name=="QuoteMark"||t.name=="ListMark"}function hae(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let n=t.firstChild,r=t.getChild("ListItem","ListItem");if(!r)return!1;let i=e.lineAt(n.to),s=e.lineAt(r.from),a=/^[\s>]*$/.test(i.text);return i.number+(a?0:1)<s.number}function m$(t,e,n){let r="";for(let i=0,s=t.length-2;i<=s;i++)r+=t[i].blank(i<s?Lo(n.text,4,t[i+1].from)-r.length:null,i<s);return Ak(r,e)}function pae(t,e){let n=t.resolveInner(e,-1),r=e;g$(n)&&(r=n.from,n=n.parent);for(let i;i=n.childBefore(r);)if(g$(i))r=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")n=i.lastChild,r=n.to;else break;return n}const gae=({state:t,dispatch:e})=>{let n=pn(t),r=null,i=t.changeByRange(s=>{let a=s.from,{doc:l}=t;if(s.empty&&wO.isActiveAt(t,s.from)){let u=l.lineAt(a),d=H5(pae(n,a),l);if(d.length){let h=d[d.length-1],g=h.to-h.spaceAfter.length+(h.spaceAfter?1:0);if(a-u.from>g&&!/\S/.test(u.text.slice(g,a-u.from)))return{range:le.cursor(u.from+g),changes:{from:u.from+g,to:a}};if(a-u.from==g&&(!h.item||u.from<=h.item.from||!/\S/.test(u.text.slice(0,h.to)))){let m=u.from+h.from;if(h.item&&h.node.from<h.item.from&&/\S/.test(u.text.slice(h.from,h.to))){let O=h.blank(Lo(u.text,4,h.to)-Lo(u.text,4,h.from));return m==u.from&&(O=Ak(O,t)),{range:le.cursor(m+O.length),changes:{from:m,to:u.from+h.to,insert:O}}}if(m<a)return{range:le.cursor(m),changes:{from:m,to:a}}}}}return r={range:s}});return r?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},mae=[{key:"Enter",run:dae},{key:"Backspace",run:gae}],J5=rae({matchClosingTags:!1});function Oae(t={}){let{codeLanguages:e,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=lae,completeHTMLTags:s=!0,pasteURLAsLink:a=!0,htmlTagLanguage:l=J5}=t;if(!(i instanceof My))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let u=t.extensions?[t.extensions]:[],d=[l.support,aae],h;a&&d.push(xae),n instanceof oh?(d.push(n.support),h=n.language):n&&(h=n);let g=e||h?uae(e,h):void 0;u.push(wie({codeParser:g,htmlParser:l.language.parser})),r&&d.push(Lh.high(Ey.of(mae)));let m=Rk(i.configure(u));return s&&d.push(m.data.of({autocomplete:yae})),new oh(m,d)}function yae(t){let{state:e,pos:n}=t,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(n-25,n));if(!r)return null;let i=pn(e).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:n-r[0].length,to:n,options:bae(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let _x=null;function bae(){if(_x)return _x;let t=eae(new qre(wt.create({extensions:J5}),0,!0));return _x=t?t.options:[]}const vae=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,xae=Me.domEventHandlers({paste:(t,e)=>{var n;let{main:r}=e.state.selection;if(r.empty)return!1;let i=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!wO.isActiveAt(e.state,r.from,1)))return!1;let s=pn(e.state),a=!1;return s.iterate({from:r.from,to:r.to,enter:l=>{(l.from>r.from||vae.test(l.name))&&(a=!0)},leave:l=>{l.to<r.to&&(a=!0)}}),a?!1:(e.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),qr=()=>new Map,mw=t=>{const e=qr();return t.forEach((n,r)=>{e.set(r,n)}),e},Hs=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},Sae=(t,e)=>{const n=[];for(const[r,i]of t)n.push(e(i,r));return n},wae=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1},Xa=()=>new Set,$x=t=>t[t.length-1],kae=(t,e)=>{for(let n=0;n<e.length;n++)t.push(e[n])},Io=Array.from,Pk=(t,e)=>{for(let n=0;n<t.length;n++)if(!e(t[n],n,t))return!1;return!0},_k=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},Cae=(t,e)=>{const n=new Array(t);for(let r=0;r<t;r++)n[r]=e(r,n);return n},Pu=Array.isArray;class $k{constructor(){this._observers=qr()}on(e,n){return Hs(this._observers,e,Xa).add(n),n}once(e,n){const r=(...i)=>{this.off(e,r),n(...i)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return Io((this._observers.get(e)||qr()).values()).forEach(r=>r(...n))}destroy(){this._observers=qr()}}class Tae{constructor(){this._observers=qr()}on(e,n){Hs(this._observers,e,Xa).add(n)}once(e,n){const r=(...i)=>{this.off(e,r),n(...i)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return Io((this._observers.get(e)||qr()).values()).forEach(r=>r(...n))}destroy(){this._observers=qr()}}const hs=Math.floor,km=Math.abs,Dy=(t,e)=>t<e?t:e,Ga=(t,e)=>t>e?t:e,Qae=Math.pow,e3=t=>t!==0?t<0:1/t<0,O$=1,y$=2,Mx=4,Dx=8,dh=32,_o=64,gi=128,Ny=31,Ow=63,Rl=127,Eae=2147483647,kO=Number.MAX_SAFE_INTEGER,b$=Number.MIN_SAFE_INTEGER,Rae=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&hs(t)===t),t3=String.fromCharCode,Aae=t=>t.toLowerCase(),Pae=/^\s*/g,_ae=t=>t.replace(Pae,""),$ae=/([A-Z])/g,v$=(t,e)=>_ae(t.replace($ae,n=>`${e}${Aae(n)}`)),Mae=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=e.codePointAt(i);return r},hh=typeof TextEncoder<"u"?new TextEncoder:null,Dae=t=>hh.encode(t),Nae=hh?Dae:Mae;let jd=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});jd&&jd.decode(new Uint8Array).length===1&&(jd=null);const Lae=(t,e)=>Cae(e,()=>t).join("");class Gh{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const cr=()=>new Gh,Mk=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},ln=t=>{const e=new Uint8Array(Mk(t));let n=0;for(let r=0;r<t.bufs.length;r++){const i=t.bufs[r];e.set(i,n),n+=i.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},zae=(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(Ga(n,e)*2),t.cpos=0)},Un=(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},yw=Un,_e=(t,e)=>{for(;e>Rl;)Un(t,gi|Rl&e),e=hs(e/128);Un(t,Rl&e)},Dk=(t,e)=>{const n=e3(e);for(n&&(e=-e),Un(t,(e>Ow?gi:0)|(n?_o:0)|Ow&e),e=hs(e/64);e>0;)Un(t,(e>Rl?gi:0)|Rl&e),e=hs(e/128)},bw=new Uint8Array(3e4),jae=bw.length/3,Iae=(t,e)=>{if(e.length<jae){const n=hh.encodeInto(e,bw).written||0;_e(t,n);for(let r=0;r<n;r++)Un(t,bw[r])}else bn(t,Nae(e))},Zae=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;_e(t,r);for(let i=0;i<r;i++)Un(t,n.codePointAt(i))},Al=hh&&hh.encodeInto?Iae:Zae,Ly=(t,e)=>{const n=t.cbuf.length,r=t.cpos,i=Dy(n-r,e.length),s=e.length-i;t.cbuf.set(e.subarray(0,i),r),t.cpos+=i,s>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(Ga(n*2,s)),t.cbuf.set(e.subarray(i)),t.cpos=s)},bn=(t,e)=>{_e(t,e.byteLength),Ly(t,e)},Nk=(t,e)=>{zae(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},Xae=(t,e)=>Nk(t,4).setFloat32(0,e,!1),Bae=(t,e)=>Nk(t,8).setFloat64(0,e,!1),Uae=(t,e)=>Nk(t,8).setBigInt64(0,e,!1),x$=new DataView(new ArrayBuffer(4)),Vae=t=>(x$.setFloat32(0,t),x$.getFloat32(0)===t),ph=(t,e)=>{switch(typeof e){case"string":Un(t,119),Al(t,e);break;case"number":Rae(e)&&km(e)<=Eae?(Un(t,125),Dk(t,e)):Vae(e)?(Un(t,124),Xae(t,e)):(Un(t,123),Bae(t,e));break;case"bigint":Un(t,122),Uae(t,e);break;case"object":if(e===null)Un(t,126);else if(Pu(e)){Un(t,117),_e(t,e.length);for(let n=0;n<e.length;n++)ph(t,e[n])}else if(e instanceof Uint8Array)Un(t,116),bn(t,e);else{Un(t,118);const n=Object.keys(e);_e(t,n.length);for(let r=0;r<n.length;r++){const i=n[r];Al(t,i),ph(t,e[i])}}break;case"boolean":Un(t,e?120:121);break;default:Un(t,127)}};class S$ extends Gh{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&_e(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const w$=t=>{t.count>0&&(Dk(t.encoder,t.count===1?t.s:-t.s),t.count>1&&_e(t.encoder,t.count-2))};class Cm{constructor(){this.encoder=new Gh,this.s=0,this.count=0}write(e){this.s===e?this.count++:(w$(this),this.count=1,this.s=e)}toUint8Array(){return w$(this),ln(this.encoder)}}const k$=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);Dk(t.encoder,e),t.count>1&&_e(t.encoder,t.count-2)}};class Nx{constructor(){this.encoder=new Gh,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(k$(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return k$(this),ln(this.encoder)}}class qae{constructor(){this.sarr=[],this.s="",this.lensE=new Cm}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 Gh;return this.sarr.push(this.s),this.s="",Al(e,this.sarr.join("")),Ly(e,this.lensE.toUint8Array()),ln(e)}}const Ys=t=>new Error(t),as=()=>{throw Ys("Method unimplemented")},mi=()=>{throw Ys("Unexpected case")},n3=Ys("Unexpected end of array"),r3=Ys("Integer out of Range");class zy{constructor(e){this.arr=e,this.pos=0}}const Wa=t=>new zy(t),Yae=t=>t.pos!==t.arr.length,Gae=(t,e)=>{const n=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,n},lr=t=>Gae(t,Ie(t)),_u=t=>t.arr[t.pos++],Ie=t=>{let e=0,n=1;const r=t.arr.length;for(;t.pos<r;){const i=t.arr[t.pos++];if(e=e+(i&Rl)*n,n*=128,i<gi)return e;if(e>kO)throw r3}throw n3},Lk=t=>{let e=t.arr[t.pos++],n=e&Ow,r=64;const i=(e&_o)>0?-1:1;if((e&gi)===0)return i*n;const s=t.arr.length;for(;t.pos<s;){if(e=t.arr[t.pos++],n=n+(e&Rl)*r,r*=128,e<gi)return i*n;if(n>kO)throw r3}throw n3},Wae=t=>{let e=Ie(t);if(e===0)return"";{let n=String.fromCodePoint(_u(t));if(--e<100)for(;e--;)n+=String.fromCodePoint(_u(t));else for(;e>0;){const r=e<1e4?e:1e4,i=t.arr.subarray(t.pos,t.pos+r);t.pos+=r,n+=String.fromCodePoint.apply(null,i),e-=r}return decodeURIComponent(escape(n))}},Fae=t=>jd.decode(lr(t)),$a=jd?Fae:Wae,zk=(t,e)=>{const n=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);return t.pos+=e,n},Hae=t=>zk(t,4).getFloat32(0,!1),Kae=t=>zk(t,8).getFloat64(0,!1),Jae=t=>zk(t,8).getBigInt64(0,!1),ele=[t=>{},t=>null,Lk,Hae,Kae,Jae,t=>!1,t=>!0,$a,t=>{const e=Ie(t),n={};for(let r=0;r<e;r++){const i=$a(t);n[i]=gh(t)}return n},t=>{const e=Ie(t),n=[];for(let r=0;r<e;r++)n.push(gh(t));return n},lr],gh=t=>ele[127-_u(t)](t);class C$ extends zy{constructor(e,n){super(e),this.reader=n,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),Yae(this)?this.count=Ie(this)+1:this.count=-1),this.count--,this.s}}class Tm extends zy{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=Lk(this);const e=e3(this.s);this.count=1,e&&(this.s=-this.s,this.count=Ie(this)+2)}return this.count--,this.s}}class Lx extends zy{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const e=Lk(this),n=e&1;this.diff=hs(e/2),this.count=1,n&&(this.count=Ie(this)+2)}return this.s+=this.diff,this.count--,this.s}}class tle{constructor(e){this.decoder=new Tm(e),this.str=$a(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 nle=crypto.getRandomValues.bind(crypto),i3=()=>nle(new Uint32Array(1))[0],rle="10000000-1000-4000-8000"+-1e11,ile=()=>rle.replace(/[018]/g,t=>(t^i3()&15>>t/4).toString(16)),Ba=Date.now,T$=t=>new Promise(t);Promise.all.bind(Promise);const Q$=t=>t===void 0?null:t;class sle{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let s3=new sle,jk=!0;try{typeof localStorage<"u"&&localStorage&&(s3=localStorage,jk=!1)}catch{}const o3=s3,ole=t=>jk||addEventListener("storage",t),ale=t=>jk||removeEventListener("storage",t),mh=Symbol("Equality"),a3=(t,e)=>{var n;return t===e||!!((n=t==null?void 0:t[mh])!=null&&n.call(t,e))||!1},lle=t=>typeof t=="object",cle=Object.assign,ule=Object.keys,fle=(t,e)=>{for(const n in t)e(t[n],n)},dle=(t,e)=>{const n=[];for(const r in t)n.push(e(t[r],r));return n},CO=t=>ule(t).length,hle=t=>{for(const e in t)return!1;return!0},Wh=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},Ik=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),ple=(t,e)=>t===e||CO(t)===CO(e)&&Wh(t,(n,r)=>(n!==void 0||Ik(e,r))&&a3(e[r],n)),gle=Object.freeze,l3=t=>{for(const e in t){const n=t[e];(typeof n=="object"||typeof n=="function")&&l3(t[e])}return gle(t)},Zk=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&Zk(t,e,n+1)}},mle=t=>t,lu=(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[mh]!=null)return t[mh](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)||!lu(t.get(n),e.get(n)))return!1;break}case void 0:case Object:if(CO(t)!==CO(e))return!1;for(const n in t)if(!Ik(t,n)||!lu(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(!lu(t[n],e[n]))return!1;break;default:return!1}return!0},Ole=(t,e)=>e.includes(t);var c3={};const Ua=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",u3=typeof window<"u"&&typeof document<"u"&&!Ua;let Qs;const yle=()=>{if(Qs===void 0)if(Ua){Qs=qr();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&Qs.set(e,""),e=r):e!==null&&(Qs.set(e,r),e=null)}e!==null&&Qs.set(e,"")}else typeof location=="object"?(Qs=qr(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");Qs.set(`--${v$(e,"-")}`,n),Qs.set(`-${v$(e,"-")}`,n)}})):Qs=qr();return Qs},vw=t=>yle().has(t),TO=t=>Q$(Ua?c3[t.toUpperCase().replaceAll("-","_")]:o3.getItem(t)),f3=t=>vw("--"+t)||TO(t)!==null,ble=f3("production"),vle=Ua&&Ole(c3.FORCE_COLOR,["true","1","2"]),xle=vle||!vw("--no-colors")&&!f3("no-color")&&(!Ua||process.stdout.isTTY)&&(!Ua||vw("--color")||TO("COLORTERM")!==null||(TO("TERM")||"").includes("color")),d3=t=>new Uint8Array(t),Sle=(t,e,n)=>new Uint8Array(t,e,n),wle=t=>new Uint8Array(t),kle=t=>{let e="";for(let n=0;n<t.byteLength;n++)e+=t3(t[n]);return btoa(e)},Cle=t=>Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("base64"),Tle=t=>{const e=atob(t),n=d3(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},Qle=t=>{const e=Buffer.from(t,"base64");return Sle(e.buffer,e.byteOffset,e.byteLength)},Ele=u3?kle:Cle,Rle=u3?Tle:Qle,Ale=t=>{const e=d3(t.byteLength);return e.set(t),e};class Ple{constructor(e,n){this.left=e,this.right=n}}const oi=(t,e)=>new Ple(t,e),_le=(t,e)=>t.forEach(n=>e(n.left,n.right)),E$=t=>t.next()>=.5,zx=(t,e,n)=>hs(t.next()*(n+1-e)+e),h3=(t,e,n)=>hs(t.next()*(n+1-e)+e),Xk=(t,e,n)=>h3(t,e,n),$le=t=>t3(Xk(t,97,122)),Mle=(t,e=0,n=20)=>{const r=Xk(t,e,n);let i="";for(let s=0;s<r;s++)i+=$le(t);return i},jx=(t,e)=>e[Xk(t,0,e.length-1)],Dle=Symbol("0schema");class Nle{constructor(){this._rerrs=[]}extend(e,n,r,i=null){this._rerrs.push({path:e,expected:n,has:r,message:i})}toString(){const e=[];for(let n=this._rerrs.length-1;n>0;n--){const r=this._rerrs[n];e.push(Lae(" ",(this._rerrs.length-n)*2)+`${r.path!=null?`[${r.path}] `:""}${r.has} doesn't match ${r.expected}. ${r.message}`)}return e.join(`
315
+ `)}}const xw=(t,e)=>t===e?!0:t==null||e==null||t.constructor!==e.constructor?!1:t[mh]?a3(t,e):Pu(t)?Pk(t,n=>_k(e,r=>xw(n,r))):lle(t)?Wh(t,(n,r)=>xw(n,e[r])):!1;class pr{extends(e){let[n,r]=[this.shape,e.shape];return this.constructor._dilutes&&([r,n]=[n,r]),xw(n,r)}equals(e){return this.constructor===e.constructor&&lu(this.shape,e.shape)}[Dle](){return!0}[mh](e){return this.equals(e)}validate(e){return this.check(e)}check(e,n){as()}get nullable(){return Fu(this,By)}get optional(){return new m3(this)}cast(e){return R$(e,this),e}expect(e){return R$(e,this),e}}We(pr,"_dilutes",!1);class Bk extends pr{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n=void 0){const r=(e==null?void 0:e.constructor)===this.shape&&(this._c==null||this._c(e));return!r&&(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")),r}}const An=(t,e=null)=>new Bk(t,e);An(Bk);class Uk extends pr{constructor(e){super(),this.shape=e}check(e,n){const r=this.shape(e);return!r&&(n==null||n.extend(null,"custom prop",e==null?void 0:e.constructor.name,"failed to check custom prop")),r}}const Wn=t=>new Uk(t);An(Uk);class jy extends pr{constructor(e){super(),this.shape=e}check(e,n){const r=this.shape.some(i=>i===e);return!r&&(n==null||n.extend(null,this.shape.join(" | "),e.toString())),r}}const Iy=(...t)=>new jy(t),p3=An(jy),Lle=RegExp.escape||(t=>t.replace(/[().|&,$^[\]]/g,e=>"\\"+e)),g3=t=>{if($u.check(t))return[Lle(t)];if(p3.check(t))return t.shape.map(e=>e+"");if(C3.check(t))return["[+-]?\\d+.?\\d*"];if(T3.check(t))return[".*"];if(EO.check(t))return t.shape.map(g3).flat(1);mi()};class zle extends pr{constructor(e){super(),this.shape=e,this._r=new RegExp("^"+e.map(g3).map(n=>`(${n.join("|")})`).join("")+"$")}check(e,n){const r=this._r.exec(e)!=null;return!r&&(n==null||n.extend(null,this._r.toString(),e.toString(),"String doesn't match string template.")),r}}An(zle);const jle=Symbol("optional");class m3 extends pr{constructor(e){super(),this.shape=e}check(e,n){const r=e===void 0||this.shape.check(e);return!r&&(n==null||n.extend(null,"undefined (optional)","()")),r}get[jle](){return!0}}const Ile=An(m3);class Zle extends pr{check(e,n){return n==null||n.extend(null,"never",typeof e),!1}}An(Zle);const zO=class zO extends pr{constructor(e,n=!1){super(),this.shape=e,this._isPartial=n}get partial(){return new zO(this.shape,!0)}check(e,n){return e==null?(n==null||n.extend(null,"object","null"),!1):Wh(this.shape,(r,i)=>{const s=this._isPartial&&!Ik(e,i)||r.check(e[i],n);return!s&&(n==null||n.extend(i.toString(),r.toString(),typeof e[i],"Object property does not match")),s})}};We(zO,"_dilutes",!0);let QO=zO;const Xle=t=>new QO(t),Ble=An(QO),Ule=Wn(t=>t!=null&&(t.constructor===Object||t.constructor==null));class O3 extends pr{constructor(e,n){super(),this.shape={keys:e,values:n}}check(e,n){return e!=null&&Wh(e,(r,i)=>{const s=this.shape.keys.check(i,n);return!s&&(n==null||n.extend(i+"","Record",typeof e,s?"Key doesn't match schema":"Value doesn't match value")),s&&this.shape.values.check(r,n)})}}const y3=(t,e)=>new O3(t,e),Vle=An(O3);class b3 extends pr{constructor(e){super(),this.shape=e}check(e,n){return e!=null&&Wh(this.shape,(r,i)=>{const s=r.check(e[i],n);return!s&&(n==null||n.extend(i.toString(),"Tuple",typeof r)),s})}}const qle=(...t)=>new b3(t);An(b3);class v3 extends pr{constructor(e){super(),this.shape=e.length===1?e[0]:new Zy(e)}check(e,n){const r=Pu(e)&&Pk(e,i=>this.shape.check(i));return!r&&(n==null||n.extend(null,"Array","")),r}}const x3=(...t)=>new v3(t),Yle=An(v3),Gle=Wn(t=>Pu(t));class S3 extends pr{constructor(e,n){super(),this.shape=e,this._c=n}check(e,n){const r=e instanceof this.shape&&(this._c==null||this._c(e));return!r&&(n==null||n.extend(null,this.shape.name,e==null?void 0:e.constructor.name)),r}}const Wle=(t,e=null)=>new S3(t,e);An(S3);const Fle=Wle(pr);class Hle extends pr{constructor(e){super(),this.len=e.length-1,this.args=qle(...e.slice(-1)),this.res=e[this.len]}check(e,n){const r=e.constructor===Function&&e.length<=this.len;return!r&&(n==null||n.extend(null,"function",typeof e)),r}}const Kle=An(Hle),Jle=Wn(t=>typeof t=="function");class ece extends pr{constructor(e){super(),this.shape=e}check(e,n){const r=Pk(this.shape,i=>i.check(e,n));return!r&&(n==null||n.extend(null,"Intersectinon",typeof e)),r}}An(ece,t=>t.shape.length>0);class Zy extends pr{constructor(e){super(),this.shape=e}check(e,n){const r=_k(this.shape,i=>i.check(e,n));return n==null||n.extend(null,"Union",typeof e),r}}We(Zy,"_dilutes",!0);const Fu=(...t)=>t.findIndex(e=>EO.check(e))>=0?Fu(...t.map(e=>Oh(e)).map(e=>EO.check(e)?e.shape:[e]).flat(1)):t.length===1?t[0]:new Zy(t),EO=An(Zy),w3=()=>!0,RO=Wn(w3),tce=An(Uk,t=>t.shape===w3),Vk=Wn(t=>typeof t=="bigint"),nce=Wn(t=>t===Vk),k3=Wn(t=>typeof t=="symbol");Wn(t=>t===k3);const cu=Wn(t=>typeof t=="number"),C3=Wn(t=>t===cu),$u=Wn(t=>typeof t=="string"),T3=Wn(t=>t===$u),Xy=Wn(t=>typeof t=="boolean"),rce=Wn(t=>t===Xy),Q3=Iy(void 0);An(jy,t=>t.shape.length===1&&t.shape[0]===void 0);Iy(void 0);const By=Iy(null),ice=An(jy,t=>t.shape.length===1&&t.shape[0]===null);An(Uint8Array);An(Bk,t=>t.shape===Uint8Array);const sce=Fu(cu,$u,By,Q3,Vk,Xy,k3);(()=>{const t=x3(RO),e=y3($u,RO),n=Fu(cu,$u,By,Xy,t,e);return t.shape=n,e.shape.values=n,n})();const Oh=t=>{if(Fle.check(t))return t;if(Ule.check(t)){const e={};for(const n in t)e[n]=Oh(t[n]);return Xle(e)}else{if(Gle.check(t))return Fu(...t.map(Oh));if(sce.check(t))return Iy(t);if(Jle.check(t))return An(t)}mi()},R$=ble?()=>{}:(t,e)=>{const n=new Nle;if(!e.check(t,n))throw Ys(`Expected value to be of type ${e.constructor.name}.
316
+ ${n.toString()}`)};class oce{constructor(e){this.patterns=[],this.$state=e}if(e,n){return this.patterns.push({if:Oh(e),h:n}),this}else(e){return this.if(RO,e)}done(){return(e,n)=>{for(let r=0;r<this.patterns.length;r++){const i=this.patterns[r];if(i.if.check(e))return i.h(e,n)}throw Ys("Unhandled pattern")}}}const ace=t=>new oce(t),E3=ace(RO).if(C3,(t,e)=>zx(e,b$,kO)).if(T3,(t,e)=>Mle(e)).if(rce,(t,e)=>E$(e)).if(nce,(t,e)=>BigInt(zx(e,b$,kO))).if(EO,(t,e)=>Ic(e,jx(e,t.shape))).if(Ble,(t,e)=>{const n={};for(const r in t.shape){let i=t.shape[r];if(Ile.check(i)){if(E$(e))continue;i=i.shape}n[r]=E3(i,e)}return n}).if(Yle,(t,e)=>{const n=[],r=h3(e,0,42);for(let i=0;i<r;i++)n.push(Ic(e,t.shape));return n}).if(p3,(t,e)=>jx(e,t.shape)).if(ice,(t,e)=>null).if(Kle,(t,e)=>{const n=Ic(e,t.res);return()=>n}).if(tce,(t,e)=>Ic(e,jx(e,[cu,$u,By,Q3,Vk,Xy,x3(cu),y3(Fu("a","b","c"),cu)]))).if(Vle,(t,e)=>{const n={},r=zx(e,0,3);for(let i=0;i<r;i++){const s=Ic(e,t.shape.keys),a=Ic(e,t.shape.values);n[s]=a}return n}).done(),Ic=(t,e)=>E3(Oh(e),t),Ks=typeof document<"u"?document:{},lce=t=>Ks.createElement(t),cce=()=>Ks.createDocumentFragment();Wn(t=>t.nodeType===yce);const uce=t=>Ks.createTextNode(t);typeof DOMParser<"u"&&new DOMParser;const fce=(t,e)=>(_le(e,(n,r)=>{r===!1?t.removeAttribute(n):r===!0?t.setAttribute(n,""):t.setAttribute(n,r)}),t),dce=t=>{const e=cce();for(let n=0;n<t.length;n++)R3(e,t[n]);return e},hce=(t,e)=>(R3(t,dce(e)),t),Ix=(t,e=[],n=[])=>hce(fce(lce(t),e),n);Wn(t=>t.nodeType===gce);const Hg=uce;Wn(t=>t.nodeType===mce);const pce=t=>Sae(t,(e,n)=>`${n}:${e};`).join(""),R3=(t,e)=>t.appendChild(e),gce=Ks.ELEMENT_NODE,mce=Ks.TEXT_NODE;Ks.CDATA_SECTION_NODE;Ks.COMMENT_NODE;const Oce=Ks.DOCUMENT_NODE;Ks.DOCUMENT_TYPE_NODE;const yce=Ks.DOCUMENT_FRAGMENT_NODE;Wn(t=>t.nodeType===Oce);const Bo=Symbol,A3=Bo(),P3=Bo(),bce=Bo(),vce=Bo(),xce=Bo(),_3=Bo(),Sce=Bo(),qk=Bo(),wce=Bo(),kce=t=>{var i;t.length===1&&((i=t[0])==null?void 0:i.constructor)===Function&&(t=t[0]());const e=[],n=[];let r=0;for(;r<t.length;r++){const s=t[r];if(s===void 0)break;if(s.constructor===String||s.constructor===Number)e.push(s);else if(s.constructor===Object)break}for(r>0&&n.push(e.join(""));r<t.length;r++){const s=t[r];s instanceof Symbol||n.push(s)}return n},Cce={[A3]:oi("font-weight","bold"),[P3]:oi("font-weight","normal"),[bce]:oi("color","blue"),[xce]:oi("color","green"),[vce]:oi("color","grey"),[_3]:oi("color","red"),[Sce]:oi("color","purple"),[qk]:oi("color","orange"),[wce]:oi("color","black")},Tce=t=>{var a;t.length===1&&((a=t[0])==null?void 0:a.constructor)===Function&&(t=t[0]());const e=[],n=[],r=qr();let i=[],s=0;for(;s<t.length;s++){const l=t[s],u=Cce[l];if(u!==void 0)r.set(u.left,u.right);else{if(l===void 0)break;if(l.constructor===String||l.constructor===Number){const d=pce(r);s>0||d.length>0?(e.push("%c"+l),n.push(d)):e.push(l)}else break}}for(s>0&&(i=n,i.unshift(e.join("")));s<t.length;s++){const l=t[s];l instanceof Symbol||i.push(l)}return i},$3=xle?Tce:kce,Qce=(...t)=>{console.log(...$3(t)),D3.forEach(e=>e.print(t))},M3=(...t)=>{console.warn(...$3(t)),t.unshift(qk),D3.forEach(e=>e.print(t))},D3=Xa(),N3=t=>({[Symbol.iterator](){return this},next:t}),Ece=(t,e)=>N3(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),Zx=(t,e)=>N3(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class Yk{constructor(e,n){this.clock=e,this.len=n}}class Hu{constructor(){this.clients=new Map}}const Mu=(t,e,n)=>e.clients.forEach((r,i)=>{const s=t.doc.store.clients.get(i);if(s!=null){const a=s[s.length-1],l=a.id.clock+a.length;for(let u=0,d=r[u];u<r.length&&d.clock<l;d=r[++u])F3(t,s,d.clock,d.len,n)}}),Rce=(t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const i=hs((n+r)/2),s=t[i],a=s.clock;if(a<=e){if(e<a+s.len)return i;n=i+1}else r=i-1}return null},Fh=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&Rce(n,e.clock)!==null},Gk=t=>{t.clients.forEach(e=>{e.sort((i,s)=>i.clock-s.clock);let n,r;for(n=1,r=1;n<e.length;n++){const i=e[r-1],s=e[n];i.clock+i.len>=s.clock?i.len=Ga(i.len,s.clock+s.len-i.clock):(r<n&&(e[r]=s),r++)}e.length=r})},Sw=t=>{const e=new Hu;for(let n=0;n<t.length;n++)t[n].clients.forEach((r,i)=>{if(!e.clients.has(i)){const s=r.slice();for(let a=n+1;a<t.length;a++)kae(s,t[a].clients.get(i)||[]);e.clients.set(i,s)}});return Gk(e),e},yh=(t,e,n,r)=>{Hs(t.clients,e,()=>[]).push(new Yk(n,r))},Ace=()=>new Hu,Pce=t=>{const e=Ace();return t.clients.forEach((n,r)=>{const i=[];for(let s=0;s<n.length;s++){const a=n[s];if(a.deleted){const l=a.id.clock;let u=a.length;if(s+1<n.length)for(let d=n[s+1];s+1<n.length&&d.deleted;d=n[++s+1])u+=d.length;i.push(new Yk(l,u))}}i.length>0&&e.clients.set(r,i)}),e},Ku=(t,e)=>{_e(t.restEncoder,e.clients.size),Io(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),_e(t.restEncoder,n);const i=r.length;_e(t.restEncoder,i);for(let s=0;s<i;s++){const a=r[s];t.writeDsClock(a.clock),t.writeDsLen(a.len)}})},Wk=t=>{const e=new Hu,n=Ie(t.restDecoder);for(let r=0;r<n;r++){t.resetDsCurVal();const i=Ie(t.restDecoder),s=Ie(t.restDecoder);if(s>0){const a=Hs(e.clients,i,()=>[]);for(let l=0;l<s;l++)a.push(new Yk(t.readDsClock(),t.readDsLen()))}}return e},A$=(t,e,n)=>{const r=new Hu,i=Ie(t.restDecoder);for(let s=0;s<i;s++){t.resetDsCurVal();const a=Ie(t.restDecoder),l=Ie(t.restDecoder),u=n.clients.get(a)||[],d=Sn(n,a);for(let h=0;h<l;h++){const g=t.readDsClock(),m=g+t.readDsLen();if(g<d){d<m&&yh(r,a,d,m-d);let O=Gs(u,g),v=u[O];for(!v.deleted&&v.id.clock<g&&(u.splice(O+1,0,LO(e,v,g-v.id.clock)),O++);O<u.length&&(v=u[O++],v.id.clock<m);)v.deleted||(m<v.id.clock+v.length&&u.splice(O,0,LO(e,v,m-v.id.clock)),v.delete(e))}else yh(r,a,g,m-g)}}if(r.clients.size>0){const s=new Bl;return _e(s.restEncoder,0),Ku(s,r),s.toUint8Array()}return null},L3=i3;class Fl extends $k{constructor({guid:e=ile(),collectionid:n=null,gc:r=!0,gcFilter:i=()=>!0,meta:s=null,autoLoad:a=!1,shouldLoad:l=!0}={}){super(),this.gc=r,this.gcFilter=i,this.clientID=L3(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new G3,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=a,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=T$(d=>{this.on("load",()=>{this.isLoaded=!0,d(this)})});const u=()=>T$(d=>{const h=g=>{(g===void 0||g===!0)&&(this.off("sync",h),d())};this.on("sync",h)});this.on("sync",d=>{d===!1&&this.isSynced&&(this.whenSynced=u()),this.isSynced=d===void 0||d===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=u()}load(){const e=this._item;e!==null&&!this.shouldLoad&&Yt(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Io(this.subdocs).map(e=>e.guid))}transact(e,n=null){return Yt(this,e,n)}get(e,n=Gn){const r=Hs(this.share,e,()=>{const s=new n;return s._integrate(this,null),s}),i=r.constructor;if(n!==Gn&&i!==n)if(i===Gn){const s=new n;s._map=r._map,r._map.forEach(a=>{for(;a!==null;a=a.left)a.parent=s}),s._start=r._start;for(let a=s._start;a!==null;a=a.right)a.parent=s;return s._length=r._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 r}getArray(e=""){return this.get(e,du)}getText(e=""){return this.get(e,Lu)}getMap(e=""){return this.get(e,Nu)}getXmlElement(e=""){return this.get(e,zu)}getXmlFragment(e=""){return this.get(e,Ul)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){this.isDestroyed=!0,Io(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new Fl({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,Yt(e.parent.doc,r=>{const i=n.doc;e.deleted||r.subdocsAdded.add(i),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class z3{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Ie(this.restDecoder)}readDsLen(){return Ie(this.restDecoder)}}class j3 extends z3{readLeftID(){return Xe(Ie(this.restDecoder),Ie(this.restDecoder))}readRightID(){return Xe(Ie(this.restDecoder),Ie(this.restDecoder))}readClient(){return Ie(this.restDecoder)}readInfo(){return _u(this.restDecoder)}readString(){return $a(this.restDecoder)}readParentInfo(){return Ie(this.restDecoder)===1}readTypeRef(){return Ie(this.restDecoder)}readLen(){return Ie(this.restDecoder)}readAny(){return gh(this.restDecoder)}readBuf(){return Ale(lr(this.restDecoder))}readJSON(){return JSON.parse($a(this.restDecoder))}readKey(){return $a(this.restDecoder)}}class _ce{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Ie(this.restDecoder),this.dsCurrVal}readDsLen(){const e=Ie(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Du extends _ce{constructor(e){super(e),this.keys=[],Ie(e),this.keyClockDecoder=new Lx(lr(e)),this.clientDecoder=new Tm(lr(e)),this.leftClockDecoder=new Lx(lr(e)),this.rightClockDecoder=new Lx(lr(e)),this.infoDecoder=new C$(lr(e),_u),this.stringDecoder=new tle(lr(e)),this.parentInfoDecoder=new C$(lr(e),_u),this.typeRefDecoder=new Tm(lr(e)),this.lenDecoder=new Tm(lr(e))}readLeftID(){return new uu(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new uu(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 gh(this.restDecoder)}readBuf(){return lr(this.restDecoder)}readJSON(){return gh(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 I3{constructor(){this.restEncoder=cr()}toUint8Array(){return ln(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){_e(this.restEncoder,e)}writeDsLen(e){_e(this.restEncoder,e)}}class Hh extends I3{writeLeftID(e){_e(this.restEncoder,e.client),_e(this.restEncoder,e.clock)}writeRightID(e){_e(this.restEncoder,e.client),_e(this.restEncoder,e.clock)}writeClient(e){_e(this.restEncoder,e)}writeInfo(e){yw(this.restEncoder,e)}writeString(e){Al(this.restEncoder,e)}writeParentInfo(e){_e(this.restEncoder,e?1:0)}writeTypeRef(e){_e(this.restEncoder,e)}writeLen(e){_e(this.restEncoder,e)}writeAny(e){ph(this.restEncoder,e)}writeBuf(e){bn(this.restEncoder,e)}writeJSON(e){Al(this.restEncoder,JSON.stringify(e))}writeKey(e){Al(this.restEncoder,e)}}class Z3{constructor(){this.restEncoder=cr(),this.dsCurrVal=0}toUint8Array(){return ln(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,_e(this.restEncoder,n)}writeDsLen(e){e===0&&mi(),_e(this.restEncoder,e-1),this.dsCurrVal+=e}}class Bl extends Z3{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Nx,this.clientEncoder=new Cm,this.leftClockEncoder=new Nx,this.rightClockEncoder=new Nx,this.infoEncoder=new S$(yw),this.stringEncoder=new qae,this.parentInfoEncoder=new S$(yw),this.typeRefEncoder=new Cm,this.lenEncoder=new Cm}toUint8Array(){const e=cr();return _e(e,0),bn(e,this.keyClockEncoder.toUint8Array()),bn(e,this.clientEncoder.toUint8Array()),bn(e,this.leftClockEncoder.toUint8Array()),bn(e,this.rightClockEncoder.toUint8Array()),bn(e,ln(this.infoEncoder)),bn(e,this.stringEncoder.toUint8Array()),bn(e,ln(this.parentInfoEncoder)),bn(e,this.typeRefEncoder.toUint8Array()),bn(e,this.lenEncoder.toUint8Array()),Ly(e,ln(this.restEncoder)),ln(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){ph(this.restEncoder,e)}writeBuf(e){bn(this.restEncoder,e)}writeJSON(e){ph(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 $ce=(t,e,n,r)=>{r=Ga(r,e[0].id.clock);const i=Gs(e,r);_e(t.restEncoder,e.length-i),t.writeClient(n),_e(t.restEncoder,r);const s=e[i];s.write(t,r-s.id.clock);for(let a=i+1;a<e.length;a++)e[a].write(t,0)},Fk=(t,e,n)=>{const r=new Map;n.forEach((i,s)=>{Sn(e,s)>i&&r.set(s,i)}),Uy(e).forEach((i,s)=>{n.has(s)||r.set(s,0)}),_e(t.restEncoder,r.size),Io(r.entries()).sort((i,s)=>s[0]-i[0]).forEach(([i,s])=>{$ce(t,e.clients.get(i),i,s)})},Mce=(t,e)=>{const n=qr(),r=Ie(t.restDecoder);for(let i=0;i<r;i++){const s=Ie(t.restDecoder),a=new Array(s),l=t.readClient();let u=Ie(t.restDecoder);n.set(l,{i:0,refs:a});for(let d=0;d<s;d++){const h=t.readInfo();switch(Ny&h){case 0:{const g=t.readLen();a[d]=new Ni(Xe(l,u),g),u+=g;break}case 10:{const g=Ie(t.restDecoder);a[d]=new Li(Xe(l,u),g),u+=g;break}default:{const g=(h&(_o|gi))===0,m=new Gt(Xe(l,u),null,(h&gi)===gi?t.readLeftID():null,null,(h&_o)===_o?t.readRightID():null,g?t.readParentInfo()?e.get(t.readString()):t.readLeftID():null,g&&(h&dh)===dh?t.readString():null,OI(t,h));a[d]=m,u+=m.length}}}}return n},Dce=(t,e,n)=>{const r=[];let i=Io(n.keys()).sort((O,v)=>O-v);if(i.length===0)return null;const s=()=>{if(i.length===0)return null;let O=n.get(i[i.length-1]);for(;O.refs.length===O.i;)if(i.pop(),i.length>0)O=n.get(i[i.length-1]);else return null;return O};let a=s();if(a===null)return null;const l=new G3,u=new Map,d=(O,v)=>{const x=u.get(O);(x==null||x>v)&&u.set(O,v)};let h=a.refs[a.i++];const g=new Map,m=()=>{for(const O of r){const v=O.id.client,x=n.get(v);x?(x.i--,l.clients.set(v,x.refs.slice(x.i)),n.delete(v),x.i=0,x.refs=[]):l.clients.set(v,[O]),i=i.filter(k=>k!==v)}r.length=0};for(;;){if(h.constructor!==Li){const v=Hs(g,h.id.client,()=>Sn(e,h.id.client))-h.id.clock;if(v<0)r.push(h),d(h.id.client,h.id.clock-1),m();else{const x=h.getMissing(t,e);if(x!==null){r.push(h);const k=n.get(x)||{refs:[],i:0};if(k.refs.length===k.i)d(x,Sn(e,x)),m();else{h=k.refs[k.i++];continue}}else(v===0||v<h.length)&&(h.integrate(t,v),g.set(h.id.client,h.id.clock+h.length))}}if(r.length>0)h=r.pop();else if(a!==null&&a.i<a.refs.length)h=a.refs[a.i++];else{if(a=s(),a===null)break;h=a.refs[a.i++]}}if(l.clients.size>0){const O=new Bl;return Fk(O,l,new Map),_e(O.restEncoder,0),{missing:u,update:O.toUint8Array()}}return null},Nce=(t,e)=>Fk(t,e.doc.store,e.beforeState),Lce=(t,e,n,r=new Du(t))=>Yt(e,i=>{i.local=!1;let s=!1;const a=i.doc,l=a.store,u=Mce(r,a),d=Dce(i,l,u),h=l.pendingStructs;if(h){for(const[m,O]of h.missing)if(O<Sn(l,m)){s=!0;break}if(d){for(const[m,O]of d.missing){const v=h.missing.get(m);(v==null||v>O)&&h.missing.set(m,O)}h.update=PO([h.update,d.update])}}else l.pendingStructs=d;const g=A$(r,i,l);if(l.pendingDs){const m=new Du(Wa(l.pendingDs));Ie(m.restDecoder);const O=A$(m,i,l);g&&O?l.pendingDs=PO([g,O]):l.pendingDs=g||O}else l.pendingDs=g;if(s){const m=l.pendingStructs.update;l.pendingStructs=null,X3(i.doc,m)}},n,!1),X3=(t,e,n,r=Du)=>{const i=Wa(e);Lce(i,t,n,new r(i))},zce=(t,e,n)=>X3(t,e,n,j3),jce=(t,e,n=new Map)=>{Fk(t,e.store,n),Ku(t,Pce(e.store))},Ice=(t,e=new Uint8Array([0]),n=new Bl)=>{const r=B3(e);jce(n,t,r);const i=[n.toUint8Array()];if(t.store.pendingDs&&i.push(t.store.pendingDs),t.store.pendingStructs&&i.push(sue(t.store.pendingStructs.update,e)),i.length>1){if(n.constructor===Hh)return rue(i.map((s,a)=>a===0?s:aue(s)));if(n.constructor===Bl)return PO(i)}return i[0]},Zce=(t,e)=>Ice(t,e,new Hh),Xce=t=>{const e=new Map,n=Ie(t.restDecoder);for(let r=0;r<n;r++){const i=Ie(t.restDecoder),s=Ie(t.restDecoder);e.set(i,s)}return e},B3=t=>Xce(new z3(Wa(t))),U3=(t,e)=>(_e(t.restEncoder,e.size),Io(e.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{_e(t.restEncoder,n),_e(t.restEncoder,r)}),t),Bce=(t,e)=>U3(t,Uy(e.store)),Uce=(t,e=new Z3)=>(t instanceof Map?U3(e,t):Bce(e,t),e.toUint8Array()),Vce=t=>Uce(t,new I3);class qce{constructor(){this.l=[]}}const P$=()=>new qce,_$=(t,e)=>t.l.push(e),$$=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(i=>e!==i),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},V3=(t,e,n)=>Zk(t.l,[e,n]);class uu{constructor(e,n){this.client=e,this.clock=n}}const Wc=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Xe=(t,e)=>new uu(t,e),q3=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw mi()},AO=(t,e)=>{for(;e!==null;){if(e.parent===t)return!0;e=e.parent._item}return!1};class Y3{constructor(e,n,r,i=0){this.type=e,this.tname=n,this.item=r,this.assoc=i}}const M$=t=>{const e={};return t.type&&(e.type=t.type),t.tname&&(e.tname=t.tname),t.item&&(e.item=t.item),t.assoc!=null&&(e.assoc=t.assoc),e},bh=t=>new Y3(t.type==null?null:Xe(t.type.client,t.type.clock),t.tname??null,t.item==null?null:Xe(t.item.client,t.item.clock),t.assoc==null?0:t.assoc);class Yce{constructor(e,n,r=0){this.type=e,this.index=n,this.assoc=r}}const Gce=(t,e,n=0)=>new Yce(t,e,n),Kg=(t,e,n)=>{let r=null,i=null;return t._item===null?i=q3(t):r=Xe(t._item.id.client,t._item.id.clock),new Y3(r,i,e,n)},ww=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return Kg(t,null,n);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return Kg(t,Xe(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return Kg(t,r.lastId,n);r=r.right}return Kg(t,null,n)},Wce=(t,e)=>{const n=fu(t,e),r=e.clock-n.id.clock;return{item:n,diff:r}},kw=(t,e,n=!0)=>{const r=e.store,i=t.item,s=t.type,a=t.tname,l=t.assoc;let u=null,d=0;if(i!==null){if(Sn(r,i.client)<=i.clock)return null;const h=n?Ew(r,i):Wce(r,i),g=h.item;if(!(g instanceof Gt))return null;if(u=g.parent,u._item===null||!u._item.deleted){d=g.deleted||!g.countable?0:h.diff+(l>=0?0:1);let m=g.left;for(;m!==null;)!m.deleted&&m.countable&&(d+=m.length),m=m.left}}else{if(a!==null)u=e.get(a);else if(s!==null){if(Sn(r,s.client)<=s.clock)return null;const{item:h}=n?Ew(r,s):{item:fu(r,s)};if(h instanceof Gt&&h.content instanceof Js)u=h.content.type;else return null}else throw mi();l>=0?d=u._length:d=0}return Gce(u,d,t.assoc)},D$=(t,e)=>t===e||t!==null&&e!==null&&t.tname===e.tname&&Wc(t.item,e.item)&&Wc(t.type,e.type)&&t.assoc===e.assoc,Xc=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!Fh(e.ds,t.id),Cw=(t,e)=>{const n=Hs(t.meta,Cw,Xa),r=t.doc.store;n.has(e)||(e.sv.forEach((i,s)=>{i<Sn(r,s)&&Br(t,Xe(s,i))}),Mu(t,e.ds,i=>{}),n.add(e))};class G3{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Uy=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const i=n[n.length-1];e.set(r,i.id.clock+i.length)}),e},Sn=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},W3=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw mi()}n.push(e)},Gs=(t,e)=>{let n=0,r=t.length-1,i=t[r],s=i.id.clock;if(s===e)return r;let a=hs(e/(s+i.length-1)*r);for(;n<=r;){if(i=t[a],s=i.id.clock,s<=e){if(e<s+i.length)return a;n=a+1}else r=a-1;a=hs((n+r)/2)}throw mi()},Fce=(t,e)=>{const n=t.clients.get(e.client);return n[Gs(n,e.clock)]},fu=Fce,Tw=(t,e,n)=>{const r=Gs(e,n),i=e[r];return i.id.clock<n&&i instanceof Gt?(e.splice(r+1,0,LO(t,i,n-i.id.clock)),r+1):r},Br=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[Tw(t,n,e.clock)]},N$=(t,e,n)=>{const r=e.clients.get(n.client),i=Gs(r,n.clock),s=r[i];return n.clock!==s.id.clock+s.length-1&&s.constructor!==Ni&&r.splice(i+1,0,LO(t,s,n.clock-s.id.clock+1)),s},Hce=(t,e,n)=>{const r=t.clients.get(e.id.client);r[Gs(r,e.id.clock)]=n},F3=(t,e,n,r,i)=>{if(r===0)return;const s=n+r;let a=Tw(t,e,n),l;do l=e[a++],s<l.id.clock+l.length&&Tw(t,e,s),i(l);while(a<e.length&&e[a].id.clock<s)};class Kce{constructor(e,n,r){this.doc=e,this.deleteSet=new Hu,this.beforeState=Uy(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=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const L$=(t,e)=>e.deleteSet.clients.size===0&&!wae(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(Gk(e.deleteSet),Nce(t,e),Ku(t,e.deleteSet),!0),z$=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&Hs(t.changed,e,Xa).add(n)},Qm=(t,e)=>{let n=t[e],r=t[e-1],i=e;for(;i>0;n=r,r=t[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof Gt&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const s=e-i;return s&&t.splice(e+1-s,s),s},Jce=(t,e,n)=>{for(const[r,i]of t.clients.entries()){const s=e.clients.get(r);for(let a=i.length-1;a>=0;a--){const l=i[a],u=l.clock+l.len;for(let d=Gs(s,l.clock),h=s[d];d<s.length&&h.id.clock<u;h=s[++d]){const g=s[d];if(l.clock+l.len<=g.id.clock)break;g instanceof Gt&&g.deleted&&!g.keep&&n(g)&&g.gc(e,!1)}}}},eue=(t,e)=>{t.clients.forEach((n,r)=>{const i=e.clients.get(r);for(let s=n.length-1;s>=0;s--){const a=n[s],l=Dy(i.length-1,1+Gs(i,a.clock+a.len-1));for(let u=l,d=i[u];u>0&&d.id.clock>=a.clock;d=i[u])u-=1+Qm(i,u)}})},H3=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,i=r.store,s=n.deleteSet,a=n._mergeStructs;try{Gk(s),n.afterState=Uy(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const l=[];n.changed.forEach((u,d)=>l.push(()=>{(d._item===null||!d._item.deleted)&&d._callObserver(n,u)})),l.push(()=>{n.changedParentTypes.forEach((u,d)=>{d._dEH.l.length>0&&(d._item===null||!d._item.deleted)&&(u=u.filter(h=>h.target._item===null||!h.target._item.deleted),u.forEach(h=>{h.currentTarget=d,h._path=null}),u.sort((h,g)=>h.path.length-g.path.length),l.push(()=>{V3(d._dEH,u,n)}))}),l.push(()=>r.emit("afterTransaction",[n,r])),l.push(()=>{n._needFormattingCleanup&&xue(n)})}),Zk(l,[])}finally{r.gc&&Jce(s,i,r.gcFilter),eue(s,i),n.afterState.forEach((h,g)=>{const m=n.beforeState.get(g)||0;if(m!==h){const O=i.clients.get(g),v=Ga(Gs(O,m),1);for(let x=O.length-1;x>=v;)x-=1+Qm(O,x)}});for(let h=a.length-1;h>=0;h--){const{client:g,clock:m}=a[h].id,O=i.clients.get(g),v=Gs(O,m);v+1<O.length&&Qm(O,v+1)>1||v>0&&Qm(O,v)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(Qce(qk,A3,"[yjs] ",P3,_3,"Changed the client-id because another client seems to be using it."),r.clientID=L3()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const h=new Hh;L$(h,n)&&r.emit("update",[h.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const h=new Bl;L$(h,n)&&r.emit("updateV2",[h.toUint8Array(),n.origin,r,n])}const{subdocsAdded:l,subdocsLoaded:u,subdocsRemoved:d}=n;(l.size>0||d.size>0||u.size>0)&&(l.forEach(h=>{h.clientID=r.clientID,h.collectionid==null&&(h.collectionid=r.collectionid),r.subdocs.add(h)}),d.forEach(h=>r.subdocs.delete(h)),r.emit("subdocs",[{loaded:u,added:l,removed:d},r,n]),d.forEach(h=>h.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):H3(t,e+1)}}},Yt=(t,e,n=null,r=!0)=>{const i=t._transactionCleanups;let s=!1,a=null;t._transaction===null&&(s=!0,t._transaction=new Kce(t,n,r),i.push(t._transaction),i.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{a=e(t._transaction)}finally{if(s){const l=t._transaction===i[0];t._transaction=null,l&&H3(i,0)}}return a};class tue{constructor(e,n){this.insertions=n,this.deletions=e,this.meta=new Map}}const j$=(t,e,n)=>{Mu(t,n.deletions,r=>{r instanceof Gt&&e.scope.some(i=>i===t.doc||AO(i,r))&&iC(r,!1)})},I$=(t,e,n)=>{let r=null;const i=t.doc,s=t.scope;Yt(i,l=>{for(;e.length>0&&t.currStackItem===null;){const u=i.store,d=e.pop(),h=new Set,g=[];let m=!1;Mu(l,d.insertions,O=>{if(O instanceof Gt){if(O.redone!==null){let{item:v,diff:x}=Ew(u,O.id);x>0&&(v=Br(l,Xe(v.id.client,v.id.clock+x))),O=v}!O.deleted&&s.some(v=>v===l.doc||AO(v,O))&&g.push(O)}}),Mu(l,d.deletions,O=>{O instanceof Gt&&s.some(v=>v===l.doc||AO(v,O))&&!Fh(d.insertions,O.id)&&h.add(O)}),h.forEach(O=>{m=mI(l,O,h,d.insertions,t.ignoreRemoteMapChanges,t)!==null||m});for(let O=g.length-1;O>=0;O--){const v=g[O];t.deleteFilter(v)&&(v.delete(l),m=!0)}t.currStackItem=m?d:null}l.changed.forEach((u,d)=>{u.has(null)&&d._searchMarker&&(d._searchMarker.length=0)}),r=l},t);const a=t.currStackItem;if(a!=null){const l=r.changedParentTypes;t.emit("stack-item-popped",[{stackItem:a,type:n,changedParentTypes:l,origin:t},t]),t.currStackItem=null}return a};class K3 extends $k{constructor(e,{captureTimeout:n=500,captureTransaction:r=u=>!0,deleteFilter:i=()=>!0,trackedOrigins:s=new Set([null]),ignoreRemoteMapChanges:a=!1,doc:l=Pu(e)?e[0].doc:e instanceof Fl?e:e.doc}={}){super(),this.scope=[],this.doc=l,this.addToScope(e),this.deleteFilter=i,s.add(this),this.trackedOrigins=s,this.captureTransaction=r,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=a,this.captureTimeout=n,this.afterTransactionHandler=u=>{if(!this.captureTransaction(u)||!this.scope.some(k=>u.changedParentTypes.has(k)||k===this.doc)||!this.trackedOrigins.has(u.origin)&&(!u.origin||!this.trackedOrigins.has(u.origin.constructor)))return;const d=this.undoing,h=this.redoing,g=d?this.redoStack:this.undoStack;d?this.stopCapturing():h||this.clear(!1,!0);const m=new Hu;u.afterState.forEach((k,C)=>{const Q=u.beforeState.get(C)||0,R=k-Q;R>0&&yh(m,C,Q,R)});const O=Ba();let v=!1;if(this.lastChange>0&&O-this.lastChange<this.captureTimeout&&g.length>0&&!d&&!h){const k=g[g.length-1];k.deletions=Sw([k.deletions,u.deleteSet]),k.insertions=Sw([k.insertions,m])}else g.push(new tue(u.deleteSet,m)),v=!0;!d&&!h&&(this.lastChange=O),Mu(u,u.deleteSet,k=>{k instanceof Gt&&this.scope.some(C=>C===u.doc||AO(C,k))&&iC(k,!0)});const x=[{stackItem:g[g.length-1],origin:u.origin,type:d?"redo":"undo",changedParentTypes:u.changedParentTypes},this];v?this.emit("stack-item-added",x):this.emit("stack-item-updated",x)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){const n=new Set(this.scope);e=Pu(e)?e:[e],e.forEach(r=>{n.has(r)||(n.add(r),(r instanceof Gn?r.doc!==this.doc:r!==this.doc)&&M3("[yjs#509] Not same Y.Doc"),this.scope.push(r))})}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(r=>{e&&(this.undoStack.forEach(i=>j$(r,this,i)),this.undoStack=[]),n&&(this.redoStack.forEach(i=>j$(r,this,i)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=I$(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=I$(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*nue(t){const e=Ie(t.restDecoder);for(let n=0;n<e;n++){const r=Ie(t.restDecoder),i=t.readClient();let s=Ie(t.restDecoder);for(let a=0;a<r;a++){const l=t.readInfo();if(l===10){const u=Ie(t.restDecoder);yield new Li(Xe(i,s),u),s+=u}else if((Ny&l)!==0){const u=(l&(_o|gi))===0,d=new Gt(Xe(i,s),null,(l&gi)===gi?t.readLeftID():null,null,(l&_o)===_o?t.readRightID():null,u?t.readParentInfo()?t.readString():t.readLeftID():null,u&&(l&dh)===dh?t.readString():null,OI(t,l));yield d,s+=d.length}else{const u=t.readLen();yield new Ni(Xe(i,s),u),s+=u}}}}class Hk{constructor(e,n){this.gen=nue(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===Li);return this.curr}}class Kk{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const rue=t=>PO(t,j3,Hh),iue=(t,e)=>{if(t.constructor===Ni){const{client:n,clock:r}=t.id;return new Ni(Xe(n,r+e),t.length-e)}else if(t.constructor===Li){const{client:n,clock:r}=t.id;return new Li(Xe(n,r+e),t.length-e)}else{const n=t,{client:r,clock:i}=n.id;return new Gt(Xe(r,i+e),null,Xe(r,i+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}},PO=(t,e=Du,n=Bl)=>{if(t.length===1)return t[0];const r=t.map(h=>new e(Wa(h)));let i=r.map(h=>new Hk(h,!0)),s=null;const a=new n,l=new Kk(a);for(;i=i.filter(m=>m.curr!==null),i.sort((m,O)=>{if(m.curr.id.client===O.curr.id.client){const v=m.curr.id.clock-O.curr.id.clock;return v===0?m.curr.constructor===O.curr.constructor?0:m.curr.constructor===Li?1:-1:v}else return O.curr.id.client-m.curr.id.client}),i.length!==0;){const h=i[0],g=h.curr.id.client;if(s!==null){let m=h.curr,O=!1;for(;m!==null&&m.id.clock+m.length<=s.struct.id.clock+s.struct.length&&m.id.client>=s.struct.id.client;)m=h.next(),O=!0;if(m===null||m.id.client!==g||O&&m.id.clock>s.struct.id.clock+s.struct.length)continue;if(g!==s.struct.id.client)ka(l,s.struct,s.offset),s={struct:m,offset:0},h.next();else if(s.struct.id.clock+s.struct.length<m.id.clock)if(s.struct.constructor===Li)s.struct.length=m.id.clock+m.length-s.struct.id.clock;else{ka(l,s.struct,s.offset);const v=m.id.clock-s.struct.id.clock-s.struct.length;s={struct:new Li(Xe(g,s.struct.id.clock+s.struct.length),v),offset:0}}else{const v=s.struct.id.clock+s.struct.length-m.id.clock;v>0&&(s.struct.constructor===Li?s.struct.length-=v:m=iue(m,v)),s.struct.mergeWith(m)||(ka(l,s.struct,s.offset),s={struct:m,offset:0},h.next())}}else s={struct:h.curr,offset:0},h.next();for(let m=h.curr;m!==null&&m.id.client===g&&m.id.clock===s.struct.id.clock+s.struct.length&&m.constructor!==Li;m=h.next())ka(l,s.struct,s.offset),s={struct:m,offset:0}}s!==null&&(ka(l,s.struct,s.offset),s=null),Jk(l);const u=r.map(h=>Wk(h)),d=Sw(u);return Ku(a,d),a.toUint8Array()},sue=(t,e,n=Du,r=Bl)=>{const i=B3(e),s=new r,a=new Kk(s),l=new n(Wa(t)),u=new Hk(l,!1);for(;u.curr;){const h=u.curr,g=h.id.client,m=i.get(g)||0;if(u.curr.constructor===Li){u.next();continue}if(h.id.clock+h.length>m)for(ka(a,h,Ga(m-h.id.clock,0)),u.next();u.curr&&u.curr.id.client===g;)ka(a,u.curr,0),u.next();else for(;u.curr&&u.curr.id.client===g&&u.curr.id.clock+u.curr.length<=m;)u.next()}Jk(a);const d=Wk(l);return Ku(s,d),s.toUint8Array()},J3=t=>{t.written>0&&(t.clientStructs.push({written:t.written,restEncoder:ln(t.encoder.restEncoder)}),t.encoder.restEncoder=cr(),t.written=0)},ka=(t,e,n)=>{t.written>0&&t.currClient!==e.id.client&&J3(t),t.written===0&&(t.currClient=e.id.client,t.encoder.writeClient(e.id.client),_e(t.encoder.restEncoder,e.id.clock+n)),e.write(t.encoder,n),t.written++},Jk=t=>{J3(t);const e=t.encoder.restEncoder;_e(e,t.clientStructs.length);for(let n=0;n<t.clientStructs.length;n++){const r=t.clientStructs[n];_e(e,r.written),Ly(e,r.restEncoder)}},oue=(t,e,n,r)=>{const i=new n(Wa(t)),s=new Hk(i,!1),a=new r,l=new Kk(a);for(let d=s.curr;d!==null;d=s.next())ka(l,e(d),0);Jk(l);const u=Wk(i);return Ku(a,u),a.toUint8Array()},aue=t=>oue(t,mle,Du,Hh),Z$="You must not compute changes after the event-handler fired.";class Vy{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=lue(this.currentTarget,this.target))}deletes(e){return Fh(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Ys(Z$);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(i=>{if(i!==null){const s=n._map.get(i);let a,l;if(this.adds(s)){let u=s.left;for(;u!==null&&this.adds(u);)u=u.left;if(this.deletes(s))if(u!==null&&this.deletes(u))a="delete",l=$x(u.content.getContent());else return;else u!==null&&this.deletes(u)?(a="update",l=$x(u.content.getContent())):(a="add",l=void 0)}else if(this.deletes(s))a="delete",l=$x(s.content.getContent());else return;e.set(i,{action:a,oldValue:l})}}),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 Ys(Z$);const n=this.target,r=Xa(),i=Xa(),s=[];if(e={added:r,deleted:i,delta:s,keys:this.keys},this.transaction.changed.get(n).has(null)){let l=null;const u=()=>{l&&s.push(l)};for(let d=n._start;d!==null;d=d.right)d.deleted?this.deletes(d)&&!this.adds(d)&&((l===null||l.delete===void 0)&&(u(),l={delete:0}),l.delete+=d.length,i.add(d)):this.adds(d)?((l===null||l.insert===void 0)&&(u(),l={insert:[]}),l.insert=l.insert.concat(d.content.getContent()),r.add(d)):((l===null||l.retain===void 0)&&(u(),l={retain:0}),l.retain+=d.length);l!==null&&l.retain===void 0&&u()}this._changes=e}return e}}const lue=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,i=e._item.parent._start;for(;i!==e._item&&i!==null;)!i.deleted&&i.countable&&(r+=i.length),i=i.right;n.unshift(r)}e=e._item.parent}return n},dr=()=>{M3("Invalid access: Add Yjs type to a document before reading data.")},eI=80;let eC=0;class cue{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=eC++}}const uue=t=>{t.timestamp=eC++},tI=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=eC++},fue=(t,e,n)=>{if(t.length>=eI){const r=t.reduce((i,s)=>i.timestamp<s.timestamp?i:s);return tI(r,e,n),r}else{const r=new cue(e,n);return t.push(r),r}},qy=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((s,a)=>km(e-s.index)<km(e-a.index)?s:a);let r=t._start,i=0;for(n!==null&&(r=n.p,i=n.index,uue(n));r.right!==null&&i<e;){if(!r.deleted&&r.countable){if(e<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>e;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&km(n.index-i)<r.parent.length/eI?(tI(n,r,i),n):fue(t._searchMarker,r,i)},vh=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const i=t[r];if(n>0){let s=i.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(i.index-=s.length);if(s===null||s.marker===!0){t.splice(r,1);continue}i.p=s,s.marker=!0}(e<i.index||n>0&&e===i.index)&&(i.index=Ga(e,i.index+n))}},Yy=(t,e,n)=>{const r=t,i=e.changedParentTypes;for(;Hs(i,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;V3(r._eH,n,e)};class Gn{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=P$(),this._dEH=P$(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw as()}clone(){throw as()}_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){_$(this._eH,e)}observeDeep(e){_$(this._dEH,e)}unobserve(e){$$(this._eH,e)}unobserveDeep(e){$$(this._dEH,e)}toJSON(){}}const nI=(t,e,n)=>{t.doc??dr(),e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const i=[];let s=t._start;for(;s!==null&&r>0;){if(s.countable&&!s.deleted){const a=s.content.getContent();if(a.length<=e)e-=a.length;else{for(let l=e;l<a.length&&r>0;l++)i.push(a[l]),r--;e=0}}s=s.right}return i},rI=t=>{t.doc??dr();const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let i=0;i<r.length;i++)e.push(r[i])}n=n.right}return e},xh=(t,e)=>{let n=0,r=t._start;for(t.doc??dr();r!==null;){if(r.countable&&!r.deleted){const i=r.content.getContent();for(let s=0;s<i.length;s++)e(i[s],n++,t)}r=r.right}},iI=(t,e)=>{const n=[];return xh(t,(r,i)=>{n.push(e(r,i,t))}),n},due=t=>{let e=t._start,n=null,r=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(),r=0,e=e.right}const i=n[r++];return n.length<=r&&(n=null),{done:!1,value:i}}}},sI=(t,e)=>{t.doc??dr();const n=qy(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},_O=(t,e,n,r)=>{let i=n;const s=t.doc,a=s.clientID,l=s.store,u=n===null?e._start:n.right;let d=[];const h=()=>{d.length>0&&(i=new Gt(Xe(a,Sn(l,a)),i,i&&i.lastId,u,u&&u.id,e,null,new Vl(d)),i.integrate(t,0),d=[])};r.forEach(g=>{if(g===null)d.push(g);else switch(g.constructor){case Number:case Object:case Boolean:case Array:case String:d.push(g);break;default:switch(h(),g.constructor){case Uint8Array:case ArrayBuffer:i=new Gt(Xe(a,Sn(l,a)),i,i&&i.lastId,u,u&&u.id,e,null,new Kh(new Uint8Array(g))),i.integrate(t,0);break;case Fl:i=new Gt(Xe(a,Sn(l,a)),i,i&&i.lastId,u,u&&u.id,e,null,new Jh(g)),i.integrate(t,0);break;default:if(g instanceof Gn)i=new Gt(Xe(a,Sn(l,a)),i,i&&i.lastId,u,u&&u.id,e,null,new Js(g)),i.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),h()},oI=()=>Ys("Length exceeded!"),aI=(t,e,n,r)=>{if(n>e._length)throw oI();if(n===0)return e._searchMarker&&vh(e._searchMarker,n,r.length),_O(t,e,null,r);const i=n,s=qy(e,n);let a=e._start;for(s!==null&&(a=s.p,n-=s.index,n===0&&(a=a.prev,n+=a&&a.countable&&!a.deleted?a.length:0));a!==null;a=a.right)if(!a.deleted&&a.countable){if(n<=a.length){n<a.length&&Br(t,Xe(a.id.client,a.id.clock+n));break}n-=a.length}return e._searchMarker&&vh(e._searchMarker,i,r.length),_O(t,e,a,r)},hue=(t,e,n)=>{let i=(e._searchMarker||[]).reduce((s,a)=>a.index>s.index?a:s,{index:0,p:e._start}).p;if(i)for(;i.right;)i=i.right;return _O(t,e,i,n)},lI=(t,e,n,r)=>{if(r===0)return;const i=n,s=r,a=qy(e,n);let l=e._start;for(a!==null&&(l=a.p,n-=a.index);l!==null&&n>0;l=l.right)!l.deleted&&l.countable&&(n<l.length&&Br(t,Xe(l.id.client,l.id.clock+n)),n-=l.length);for(;r>0&&l!==null;)l.deleted||(r<l.length&&Br(t,Xe(l.id.client,l.id.clock+r)),l.delete(t),r-=l.length),l=l.right;if(r>0)throw oI();e._searchMarker&&vh(e._searchMarker,i,-s+r)},$O=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},tC=(t,e,n,r)=>{const i=e._map.get(n)||null,s=t.doc,a=s.clientID;let l;if(r==null)l=new Vl([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:l=new Vl([r]);break;case Uint8Array:l=new Kh(r);break;case Fl:l=new Jh(r);break;default:if(r instanceof Gn)l=new Js(r);else throw new Error("Unexpected content type")}new Gt(Xe(a,Sn(s.store,a)),i,i&&i.lastId,null,null,e,n,l).integrate(t,0)},nC=(t,e)=>{t.doc??dr();const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},cI=t=>{const e={};return t.doc??dr(),t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},uI=(t,e)=>{t.doc??dr();const n=t._map.get(e);return n!==void 0&&!n.deleted},pue=(t,e)=>{const n={};return t._map.forEach((r,i)=>{let s=r;for(;s!==null&&(!e.sv.has(s.id.client)||s.id.clock>=(e.sv.get(s.id.client)||0));)s=s.left;s!==null&&Xc(s,e)&&(n[i]=s.content.getContent()[s.length-1])}),n},Jg=t=>(t.doc??dr(),Ece(t._map.entries(),e=>!e[1].deleted));class gue extends Vy{}class du extends Gn{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new du;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new du}clone(){const e=new du;return e.insert(0,this.toArray().map(n=>n instanceof Gn?n.clone():n)),e}get length(){return this.doc??dr(),this._length}_callObserver(e,n){super._callObserver(e,n),Yy(this,e,new gue(this,e))}insert(e,n){this.doc!==null?Yt(this.doc,r=>{aI(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?Yt(this.doc,n=>{hue(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?Yt(this.doc,r=>{lI(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return sI(this,e)}toArray(){return rI(this)}slice(e=0,n=this.length){return nI(this,e,n)}toJSON(){return this.map(e=>e instanceof Gn?e.toJSON():e)}map(e){return iI(this,e)}forEach(e){xh(this,e)}[Symbol.iterator](){return due(this)}_write(e){e.writeTypeRef(Iue)}}const mue=t=>new du;class Oue extends Vy{constructor(e,n,r){super(e,n),this.keysChanged=r}}class Nu extends Gn{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((r,i)=>{this.set(i,r)}),this._prelimContent=null}_copy(){return new Nu}clone(){const e=new Nu;return this.forEach((n,r)=>{e.set(r,n instanceof Gn?n.clone():n)}),e}_callObserver(e,n){Yy(this,e,new Oue(this,e,n))}toJSON(){this.doc??dr();const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const i=n.content.getContent()[n.length-1];e[r]=i instanceof Gn?i.toJSON():i}}),e}get size(){return[...Jg(this)].length}keys(){return Zx(Jg(this),e=>e[0])}values(){return Zx(Jg(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Zx(Jg(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??dr(),this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?Yt(this.doc,n=>{$O(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?Yt(this.doc,r=>{tC(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return nC(this,e)}has(e){return uI(this,e)}clear(){this.doc!==null?Yt(this.doc,e=>{this.forEach(function(n,r,i){$O(e,i,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(Zue)}}const yue=t=>new Nu,Ra=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&ple(t,e);class Qw{constructor(e,n,r,i){this.left=e,this.right=n,this.index=r,this.currentAttributes=i}forward(){switch(this.right===null&&mi(),this.right.content.constructor){case zn:this.right.deleted||Ju(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 X$=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case zn:e.right.deleted||Ju(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n<e.right.length&&Br(t,Xe(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},em=(t,e,n,r)=>{const i=new Map,s=r?qy(e,n):null;if(s){const a=new Qw(s.p.left,s.p,s.index,i);return X$(t,a,n-s.index)}else{const a=new Qw(null,e._start,0,i);return X$(t,a,n)}},fI=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===zn&&Ra(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const i=t.doc,s=i.clientID;r.forEach((a,l)=>{const u=n.left,d=n.right,h=new Gt(Xe(s,Sn(i.store,s)),u,u&&u.lastId,d,d&&d.id,e,null,new zn(l,a));h.integrate(t,0),n.right=h,n.forward()})},Ju=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},dI=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===zn&&Ra(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},hI=(t,e,n,r)=>{const i=t.doc,s=i.clientID,a=new Map;for(const l in r){const u=r[l],d=n.currentAttributes.get(l)??null;if(!Ra(d,u)){a.set(l,d);const{left:h,right:g}=n;n.right=new Gt(Xe(s,Sn(i.store,s)),h,h&&h.lastId,g,g&&g.id,e,null,new zn(l,u)),n.right.integrate(t,0),n.forward()}}return a},Xx=(t,e,n,r,i)=>{n.currentAttributes.forEach((m,O)=>{i[O]===void 0&&(i[O]=null)});const s=t.doc,a=s.clientID;dI(n,i);const l=hI(t,e,n,i),u=r.constructor===String?new Ws(r):r instanceof Gn?new Js(r):new Hl(r);let{left:d,right:h,index:g}=n;e._searchMarker&&vh(e._searchMarker,n.index,u.getLength()),h=new Gt(Xe(a,Sn(s.store,a)),d,d&&d.lastId,h,h&&h.id,e,null,u),h.integrate(t,0),n.right=h,n.index=g,n.forward(),fI(t,e,n,l)},B$=(t,e,n,r,i)=>{const s=t.doc,a=s.clientID;dI(n,i);const l=hI(t,e,n,i);e:for(;n.right!==null&&(r>0||l.size>0&&(n.right.deleted||n.right.content.constructor===zn));){if(!n.right.deleted)switch(n.right.content.constructor){case zn:{const{key:u,value:d}=n.right.content,h=i[u];if(h!==void 0){if(Ra(h,d))l.delete(u);else{if(r===0)break e;l.set(u,d)}n.right.delete(t)}else n.currentAttributes.set(u,d);break}default:r<n.right.length&&Br(t,Xe(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let u="";for(;r>0;r--)u+=`
317
+ `;n.right=new Gt(Xe(a,Sn(s.store,a)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new Ws(u)),n.right.integrate(t,0),n.forward()}fI(t,e,n,l)},pI=(t,e,n,r,i)=>{let s=e;const a=qr();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===zn){const d=s.content;a.set(d.key,d)}s=s.right}let l=0,u=!1;for(;e!==s;){if(n===e&&(u=!0),!e.deleted){const d=e.content;switch(d.constructor){case zn:{const{key:h,value:g}=d,m=r.get(h)??null;(a.get(h)!==d||m===g)&&(e.delete(t),l++,!u&&(i.get(h)??null)===g&&m!==g&&(m===null?i.delete(h):i.set(h,m))),!u&&!e.deleted&&Ju(i,d);break}}}e=e.right}return l},bue=(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===zn){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},vue=t=>{let e=0;return Yt(t.doc,n=>{let r=t._start,i=t._start,s=qr();const a=mw(s);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case zn:Ju(a,i.content);break;default:e+=pI(n,r,i,s,a),s=mw(a),r=i;break}i=i.right}}),e},xue=t=>{const e=new Set,n=t.doc;for(const[r,i]of t.afterState.entries()){const s=t.beforeState.get(r)||0;i!==s&&F3(t,n.store.clients.get(r),s,i,a=>{!a.deleted&&a.content.constructor===zn&&a.constructor!==Ni&&e.add(a.parent)})}Yt(n,r=>{Mu(t,t.deleteSet,i=>{if(i instanceof Ni||!i.parent._hasFormatting||e.has(i.parent))return;const s=i.parent;i.content.constructor===zn?e.add(s):bue(r,i)});for(const i of e)vue(i)})},U$=(t,e,n)=>{const r=n,i=mw(e.currentAttributes),s=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Js:case Hl:case Ws:n<e.right.length&&Br(t,Xe(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}s&&pI(t,s,e.right,i,e.currentAttributes);const a=(e.left||e.right).parent;return a._searchMarker&&vh(a._searchMarker,e.index,-r+n),e};class Sue extends Vy{constructor(e,n,r){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(i=>{i===null?this.childListChanged=!0:this.keysChanged.add(i)})}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=[];Yt(e,r=>{const i=new Map,s=new Map;let a=this.target._start,l=null;const u={};let d="",h=0,g=0;const m=()=>{if(l!==null){let O=null;switch(l){case"delete":g>0&&(O={delete:g}),g=0;break;case"insert":(typeof d=="object"||d.length>0)&&(O={insert:d},i.size>0&&(O.attributes={},i.forEach((v,x)=>{v!==null&&(O.attributes[x]=v)}))),d="";break;case"retain":h>0&&(O={retain:h},hle(u)||(O.attributes=cle({},u))),h=0;break}O&&n.push(O),l=null}};for(;a!==null;){switch(a.content.constructor){case Js:case Hl:this.adds(a)?this.deletes(a)||(m(),l="insert",d=a.content.getContent()[0],m()):this.deletes(a)?(l!=="delete"&&(m(),l="delete"),g+=1):a.deleted||(l!=="retain"&&(m(),l="retain"),h+=1);break;case Ws:this.adds(a)?this.deletes(a)||(l!=="insert"&&(m(),l="insert"),d+=a.content.str):this.deletes(a)?(l!=="delete"&&(m(),l="delete"),g+=a.length):a.deleted||(l!=="retain"&&(m(),l="retain"),h+=a.length);break;case zn:{const{key:O,value:v}=a.content;if(this.adds(a)){if(!this.deletes(a)){const x=i.get(O)??null;Ra(x,v)?v!==null&&a.delete(r):(l==="retain"&&m(),Ra(v,s.get(O)??null)?delete u[O]:u[O]=v)}}else if(this.deletes(a)){s.set(O,v);const x=i.get(O)??null;Ra(x,v)||(l==="retain"&&m(),u[O]=x)}else if(!a.deleted){s.set(O,v);const x=u[O];x!==void 0&&(Ra(x,v)?x!==null&&a.delete(r):(l==="retain"&&m(),v===null?delete u[O]:u[O]=v))}a.deleted||(l==="insert"&&m(),Ju(i,a.content));break}}a=a.right}for(m();n.length>0;){const O=n[n.length-1];if(O.retain!==void 0&&O.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class Lu extends Gn{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??dr(),this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new Lu}clone(){const e=new Lu;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new Sue(this,e,n);Yy(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??dr();let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===Ws&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?Yt(this.doc,r=>{const i=new Qw(null,this._start,0,new Map);for(let s=0;s<e.length;s++){const a=e[s];if(a.insert!==void 0){const l=!n&&typeof a.insert=="string"&&s===e.length-1&&i.right===null&&a.insert.slice(-1)===`
318
+ `?a.insert.slice(0,-1):a.insert;(typeof l!="string"||l.length>0)&&Xx(r,this,i,l,a.attributes||{})}else a.retain!==void 0?B$(r,this,i,a.retain,a.attributes||{}):a.delete!==void 0&&U$(r,i,a.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){this.doc??dr();const i=[],s=new Map,a=this.doc;let l="",u=this._start;function d(){if(l.length>0){const g={};let m=!1;s.forEach((v,x)=>{m=!0,g[x]=v});const O={insert:l};m&&(O.attributes=g),i.push(O),l=""}}const h=()=>{for(;u!==null;){if(Xc(u,e)||n!==void 0&&Xc(u,n))switch(u.content.constructor){case Ws:{const g=s.get("ychange");e!==void 0&&!Xc(u,e)?(g===void 0||g.user!==u.id.client||g.type!=="removed")&&(d(),s.set("ychange",r?r("removed",u.id):{type:"removed"})):n!==void 0&&!Xc(u,n)?(g===void 0||g.user!==u.id.client||g.type!=="added")&&(d(),s.set("ychange",r?r("added",u.id):{type:"added"})):g!==void 0&&(d(),s.delete("ychange")),l+=u.content.str;break}case Js:case Hl:{d();const g={insert:u.content.getContent()[0]};if(s.size>0){const m={};g.attributes=m,s.forEach((O,v)=>{m[v]=O})}i.push(g);break}case zn:Xc(u,e)&&(d(),Ju(s,u.content));break}u=u.right}d()};return e||n?Yt(a,g=>{e&&Cw(g,e),n&&Cw(g,n),h()},"cleanup"):h(),i}insert(e,n,r){if(n.length<=0)return;const i=this.doc;i!==null?Yt(i,s=>{const a=em(s,this,e,!r);r||(r={},a.currentAttributes.forEach((l,u)=>{r[u]=l})),Xx(s,this,a,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const i=this.doc;i!==null?Yt(i,s=>{const a=em(s,this,e,!r);Xx(s,this,a,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?Yt(r,i=>{U$(i,em(i,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,r){if(n===0)return;const i=this.doc;i!==null?Yt(i,s=>{const a=em(s,this,e,!1);a.right!==null&&B$(s,this,a,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?Yt(this.doc,n=>{$O(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?Yt(this.doc,r=>{tC(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return nC(this,e)}getAttributes(){return cI(this)}_write(e){e.writeTypeRef(Xue)}}const wue=t=>new Lu;class Bx{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??dr()}[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===zu||n.constructor===Ul)&&n._start!==null)e=n._start;else for(;e!==null;){const r=e.next;if(r!==null){e=r;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 Ul extends Gn{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 Ul}clone(){const e=new Ul;return e.insert(0,this.toArray().map(n=>n instanceof Gn?n.clone():n)),e}get length(){return this.doc??dr(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Bx(this,e)}querySelector(e){e=e.toUpperCase();const r=new Bx(this,i=>i.nodeName&&i.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),Io(new Bx(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){Yy(this,e,new Tue(this,n,e))}toString(){return iI(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},r){const i=e.createDocumentFragment();return r!==void 0&&r._createAssociation(i,this),xh(this,s=>{i.insertBefore(s.toDOM(e,n,r),null)}),i}insert(e,n){this.doc!==null?Yt(this.doc,r=>{aI(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)Yt(this.doc,r=>{const i=e&&e instanceof Gn?e._item:e;_O(r,this,i,n)});else{const r=this._prelimContent,i=e===null?0:r.findIndex(s=>s===e)+1;if(i===0&&e!==null)throw Ys("Reference item not found");r.splice(i,0,...n)}}delete(e,n=1){this.doc!==null?Yt(this.doc,r=>{lI(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return rI(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return sI(this,e)}slice(e=0,n=this.length){return nI(this,e,n)}forEach(e){xh(this,e)}_write(e){e.writeTypeRef(Uue)}}const kue=t=>new Ul;class zu extends Ul{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((r,i)=>{this.setAttribute(i,r)}),this._prelimAttrs=null}_copy(){return new zu(this.nodeName)}clone(){const e=new zu(this.nodeName),n=this.getAttributes();return fle(n,(r,i)=>{e.setAttribute(i,r)}),e.insert(0,this.toArray().map(r=>r instanceof Gn?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const l in e)r.push(l);r.sort();const i=r.length;for(let l=0;l<i;l++){const u=r[l];n.push(u+'="'+e[u]+'"')}const s=this.nodeName.toLocaleLowerCase(),a=n.length>0?" "+n.join(" "):"";return`<${s}${a}>${super.toString()}</${s}>`}removeAttribute(e){this.doc!==null?Yt(this.doc,n=>{$O(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?Yt(this.doc,r=>{tC(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return nC(this,e)}hasAttribute(e){return uI(this,e)}getAttributes(e){return e?pue(this,e):cI(this)}toDOM(e=document,n={},r){const i=e.createElement(this.nodeName),s=this.getAttributes();for(const a in s){const l=s[a];typeof l=="string"&&i.setAttribute(a,l)}return xh(this,a=>{i.appendChild(a.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(Bue),e.writeKey(this.nodeName)}}const Cue=t=>new zu(t.readKey());class Tue extends Vy{constructor(e,n,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(i=>{i===null?this.childListChanged=!0:this.attributesChanged.add(i)})}}class MO extends Nu{constructor(e){super(),this.hookName=e}_copy(){return new MO(this.hookName)}clone(){const e=new MO(this.hookName);return this.forEach((n,r)=>{e.set(r,n)}),e}toDOM(e=document,n={},r){const i=n[this.hookName];let s;return i!==void 0?s=i.createDom(this):s=document.createElement(this.hookName),s.setAttribute("data-yjs-hook",this.hookName),r!==void 0&&r._createAssociation(s,this),s}_write(e){e.writeTypeRef(Vue),e.writeKey(this.hookName)}}const Que=t=>new MO(t.readKey());class DO extends Lu{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 DO}clone(){const e=new DO;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,r){const i=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const n=[];for(const i in e.attributes){const s=[];for(const a in e.attributes[i])s.push({key:a,value:e.attributes[i][a]});s.sort((a,l)=>a.key<l.key?-1:1),n.push({nodeName:i,attrs:s})}n.sort((i,s)=>i.nodeName<s.nodeName?-1:1);let r="";for(let i=0;i<n.length;i++){const s=n[i];r+=`<${s.nodeName}`;for(let a=0;a<s.attrs.length;a++){const l=s.attrs[a];r+=` ${l.key}="${l.value}"`}r+=">"}r+=e.insert;for(let i=n.length-1;i>=0;i--)r+=`</${n[i].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(que)}}const Eue=t=>new DO;class rC{constructor(e,n){this.id=e,this.length=n}get deleted(){throw as()}mergeWith(e){return!1}write(e,n,r){throw as()}integrate(e,n){throw as()}}const Rue=0;class Ni extends rC{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),W3(e.doc.store,this)}write(e,n){e.writeInfo(Rue),e.writeLen(this.length-n)}getMissing(e,n){return null}}class Kh{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Kh(this.content)}splice(e){throw as()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}const Aue=t=>new Kh(t.readBuf());class Sh{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Sh(this.len)}splice(e){const n=new Sh(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){yh(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 Pue=t=>new Sh(t.readLen()),gI=(t,e)=>new Fl({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class Jh{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 Jh(gI(this.doc.guid,this.opts))}splice(e){throw as()}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 _ue=t=>new Jh(gI(t.readString(),t.readAny()));class Hl{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Hl(this.embed)}splice(e){throw as()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}const $ue=t=>new Hl(t.readJSON());class zn{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new zn(this.key,this.value)}splice(e){throw as()}mergeWith(e){return!1}integrate(e,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const Mue=t=>new zn(t.readKey(),t.readJSON());class NO{constructor(e){this.arr=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 r=this.arr.length;e.writeLen(r-n);for(let i=n;i<r;i++){const s=this.arr[i];e.writeString(s===void 0?"undefined":JSON.stringify(s))}}getRef(){return 2}}const Due=t=>{const e=t.readLen(),n=[];for(let r=0;r<e;r++){const i=t.readString();i==="undefined"?n.push(void 0):n.push(JSON.parse(i))}return new NO(n)},Nue=TO("node_env")==="development";class Vl{constructor(e){this.arr=e,Nue&&l3(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Vl(this.arr)}splice(e){const n=new Vl(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 r=this.arr.length;e.writeLen(r-n);for(let i=n;i<r;i++){const s=this.arr[i];e.writeAny(s)}}getRef(){return 8}}const Lue=t=>{const e=t.readLen(),n=[];for(let r=0;r<e;r++)n.push(t.readAny());return new Vl(n)};class Ws{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new Ws(this.str)}splice(e){const n=new Ws(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=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 zue=t=>new Ws(t.readString()),jue=[mue,yue,wue,Cue,kue,Que,Eue],Iue=0,Zue=1,Xue=2,Bue=3,Uue=4,Vue=5,que=6;class Js{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Js(this.type._copy())}splice(e){throw as()}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(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.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(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const Yue=t=>new Js(jue[t.readTypeRef()](t)),Ew=(t,e)=>{let n=e,r=0,i;do r>0&&(n=Xe(n.client,n.clock+r)),i=fu(t,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof Gt);return{item:i,diff:r}},iC=(t,e)=>{for(;t!==null&&t.keep!==e;)t.keep=e,t=t.parent._item},LO=(t,e,n)=>{const{client:r,clock:i}=e.id,s=new Gt(Xe(r,i+n),e,Xe(r,i+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=Xe(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},V$=(t,e)=>_k(t,n=>Fh(n.deletions,e)),mI=(t,e,n,r,i,s)=>{const a=t.doc,l=a.store,u=a.clientID,d=e.redone;if(d!==null)return Br(t,d);let h=e.parent._item,g=null,m;if(h!==null&&h.deleted===!0){if(h.redone===null&&(!n.has(h)||mI(t,h,n,r,i,s)===null))return null;for(;h.redone!==null;)h=Br(t,h.redone)}const O=h===null?e.parent:h.content.type;if(e.parentSub===null){for(g=e.left,m=e;g!==null;){let C=g;for(;C!==null&&C.parent._item!==h;)C=C.redone===null?null:Br(t,C.redone);if(C!==null&&C.parent._item===h){g=C;break}g=g.left}for(;m!==null;){let C=m;for(;C!==null&&C.parent._item!==h;)C=C.redone===null?null:Br(t,C.redone);if(C!==null&&C.parent._item===h){m=C;break}m=m.right}}else if(m=null,e.right&&!i){for(g=e;g!==null&&g.right!==null&&(g.right.redone||Fh(r,g.right.id)||V$(s.undoStack,g.right.id)||V$(s.redoStack,g.right.id));)for(g=g.right;g.redone;)g=Br(t,g.redone);if(g&&g.right!==null)return null}else g=O._map.get(e.parentSub)||null;const v=Sn(l,u),x=Xe(u,v),k=new Gt(x,g,g&&g.lastId,m,m&&m.id,O,e.parentSub,e.content.copy());return e.redone=x,iC(k,!0),k.integrate(t,0),k};class Gt extends rC{constructor(e,n,r,i,s,a,l,u){super(e,u.getLength()),this.origin=r,this.left=n,this.right=i,this.rightOrigin=s,this.parent=a,this.parentSub=l,this.redone=null,this.content=u,this.info=this.content.isCountable()?y$:0}set marker(e){(this.info&Dx)>0!==e&&(this.info^=Dx)}get marker(){return(this.info&Dx)>0}get keep(){return(this.info&O$)>0}set keep(e){this.keep!==e&&(this.info^=O$)}get countable(){return(this.info&y$)>0}get deleted(){return(this.info&Mx)>0}set deleted(e){this.deleted!==e&&(this.info^=Mx)}markDeleted(){this.info|=Mx}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Sn(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Sn(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===uu&&this.id.client!==this.parent.client&&this.parent.clock>=Sn(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=N$(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Br(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Ni||this.right&&this.right.constructor===Ni)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===Gt?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===Gt&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===uu){const r=fu(n,this.parent);r.constructor===Ni?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=N$(e,e.doc.store,Xe(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 r=this.left,i;if(r!==null)i=r.right;else 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;const s=new Set,a=new Set;for(;i!==null&&i!==this.right;){if(a.add(i),s.add(i),Wc(this.origin,i.origin)){if(i.id.client<this.id.client)r=i,s.clear();else if(Wc(this.rightOrigin,i.rightOrigin))break}else if(i.origin!==null&&a.has(fu(e.doc.store,i.origin)))s.has(fu(e.doc.store,i.origin))||(r=i,s.clear());else break;i=i.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;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,this.parent._start=this;this.right=r}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),W3(e.doc.store,this),this.content.integrate(e,this),z$(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new Ni(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:Xe(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Wc(e.origin,this.lastId)&&this.right===e&&Wc(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(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.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(),yh(e.deleteSet,this.id.client,this.id.clock,this.length),z$(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw mi();this.content.gc(e),n?Hce(e,this,new Ni(this.id,this.length)):this.content=new Sh(this.length)}write(e,n){const r=n>0?Xe(this.id.client,this.id.clock+n-1):this.origin,i=this.rightOrigin,s=this.parentSub,a=this.content.getRef()&Ny|(r===null?0:gi)|(i===null?0:_o)|(s===null?0:dh);if(e.writeInfo(a),r!==null&&e.writeLeftID(r),i!==null&&e.writeRightID(i),r===null&&i===null){const l=this.parent;if(l._item!==void 0){const u=l._item;if(u===null){const d=q3(l);e.writeParentInfo(!0),e.writeString(d)}else e.writeParentInfo(!1),e.writeLeftID(u.id)}else l.constructor===String?(e.writeParentInfo(!0),e.writeString(l)):l.constructor===uu?(e.writeParentInfo(!1),e.writeLeftID(l)):mi();s!==null&&e.writeString(s)}this.content.write(e,n)}}const OI=(t,e)=>Gue[e&Ny](t),Gue=[()=>{mi()},Pue,Due,Aue,zue,$ue,Mue,Yue,Lue,_ue,()=>{mi()}],Wue=10;class Li extends rC{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){mi()}write(e,n){e.writeInfo(Wue),_e(e.restEncoder,this.length-n)}getMissing(e,n){return null}}const yI=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},bI="__ $YJS$ __";yI[bI]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");yI[bI]=!0;const vI=new Map;class Fue{constructor(e){this.room=e,this.onmessage=null,this._onChange=n=>n.key===e&&this.onmessage!==null&&this.onmessage({data:Rle(n.newValue||"")}),ole(this._onChange)}postMessage(e){o3.setItem(this.room,Ele(wle(e)))}close(){ale(this._onChange)}}const Hue=typeof BroadcastChannel>"u"?Fue:BroadcastChannel,sC=t=>Hs(vI,t,()=>{const e=Xa(),n=new Hue(t);return n.onmessage=r=>e.forEach(i=>i(r.data,"broadcastchannel")),{bc:n,subs:e}}),Kue=(t,e)=>(sC(t).subs.add(e),e),Jue=(t,e)=>{const n=sC(t),r=n.subs.delete(e);return r&&n.subs.size===0&&(n.bc.close(),vI.delete(t)),r},Bc=(t,e,n=null)=>{const r=sC(t);r.bc.postMessage(e),r.subs.forEach(i=>i(e,n))},xI=0,oC=1,SI=2,Rw=(t,e)=>{_e(t,xI);const n=Vce(e);bn(t,n)},wI=(t,e,n)=>{_e(t,oC),bn(t,Zce(e,n))},efe=(t,e,n)=>wI(e,n,lr(t)),kI=(t,e,n,r)=>{try{zce(e,lr(t),n)}catch(i){r!=null&&r(i),console.error("Caught error while handling a Yjs update",i)}},tfe=(t,e)=>{_e(t,SI),bn(t,e)},nfe=kI,rfe=(t,e,n,r,i)=>{const s=Ie(t);switch(s){case xI:efe(t,e,n);break;case oC:kI(t,n,r,i);break;case SI:nfe(t,n,r,i);break;default:throw new Error("Unknown message type")}return s},ife=0,sfe=(t,e,n)=>{switch(Ie(t)){case ife:n(e,$a(t))}},Ux=3e4;class ofe extends Tae{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const n=Ba();this.getLocalState()!==null&&Ux/2<=n-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const r=[];this.meta.forEach((i,s)=>{s!==this.clientID&&Ux<=n-i.lastUpdated&&this.states.has(s)&&r.push(s)}),r.length>0&&aC(this,r,"timeout")},hs(Ux/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,r=this.meta.get(n),i=r===void 0?0:r.clock+1,s=this.states.get(n);e===null?this.states.delete(n):this.states.set(n,e),this.meta.set(n,{clock:i,lastUpdated:Ba()});const a=[],l=[],u=[],d=[];e===null?d.push(n):s==null?e!=null&&a.push(n):(l.push(n),lu(s,e)||u.push(n)),(a.length>0||u.length>0||d.length>0)&&this.emit("change",[{added:a,updated:u,removed:d},"local"]),this.emit("update",[{added:a,updated:l,removed:d},"local"])}setLocalStateField(e,n){const r=this.getLocalState();r!==null&&this.setLocalState({...r,[e]:n})}getStates(){return this.states}}const aC=(t,e,n)=>{const r=[];for(let i=0;i<e.length;i++){const s=e[i];if(t.states.has(s)){if(t.states.delete(s),s===t.clientID){const a=t.meta.get(s);t.meta.set(s,{clock:a.clock+1,lastUpdated:Ba()})}r.push(s)}}r.length>0&&(t.emit("change",[{added:[],updated:[],removed:r},n]),t.emit("update",[{added:[],updated:[],removed:r},n]))},Id=(t,e,n=t.states)=>{const r=e.length,i=cr();_e(i,r);for(let s=0;s<r;s++){const a=e[s],l=n.get(a)||null,u=t.meta.get(a).clock;_e(i,a),_e(i,u),Al(i,JSON.stringify(l))}return ln(i)},afe=(t,e,n)=>{const r=Wa(e),i=Ba(),s=[],a=[],l=[],u=[],d=Ie(r);for(let h=0;h<d;h++){const g=Ie(r);let m=Ie(r);const O=JSON.parse($a(r)),v=t.meta.get(g),x=t.states.get(g),k=v===void 0?0:v.clock;(k<m||k===m&&O===null&&t.states.has(g))&&(O===null?g===t.clientID&&t.getLocalState()!=null?m++:t.states.delete(g):t.states.set(g,O),t.meta.set(g,{clock:m,lastUpdated:i}),v===void 0&&O!==null?s.push(g):v!==void 0&&O===null?u.push(g):O!==null&&(lu(O,x)||l.push(g),a.push(g)))}(s.length>0||l.length>0||u.length>0)&&t.emit("change",[{added:s,updated:l,removed:u},n]),(s.length>0||a.length>0||u.length>0)&&t.emit("update",[{added:s,updated:a,removed:u},n])},lfe=t=>dle(t,(e,n)=>`${encodeURIComponent(n)}=${encodeURIComponent(e)}`).join("&"),Tl=0,CI=3,hu=1,cfe=2,ep=[];ep[Tl]=(t,e,n,r,i)=>{_e(t,Tl);const s=rfe(e,t,n.doc,n);r&&s===oC&&!n.synced&&(n.synced=!0)};ep[CI]=(t,e,n,r,i)=>{_e(t,hu),bn(t,Id(n.awareness,Array.from(n.awareness.getStates().keys())))};ep[hu]=(t,e,n,r,i)=>{afe(n.awareness,lr(e),n)};ep[cfe]=(t,e,n,r,i)=>{sfe(e,n.doc,(s,a)=>ufe(n,a))};const q$=3e4,ufe=(t,e)=>console.warn(`Permission denied to access ${t.url}.
319
+ ${e}`),TI=(t,e,n)=>{const r=Wa(e),i=cr(),s=Ie(r),a=t.messageHandlers[s];return a?a(i,r,t,n,s):console.error("Unable to compute message"),i},Aw=(t,e,n)=>{e===t.ws&&(t.emit("connection-close",[n,t]),t.ws=null,e.close(),t.wsconnecting=!1,t.wsconnected?(t.wsconnected=!1,t.synced=!1,aC(t.awareness,Array.from(t.awareness.getStates().keys()).filter(r=>r!==t.doc.clientID),t),t.emit("status",[{status:"disconnected"}])):t.wsUnsuccessfulReconnects++,setTimeout(QI,Dy(Qae(2,t.wsUnsuccessfulReconnects)*100,t.maxBackoffTime),t))},QI=t=>{if(t.shouldConnect&&t.ws===null){const e=new t._WS(t.url,t.protocols);e.binaryType="arraybuffer",t.ws=e,t.wsconnecting=!0,t.wsconnected=!1,t.synced=!1,e.onmessage=n=>{t.wsLastMessageReceived=Ba();const r=TI(t,new Uint8Array(n.data),!0);Mk(r)>1&&e.send(ln(r))},e.onerror=n=>{t.emit("connection-error",[n,t])},e.onclose=n=>{Aw(t,e,n)},e.onopen=()=>{t.wsLastMessageReceived=Ba(),t.wsconnecting=!1,t.wsconnected=!0,t.wsUnsuccessfulReconnects=0,t.emit("status",[{status:"connected"}]);const n=cr();if(_e(n,Tl),Rw(n,t.doc),e.send(ln(n)),t.awareness.getLocalState()!==null){const r=cr();_e(r,hu),bn(r,Id(t.awareness,[t.doc.clientID])),e.send(ln(r))}},t.emit("status",[{status:"connecting"}])}},Vx=(t,e)=>{const n=t.ws;t.wsconnected&&n&&n.readyState===n.OPEN&&n.send(e),t.bcconnected&&Bc(t.bcChannel,e,t)};class ffe extends $k{constructor(e,n,r,{connect:i=!0,awareness:s=new ofe(r),params:a={},protocols:l=[],WebSocketPolyfill:u=WebSocket,resyncInterval:d=-1,maxBackoffTime:h=2500,disableBc:g=!1}={}){for(super();e[e.length-1]==="/";)e=e.slice(0,e.length-1);this.serverUrl=e,this.bcChannel=e+"/"+n,this.maxBackoffTime=h,this.params=a,this.protocols=l,this.roomname=n,this.doc=r,this._WS=u,this.awareness=s,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=g,this.wsUnsuccessfulReconnects=0,this.messageHandlers=ep.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=i,this._resyncInterval=0,d>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){const m=cr();_e(m,Tl),Rw(m,r),this.ws.send(ln(m))}},d)),this._bcSubscriber=(m,O)=>{if(O!==this){const v=TI(this,new Uint8Array(m),!1);Mk(v)>1&&Bc(this.bcChannel,ln(v),this)}},this._updateHandler=(m,O)=>{if(O!==this){const v=cr();_e(v,Tl),tfe(v,m),Vx(this,ln(v))}},this.doc.on("update",this._updateHandler),this._awarenessUpdateHandler=({added:m,updated:O,removed:v},x)=>{const k=m.concat(O).concat(v),C=cr();_e(C,hu),bn(C,Id(s,k)),Vx(this,ln(C))},this._exitHandler=()=>{aC(this.awareness,[r.clientID],"app closed")},Ua&&typeof process<"u"&&process.on("exit",this._exitHandler),s.on("update",this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&q$<Ba()-this.wsLastMessageReceived&&Aw(this,this.ws,null)},q$/10),i&&this.connect()}get url(){const e=lfe(this.params);return this.serverUrl+"/"+this.roomname+(e.length===0?"":"?"+e)}get synced(){return this._synced}set synced(e){this._synced!==e&&(this._synced=e,this.emit("synced",[e]),this.emit("sync",[e]))}destroy(){this._resyncInterval!==0&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),Ua&&typeof process<"u"&&process.off("exit",this._exitHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.doc.off("update",this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;this.bcconnected||(Kue(this.bcChannel,this._bcSubscriber),this.bcconnected=!0);const e=cr();_e(e,Tl),Rw(e,this.doc),Bc(this.bcChannel,ln(e),this);const n=cr();_e(n,Tl),wI(n,this.doc),Bc(this.bcChannel,ln(n),this);const r=cr();_e(r,CI),Bc(this.bcChannel,ln(r),this);const i=cr();_e(i,hu),bn(i,Id(this.awareness,[this.doc.clientID])),Bc(this.bcChannel,ln(i),this)}disconnectBc(){const e=cr();_e(e,hu),bn(e,Id(this.awareness,[this.doc.clientID],new Map)),Vx(this,ln(e)),this.bcconnected&&(Jue(this.bcChannel,this._bcSubscriber),this.bcconnected=!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),this.ws!==null&&Aw(this,this.ws,null)}connect(){this.shouldConnect=!0,!this.wsconnected&&this.ws===null&&(QI(this),this.connectBc())}}class lC{constructor(e,n){this.yanchor=e,this.yhead=n}toJSON(){return{yanchor:M$(this.yanchor),yhead:M$(this.yhead)}}static fromJSON(e){return new lC(bh(e.yanchor),bh(e.yhead))}}class dfe{constructor(e,n){this.ytext=e,this.awareness=n,this.undoManager=new K3(e)}toYPos(e,n=0){return ww(this.ytext,e,n)}fromYPos(e){const n=kw(bh(e),this.ytext.doc);if(n==null||n.type!==this.ytext)throw new Error("[y-codemirror] The position you want to retrieve was created by a different document");return{pos:n.index,assoc:n.assoc}}toYRange(e){const n=e.assoc,r=this.toYPos(e.anchor,n),i=this.toYPos(e.head,n);return new lC(r,i)}fromYRange(e){const n=this.fromYPos(e.yanchor),r=this.fromYPos(e.yhead);return n.pos===r.pos?le.cursor(r.pos,r.assoc):le.range(n.pos,r.pos)}}const Gy=Re.define({combine(t){return t[t.length-1]}}),Pw=Xo.define();class hfe{constructor(e){this.view=e,this.conf=e.state.facet(Gy),this._observer=(n,r)=>{if(r.origin!==this.conf){const i=n.delta,s=[];let a=0;for(let l=0;l<i.length;l++){const u=i[l];u.insert!=null?s.push({from:a,to:a,insert:u.insert}):u.delete!=null?(s.push({from:a,to:a+u.delete,insert:""}),a+=u.delete):a+=u.retain}e.dispatch({changes:s,annotations:[Pw.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(Pw)===this.conf)return;const n=this.conf.ytext;n.doc.transact(()=>{let r=0;e.changes.iterChanges((i,s,a,l,u)=>{const d=u.sliceString(0,u.length,`
320
+ `);i!==s&&n.delete(i+r,s-i),d.length>0&&n.insert(i+r,d),r+=d.length-(s-i)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}}const pfe=Vi.fromClass(hfe),gfe=Me.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:"0px 2px 0px 4px"},".cm-ySelectionCaret":{position:"relative",borderLeft:"1px solid black",borderRight:"1px solid black",marginLeft:"-1px",marginRight:"-1px",boxSizing:"border-box",display:"inline"},".cm-ySelectionCaretDot":{borderRadius:"50%",position:"absolute",width:".4em",height:".4em",top:"-.2em",left:"-.2em",backgroundColor:"inherit",transition:"transform .3s ease-in-out",boxSizing:"border-box"},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:"bottom center",transform:"scale(0)"},".cm-ySelectionInfo":{position:"absolute",top:"-1.05em",left:"-1px",fontSize:".75em",fontFamily:"serif",fontStyle:"normal",fontWeight:"normal",lineHeight:"normal",userSelect:"none",color:"white",paddingLeft:"2px",paddingRight:"2px",zIndex:101,transition:"opacity .3s ease-in-out",backgroundColor:"inherit",opacity:0,transitionDelay:"0s",whiteSpace:"nowrap"},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:"0s"}}),mfe=Xo.define();class Ofe extends qu{constructor(e,n){super(),this.color=e,this.name=n}toDOM(){return Ix("span",[oi("class","cm-ySelectionCaret"),oi("style",`background-color: ${this.color}; border-color: ${this.color}`)],[Hg("⁠"),Ix("div",[oi("class","cm-ySelectionCaretDot")]),Hg("⁠"),Ix("div",[oi("class","cm-ySelectionInfo")],[Hg(this.name)]),Hg("⁠")])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}}class yfe{constructor(e){this.conf=e.state.facet(Gy),this._listener=({added:n,updated:r,removed:i},s,a)=>{n.concat(r).concat(i).findIndex(u=>u!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[mfe.of([])]})},this._awareness=this.conf.awareness,this._awareness.on("change",this._listener),this.decorations=at.of([])}destroy(){this._awareness.off("change",this._listener)}update(e){const n=this.conf.ytext,r=n.doc,i=this.conf.awareness,s=[],a=this.conf.awareness.getLocalState();if(a!=null){const l=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),u=l?e.state.selection.main:null,d=a.cursor==null?null:bh(a.cursor.anchor),h=a.cursor==null?null:bh(a.cursor.head);if(u!=null){const g=ww(n,u.anchor),m=ww(n,u.head);(a.cursor==null||!D$(d,g)||!D$(h,m))&&i.setLocalStateField("cursor",{anchor:g,head:m})}else a.cursor!=null&&l&&i.setLocalStateField("cursor",null)}i.getStates().forEach((l,u)=>{if(u===i.doc.clientID)return;const d=l.cursor;if(d==null||d.anchor==null||d.head==null)return;const h=kw(d.anchor,r),g=kw(d.head,r);if(h==null||g==null||h.type!==n||g.type!==n)return;const{color:m="#30bced",name:O="Anonymous"}=l.user||{},v=l.user&&l.user.colorLight||m+"33",x=Dy(h.index,g.index),k=Ga(h.index,g.index),C=e.view.state.doc.lineAt(x),Q=e.view.state.doc.lineAt(k);if(C.number===Q.number)s.push({from:x,to:k,value:At.mark({attributes:{style:`background-color: ${v}`},class:"cm-ySelection"})});else{s.push({from:x,to:C.from+C.length,value:At.mark({attributes:{style:`background-color: ${v}`},class:"cm-ySelection"})}),s.push({from:Q.from,to:k,value:At.mark({attributes:{style:`background-color: ${v}`},class:"cm-ySelection"})});for(let R=C.number+1;R<Q.number;R++){const E=e.view.state.doc.line(R).from;s.push({from:E,to:E,value:At.line({attributes:{style:`background-color: ${v}`,class:"cm-yLineSelection"}})})}}s.push({from:g.index,to:g.index,value:At.widget({side:g.index-h.index>0?-1:1,block:!1,widget:new Ofe(m,O)})})}),this.decorations=At.set(s,!0)}}const bfe=Vi.fromClass(yfe,{decorations:t=>t.decorations}),vfe=()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else n!==void 0&&n()}};class xfe{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}}const Wy=Re.define({combine(t){return t[t.length-1]}});class Sfe{constructor(e){this.view=e,this.conf=e.state.facet(Wy),this._undoManager=this.conf.undoManager,this.syncConf=e.state.facet(Gy),this._beforeChangeSelection=null,this._mux=vfe(),this._onStackItemAdded=({stackItem:n,changedParentTypes:r})=>{r.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!n.meta.has(this)&&n.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:n})=>{const r=n.meta.get(this);if(r){const i=this.syncConf.fromYRange(r);e.dispatch(e.state.update({selection:i,effects:[Me.scrollIntoView(i)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on("stack-item-added",this._onStackItemAdded),this._undoManager.on("stack-item-popped",this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(Pw)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off("stack-item-added",this._onStackItemAdded),this._undoManager.off("stack-item-popped",this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}}const wfe=Vi.fromClass(Sfe),kfe=({state:t,dispatch:e})=>t.facet(Wy).undo()||!0,Cfe=({state:t,dispatch:e})=>t.facet(Wy).redo()||!0,Tfe=(t,e,{undoManager:n=new K3(t)}={})=>{const r=new dfe(t,e),i=[Gy.of(r),pfe];return e&&i.push(gfe,bfe),n!==!1&&i.push(Wy.of(new xfe(n)),wfe,Me.domEventHandlers({beforeinput(s,a){return s.inputType==="historyUndo"?kfe(a):s.inputType==="historyRedo"?Cfe(a):!1}})),i},Qfe=UO("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function cC({className:t,variant:e,...n}){return S.jsx("div",{"data-slot":"alert",role:"alert",className:Ne(Qfe({variant:e}),t),...n})}function uC({className:t,...e}){return S.jsx("div",{"data-slot":"alert-title",className:Ne("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...e})}function fC({className:t,...e}){return S.jsx("div",{"data-slot":"alert-description",className:Ne("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...e})}const Efe={connected:S.jsx(jY,{className:"h-3.5 w-3.5"}),connecting:S.jsx(u2,{className:"h-3.5 w-3.5 animate-spin"}),disconnected:S.jsx(LY,{className:"h-3.5 w-3.5"})},Y$=["#7C3AED","#2563EB","#059669","#EA580C","#DB2777"];class Rfe extends jo{constructor(e,n){super(),this.label=e,this.tooltip=n}toDOM(){const e=document.createElement("div");return e.className="cm-blame-marker text-[13px] text-muted-foreground",e.textContent=this.label,e.style.maxWidth="140px",e.style.whiteSpace="nowrap",e.style.overflow="hidden",e.style.textOverflow="ellipsis",this.tooltip&&(e.title=this.tooltip),e}}const Afe=t=>{let e=0;for(let n=0;n<t.length;n+=1)e=(e<<5)-e+t.charCodeAt(n),e|=0;return Math.abs(e)},Pfe=(t,e)=>{var n,r;return((n=t==null?void 0:t.user)==null?void 0:n.name)??((r=t==null?void 0:t.user)==null?void 0:r.email)??`Guest ${e.slice(-4)}`},G$=(t,e,n)=>{if(!t||!(e!=null&&e.user))return;const r=e.user.id??e.user.email??"anonymous";t.awareness.setLocalStateField("user",{id:r,name:Pfe(e,r),color:n})};function _fe({workspaceId:t,workspaceSlug:e,noteId:n,notePublicId:r,title:i,name:s,initialContent:a,initialUpdatedAt:l,initialBlame:u}){var Nt,mn;const d=or(),h=w.useRef(null),g=w.useRef(null),m=w.useRef(null),O=w.useRef(null),v=w.useRef(null),x=w.useRef(null),k=w.useRef(new zh),C=w.useRef(a),Q=w.useRef(null),R=w.useRef(null),E=w.useRef(!1),P=w.useRef(null),$=w.useRef(null),_=`note-editor-${e}-${r}`,D=w.useRef(0),B=w.useRef(0),L=w.useRef(null),{data:M,isLoading:U}=Ur(Ch),Y=hG(),H=!1,{data:ee,isLoading:N,error:V}=Ur({...KA(e,r),enabled:!!e&&!!r&&!U&&!!(M!=null&&M.user)}),[Z,W]=w.useState("connecting"),[fe,se]=w.useState(null),[ge,oe]=w.useState(!1),he=XO({from:"/_authed/workspaces/$workspaceSlug/notes/$noteId/"}),me=ae=>ae==="code"||ae==="preview"||ae==="split",[Ce,Te]=w.useState(()=>me(he.view)?he.view:"split"),[Ye,je]=w.useState(a),[ze,Ct]=w.useState(()=>l?new Date(l):null),[Fe,Tt]=w.useState("saved"),[lt,ut]=w.useState(!1),[Qt,on]=w.useState([]),[Ht,Ge]=w.useState(u),[It,jn]=w.useState(!1);w.useEffect(()=>{Te(me(he.view)?he.view:"split")},[he.view,me]);const He=w.useCallback(ae=>Math.min(1,Math.max(0,ae)),[]),Gr=w.useCallback(ae=>{const ve=ae.scrollHeight-ae.clientHeight;return ve>0?He(ae.scrollTop/ve):0},[He]),Zt=w.useCallback((ae,ve)=>{const Ve=ae.scrollHeight-ae.clientHeight;Ve<=0||(ae.scrollTop=He(ve)*Ve)},[He]),In=w.useCallback(ae=>{const ve=ae.scrollDOM,Ve=ve.scrollHeight-ve.clientHeight;return Ve>0?He(ve.scrollTop/Ve):0},[He]),Be=w.useCallback((ae,ve)=>{const Ve=ae.scrollDOM,re=Ve.scrollHeight-Ve.clientHeight;re<=0||(Ve.scrollTop=He(ve)*re)},[He]),Ue=w.useCallback(ae=>{d({to:"/workspaces/$workspaceSlug/notes/$noteId",params:{workspaceSlug:e,noteId:r},search:ve=>({labels:typeof ve.labels=="string"?ve.labels:void 0,view:ae})})},[d,e,r]),gt=w.useMemo(()=>he.labels==="name"?"name":"display",[he.labels]),Fn=w.useMemo(()=>gt==="name"?`${s}.md`:i,[gt,s,i]),gr=w.useMemo(()=>{var ve,Ve;const ae=((ve=M==null?void 0:M.user)==null?void 0:ve.id)??((Ve=M==null?void 0:M.user)==null?void 0:Ve.email)??"anonymous";return Y$[Afe(ae)%Y$.length]},[(Nt=M==null?void 0:M.user)==null?void 0:Nt.email,(mn=M==null?void 0:M.user)==null?void 0:mn.id]),gn=w.useCallback(()=>{const ae=O.current;if(!ae)return;const Ve=Array.from(ae.awareness.getStates().entries()).map(([ue,Oe])=>{const Ae=Oe.user;if(!Ae)return null;const vt=Ae.id??`client-${ue}`,cn=`Guest ${String(vt).slice(-4)}`;return{id:vt,name:Ae.name??cn,color:Ae.color??"#94a3b8"}}).filter(ue=>!!ue),re=new Map;Ve.forEach(ue=>{re.has(ue.id)||re.set(ue.id,ue)}),on(Array.from(re.values()))},[]),Wr=w.useMemo(()=>typeof window>"u"?null:_L(window),[]),Hn=w.useCallback(ae=>Pt.parse(ae,{breaks:!0}),[]),tn=w.useMemo(()=>{const ae=Hn(Ye);return Wr?Wr.sanitize(ae):ae},[Ye,Wr,Hn]),Dt=w.useMemo(()=>new Map(Ht.map(ae=>[ae.lineNumber,ae])),[Ht]),Xt=ae=>ae?ae.authorName??ae.authorEmail??ae.authorUserId:"Unknown",bi=3,_r=w.useMemo(()=>Qt.slice(0,bi),[Qt]),eo=w.useMemo(()=>Qt.slice(bi),[Qt]),ar=Qt.length-_r.length,mr=eo.map(ae=>ae.name).join(", "),Bt=ae=>{const ve=ae.trim().split(/\s+/);return ve.length===0?"":ve.length===1?ve[0].charAt(0).toUpperCase():(ve[0].charAt(0)+ve[ve.length-1].charAt(0)).toUpperCase()};w.useEffect(()=>{G$(O.current,M??null,gr),gn()},[gr,M,gn]),w.useEffect(()=>{je(a)},[a]),w.useEffect(()=>{C.current=Ye},[Ye]),w.useEffect(()=>{Ge(u)},[u]),w.useEffect(()=>{Ct(l?new Date(l):null),ut(!1),Tt("saved")},[l]),w.useEffect(()=>{E.current=lt},[lt]),w.useEffect(()=>{var ae;Ce!=="preview"&&((ae=g.current)==null||ae.requestMeasure())},[Ce]),w.useEffect(()=>{if(Ce!=="split"||!ge)return;const ae=g.current,ve=m.current;if(!ae||!ve)return;const Ve={current:!1},re=()=>{Ve.current||$.current==="preview"||(Ve.current=!0,$.current="editor",D.current=In(ae),Zt(ve,D.current),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{Ve.current=!1,$.current=null},50))},ue=()=>{Ve.current||$.current==="editor"||(Ve.current=!0,$.current="preview",B.current=Gr(ve),Be(ae,B.current),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{Ve.current=!1,$.current=null},50))};return ae.scrollDOM.addEventListener("scroll",re,{passive:!0}),ve.addEventListener("scroll",ue,{passive:!0}),()=>{L.current&&clearTimeout(L.current),ae.scrollDOM.removeEventListener("scroll",re),ve.removeEventListener("scroll",ue)}},[Zt,In,Gr,Be,Ce,ge]),w.useEffect(()=>{if(U||!(M!=null&&M.user))return;let ae=!0;const ve=new AbortController;(async()=>{W("connecting"),se(null),oe(!1);try{if(N)return;if(V)throw new Error(V instanceof Error?V.message:"Failed to fetch collab token");if(!ee)throw new Error("Collab token not available");const{token:ue}=ee,Oe=async Pn=>{if(x.current)return x.current;const Or=Sa.fetchQuery({...KA(e,r)}).then(ye=>(Pn.params.token=ye.token,ye.token)).finally(()=>{x.current=null});return x.current=Or,Or};if(!h.current||!ae)return;const Ae=new Fl;v.current=Ae;const vt=Ae.getText("content"),cn=new URL("/ws",window.location.origin);cn.protocol=cn.protocol==="https:"?"wss:":"ws:";const xt=new ffe(cn.toString(),`${t}/${r}`,Ae,{params:{token:ue}});O.current=xt,G$(xt,M??null,gr);const ft=()=>{gn()};gn(),xt.awareness.on("change",ft),P.current=()=>{xt.awareness.off("change",ft)};const mt=setTimeout(()=>{ae&&Z==="connecting"&&(se("Connection timeout - check if collab server is running on port 8787"),W("disconnected"))},1e4);xt.on("status",({status:Pn})=>{ae&&(Pn==="connected"&&clearTimeout(mt),W(Pn==="connected"?"connected":"disconnected"),Pn==="disconnected"&&Oe(xt).then(()=>xt.connect()).catch(Or=>{ae&&se(Or instanceof Error?Or.message:"Token refresh failed")}))}),xt.on("sync",Pn=>{if(!ae||!Pn)return;sessionStorage.getItem(_)&&sessionStorage.removeItem(_)});const Zn=Ae.getMap("status"),vi=()=>{const Pn=Zn.get("lastSavedAt"),Or=Zn.get("hasUnsavedChanges"),ye=Zn.get("checkpointInFlight");typeof Pn=="string"&&Ct(new Date(Pn)),Or===!1?(ut(!1),Tt("saved")):Or===!0&&E.current&&Tt(ye?"saving":"pending")};Q.current=Zn,R.current=vi,vi(),Zn.observe(vi);const Kl=new Me({state:wt.create({doc:vt.toString(),extensions:[Ey.of(Vre),$ne(Nne),lne(),fne(),Fte(),Oae(),Me.lineWrapping,Tfe(vt,xt.awareness),k.current.of(ht()),Me.updateListener.of(Pn=>{Pn.docChanged&&(je(Pn.state.doc.toString()),Pn.transactions.some(ye=>ye.isUserEvent("input")||ye.isUserEvent("delete"))&&(ut(!0),Tt("pending")))})]}),parent:h.current});g.current=Kl,oe(!0)}catch(ue){if(!ae)return;const Oe=ue instanceof Error?ue.message:"Unable to initialize editor";se(Oe),W("disconnected")}})();const re=()=>{document.hidden&&g.current&&!H&&sessionStorage.setItem(_,g.current.state.doc.toString())};return document.addEventListener("visibilitychange",re),()=>{var ue,Oe,Ae,vt;document.removeEventListener("visibilitychange",re),ae=!1,ve.abort(),Q.current&&R.current&&Q.current.unobserve(R.current),Q.current=null,R.current=null,(ue=P.current)==null||ue.call(P),P.current=null,(Oe=O.current)==null||Oe.destroy(),(Ae=v.current)==null||Ae.destroy(),(vt=g.current)==null||vt.destroy(),O.current=null,v.current=null,g.current=null,x.current=null}},[gr,a,n,r,M==null?void 0:M.user,U,_,t,e,N,ee,V]);const ht=w.useCallback(()=>{if(!It)return[];const ae=ve=>ve.length<=14?ve:`${ve.slice(0,12)}…`;return tne({class:"cm-blame-gutter",lineMarker:(ve,Ve)=>{const re=ve.state.doc.lineAt(Ve.from).number,ue=Dt.get(re),Oe=ae(Xt(ue)),Ae=ue!=null&&ue.touchedAt?Kt(ue.touchedAt):"";return new Rfe(Oe,Ae)},lineMarkerChange:()=>!0})},[It,Dt]);w.useEffect(()=>{const ae=g.current;ae&&ae.dispatch({effects:k.current.reconfigure(ht())})},[Dt,ht,It]);const Kt=ae=>{const ve=typeof ae=="string"?new Date(ae):ae;return Number.isNaN(ve.getTime())?"":ve.toLocaleString()};w.useCallback(async()=>{},[Ye,lt,H,r,Y,e]);const wn=w.useMemo(()=>Z==="disconnected"||Fe==="error"?"text-destructive":"text-muted-foreground",[H,Fe,Z]),et=w.useMemo(()=>Z==="disconnected"?"Offline":Fe==="error"?"Autosave error":Fe==="saving"?"Saving...":Fe==="pending"?"Changes pending":ze?`All changes saved • ${Kt(ze)}`:"All changes saved",[H,ze,Fe,Z]);return S.jsxs("div",{className:"note-editor flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[S.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border bg-muted/40 px-3 py-2",children:[S.jsx("div",{className:"min-w-0",children:S.jsx("div",{className:"truncate text-sm font-medium",children:Fn})}),S.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[S.jsxs("div",{className:"flex gap-0.5 rounded-md bg-muted p-0.5",children:[S.jsxs(gl,{children:[S.jsx(ml,{asChild:!0,children:S.jsx(Yn,{variant:"ghost",size:"icon-sm",onClick:()=>Ue("code"),className:Ne("h-6 w-8",Ce==="code"&&"bg-background shadow-sm"),children:S.jsx(OY,{className:"h-3.5 w-3.5"})})}),S.jsx(Ol,{side:"bottom",children:"Code"})]}),S.jsxs(gl,{children:[S.jsx(ml,{asChild:!0,children:S.jsx(Yn,{variant:"ghost",size:"icon-sm",onClick:()=>Ue("split"),className:Ne("h-6 w-8",Ce==="split"&&"bg-background shadow-sm"),children:S.jsx(MY,{className:"h-3.5 w-3.5"})})}),S.jsx(Ol,{side:"bottom",children:"Split"})]}),S.jsxs(gl,{children:[S.jsx(ml,{asChild:!0,children:S.jsx(Yn,{variant:"ghost",size:"icon-sm",onClick:()=>Ue("preview"),className:Ne("h-6 w-8",Ce==="preview"&&"bg-background shadow-sm"),children:S.jsx(xY,{className:"h-3.5 w-3.5"})})}),S.jsx(Ol,{side:"bottom",children:"Preview"})]})]}),H,S.jsxs(gl,{children:[S.jsx(ml,{asChild:!0,children:S.jsx(Yn,{variant:"ghost",size:"icon-sm",className:Ne("h-6 w-8",Z==="connected"&&"text-primary",Z==="connecting"&&"text-muted-foreground",Z==="disconnected"&&"text-destructive"),children:Efe[Z]})}),S.jsx(Ol,{side:"bottom",children:Z})]}),S.jsx("span",{className:`text-[11px] ${wn}`,children:et}),Qt.length>0?S.jsxs("div",{className:"flex items-center gap-1",children:[_r.map(ae=>S.jsxs(gl,{children:[S.jsx(ml,{asChild:!0,children:S.jsxs("span",{className:"flex items-center gap-1 rounded-full border border-border px-1.5 py-0.5 text-[10px] text-foreground",children:[S.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:ae.color}}),S.jsx("span",{className:"font-medium",children:Bt(ae.name)})]})}),S.jsx(Ol,{side:"bottom",children:ae.name})]},ae.id)),ar>0?S.jsxs(gl,{children:[S.jsx(ml,{asChild:!0,children:S.jsxs("span",{className:"rounded-full border border-border px-1.5 py-0.5 text-[10px] text-muted-foreground cursor-help",children:["+",ar]})}),S.jsx(Ol,{side:"bottom",children:mr})]}):null]}):null,S.jsxs(my,{children:[S.jsx(Oy,{asChild:!0,children:S.jsx(Yn,{variant:"ghost",size:"icon-sm",className:"h-6 w-8",children:S.jsx(bY,{className:"h-3.5 w-3.5"})})}),S.jsxs(yy,{align:"end",children:[S.jsxs(zl,{onClick:()=>d({to:"/workspaces/$workspaceSlug/notes/$noteId/history",params:{workspaceSlug:e,noteId:r},search:ae=>({labels:typeof ae.labels=="string"?ae.labels:void 0,view:ae.view==="code"||ae.view==="split"||ae.view==="preview"?ae.view:void 0})}),children:[S.jsx(AY,{className:"mr-2 h-4 w-4"}),"History"]}),S.jsxs(zl,{onClick:()=>jn(ae=>!ae),children:[S.jsx(QY,{className:"mr-2 h-4 w-4"}),It?"Hide blame":"Show blame"]})]})]})]})]}),S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[fe?S.jsx("div",{className:"px-3 pb-2",children:S.jsxs(cC,{variant:"destructive",children:[S.jsx(uC,{children:"Collaboration error"}),S.jsx(fC,{children:fe})]})}):null,S.jsxs("div",{className:Ce==="split"?"grid h-full min-h-0 flex-1 grid-cols-2 gap-0":"flex h-full min-h-0 flex-1 flex-col",children:[S.jsxs("div",{className:`relative min-h-0 overflow-hidden ${Ce==="preview"?"hidden":Ce==="split"?"border-r":""} border-border`,children:[ge?null:S.jsx(Zs,{className:"absolute inset-0 h-full w-full rounded-none"}),S.jsx("div",{ref:h,className:"editor-surface h-full w-full"})]}),Ce!=="code"?S.jsx("div",{ref:m,className:"preview-pane h-full min-h-0 overflow-auto bg-background p-4 text-sm",children:S.jsx("div",{className:"preview-content",dangerouslySetInnerHTML:{__html:tn}})}):null]})]})]})}function $fe(){const{workspaceSlug:t,noteId:e}=ju({from:"/_authed/workspaces/$workspaceSlug/notes/$noteId"}),n=or(),r=Ur({...vy(t||"",e||""),enabled:!!t&&!!e});if(w.useEffect(()=>{r.error&&ts(r.error)&&n({to:"/login",replace:!0})},[r.error,n]),r.isLoading)return S.jsx("div",{className:"flex h-full min-h-svh items-center justify-center",children:S.jsxs("div",{className:"w-full max-w-2xl space-y-4",children:[S.jsx(Zs,{className:"h-8 w-full"}),S.jsx(Zs,{className:"h-4 w-3/4"}),S.jsx(Zs,{className:"h-32 w-full"})]})});if(r.error&&!ts(r.error))return S.jsx("div",{className:"flex h-full min-h-svh items-center justify-center p-8",children:S.jsxs(cC,{variant:"destructive",children:[S.jsx(uC,{children:"Error"}),S.jsx(fC,{children:r.error.message})]})});if(r.error&&ts(r.error))return null;if(!r.data)return S.jsx(Xw,{to:"/workspaces/$workspaceSlug",params:{workspaceSlug:t||""},search:{labels:void 0},replace:!0});const i=r.data,s=i.blame??[];return S.jsx(_fe,{workspaceId:i.workspaceId,workspaceSlug:t||"",noteId:i.id,notePublicId:i.publicId,title:i.title,name:i.name,initialContent:i.content,initialUpdatedAt:String(i.updatedAt),initialBlame:s})}const Mfe=ls("/_authed/workspaces/$workspaceSlug/notes/$noteId/")({component:$fe,validateSearch:t=>({view:t.view==="code"||t.view==="split"||t.view==="preview"?t.view:void 0})});function Dfe({workspaceSlug:t,noteId:e,notePublicId:n,title:r,name:i,revisionHistory:s}){var x;const a=or(),[l,u]=w.useState(((x=s[0])==null?void 0:x.id)??null);w.useEffect(()=>{var k;u(((k=s[0])==null?void 0:k.id)??null)},[s]);const d=typeof window<"u"?_L(window):null,h=k=>Pt.parse(k,{breaks:!0}),g=k=>k.authorName??k.authorEmail??k.authorUserId,m=k=>{const C=typeof k=="string"?new Date(k):k;return Number.isNaN(C.getTime())?"":C.toLocaleString()},O=s.find(k=>k.id===l)??null,v=O?d?d.sanitize(h(O.content)):h(O.content):"";return S.jsxs("div",{className:"note-history flex h-full min-h-0 flex-col bg-background",children:[S.jsxs("div",{className:"flex items-center gap-3 border-b border-border bg-muted/40 px-4 py-3",children:[S.jsx(Yn,{variant:"ghost",size:"sm",onClick:()=>a({to:"/workspaces/$workspaceSlug/notes/$noteId",params:{workspaceSlug:t,noteId:n},search:k=>({labels:typeof k.labels=="string"?k.labels:void 0,view:k.view==="code"||k.view==="split"||k.view==="preview"?k.view:void 0})}),className:"h-8 px-2",children:S.jsx(oY,{className:"h-4 w-4"})}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("div",{className:"truncate text-sm font-medium",children:r}),S.jsxs("div",{className:"truncate text-xs text-muted-foreground",children:[i,".md"]})]})]}),S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[S.jsx("div",{className:"border-b border-border bg-muted/20 px-4 py-2",children:S.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Version history"})}),S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row",children:[S.jsx("div",{className:"w-full shrink-0 border-b border-border md:w-80 md:border-b-0 md:border-r",children:S.jsx("div",{className:"h-full max-h-[50vh] overflow-y-auto px-4 py-3 md:max-h-none",children:s.length>0?S.jsx("ul",{className:"space-y-1",children:s.map(k=>S.jsx("li",{children:S.jsxs("button",{type:"button",onClick:()=>u(k.id),className:`flex w-full flex-col gap-1 border px-3 py-2 text-left transition ${l===k.id?"border-primary/60 bg-primary/10 text-foreground":"border-border text-muted-foreground hover:bg-accent"}`,children:[S.jsx("span",{className:"truncate text-xs font-medium",children:g(k)}),S.jsx("span",{className:"text-[10px]",children:m(k.createdAt)})]})},k.id))}):S.jsx("p",{className:"text-muted-foreground",children:"No revisions yet."})})}),S.jsx("div",{className:"min-h-0 flex-1 overflow-auto bg-background p-4",children:O?S.jsx("div",{className:"preview-content max-w-4xl text-sm",dangerouslySetInnerHTML:{__html:v}}):S.jsx("p",{className:"text-muted-foreground",children:"Select a revision to preview."})})]})]})]})}function Nfe(){var m,O,v,x,k;const{workspaceSlug:t,noteId:e}=ju({from:"/_authed/workspaces/$workspaceSlug/notes/$noteId/history"}),n=or(),r=Ur({...vy(t||"",e||""),enabled:!!t&&!!e}),i=Ur({...QL(t||"",e||""),enabled:!!t&&!!e});if(w.useEffect(()=>{(r.error&&ts(r.error)||i.error&&ts(i.error))&&n({to:"/login",replace:!0})},[r.error,i.error,n]),r.isLoading||i.isLoading)return S.jsx("div",{className:"flex h-full min-h-svh items-center justify-center",children:S.jsxs("div",{className:"w-full max-w-2xl space-y-4",children:[S.jsx(Zs,{className:"h-8 w-full"}),S.jsx(Zs,{className:"h-4 w-3/4"}),S.jsx(Zs,{className:"h-32 w-full"})]})});const a=r.error&&!ts(r.error),l=i.error&&!ts(i.error);if(a||l){const C=a&&l?`${(m=r.error)==null?void 0:m.message}; ${(O=i.error)==null?void 0:O.message}`:((v=r.error)==null?void 0:v.message)||((x=i.error)==null?void 0:x.message)||"Failed to load note";return S.jsx("div",{className:"flex h-full min-h-svh items-center justify-center p-8",children:S.jsxs(cC,{variant:"destructive",children:[S.jsx(uC,{children:"Error"}),S.jsx(fC,{children:C})]})})}if(r.error&&ts(r.error)||i.error&&ts(i.error))return null;if(!r.data)return S.jsx(Xw,{to:"/workspaces/$workspaceSlug",params:{workspaceSlug:t||""},search:{labels:void 0},replace:!0});const h=r.data,g=((k=i.data)==null?void 0:k.revisions)??[];return S.jsx(Dfe,{workspaceId:h.workspaceId,workspaceSlug:t||"",noteId:h.id,notePublicId:h.publicId,title:h.title,name:h.name,revisionHistory:g})}const Lfe=ls("/_authed/workspaces/$workspaceSlug/notes/$noteId/history")({component:Nfe,loader:async({params:t,context:e})=>{const{workspaceSlug:n,noteId:r}=t,{queryClient:i}=e;if(!(!n||!r))try{await i.ensureQueryData(vy(n,r)),await i.ensureQueryData(QL(n,r))}catch(s){if(ts(s))throw wh({to:"/login",replace:!0})}}}),zfe=RV.update({id:"/login",path:"/login",getParentRoute:()=>BO}),jfe=Uq.update({id:"/consent",path:"/consent",getParentRoute:()=>BO}),Fy=qq.update({id:"/_authed",getParentRoute:()=>BO}),Ife=Gq.update({id:"/",path:"/",getParentRoute:()=>Fy}),Zfe=Kq.update({id:"/workspaces/",path:"/workspaces/",getParentRoute:()=>Fy}),EI=pK.update({id:"/workspaces/$workspaceSlug",path:"/workspaces/$workspaceSlug",getParentRoute:()=>Fy}),dC=mK.update({id:"/notes/$noteId",path:"/notes/$noteId",getParentRoute:()=>EI}),Xfe=Mfe.update({id:"/",path:"/",getParentRoute:()=>dC}),Bfe=Lfe.update({id:"/history",path:"/history",getParentRoute:()=>dC}),Ufe={AuthedWorkspacesWorkspaceSlugNotesNoteIdHistoryRoute:Bfe,AuthedWorkspacesWorkspaceSlugNotesNoteIdIndexRoute:Xfe},Vfe=dC._addFileChildren(Ufe),qfe={AuthedWorkspacesWorkspaceSlugNotesNoteIdRoute:Vfe},Yfe=EI._addFileChildren(qfe),Gfe={AuthedIndexRoute:Ife,AuthedWorkspacesWorkspaceSlugRoute:Yfe,AuthedWorkspacesIndexRoute:Zfe},Wfe=Fy._addFileChildren(Gfe),Ffe={AuthedRoute:Wfe,ConsentRoute:jfe,LoginRoute:zfe},Hfe=BO._addFileChildren(Ffe)._addFileTypes(),Kfe=P4({routeTree:Hfe,context:{queryClient:Sa}});function Jfe(){const t=document.getElementById("root");if(!t)throw new Error("Root element not found");qX.createRoot(t).render(S.jsx(w.StrictMode,{children:S.jsx(ZX,{client:Sa,children:S.jsx(M4,{router:Kfe})})}))}Jfe();
321
+ //# sourceMappingURL=index-zo0m3331.js.map